Tuesday, 21 February 2012

Event Control Started

This week I have been programming the module which is responsible for angular event control.
So far the soft ware can pick the next event from a list and then calculate which crank sensor tooth it should be time referenced from and the time-stamp with which to trigger the output compare module to start the event.

I am also converting the software to use 16bit integers for angle variables instead of floating point to save on processing time.

Friday, 17 February 2012

Software Design Spec

Combustion Pressure Monitoring Subsystem Software Design Specification


Inputs:
  • Crankshaft Position (Frequency Signal - Interrupt Based)
  • Engine Load (Analogue signal – ADC)
  • Spark Gap Ion Current (Analogue signal – ADC)

Outputs:
  • Optimum ignition timing referenced with engine load and RPM.

Software Components:

Crankshaft Position Sensor Decoder

  • Takes input from crankshaft position sensor via input capture.
  • Uses crankshaft position sensor input to constantly update engine RPM and crankshaft position.
Angular Event Generation

  • Uses engine RPM and crankshaft position inputs to calculate reference tooth and timing variables for output compare to trigger asynchronous events.
  • Steps through each event which has not been carried out this cycle to update timing variables.
Angular Event Sorting

  • Steps through all current events and determines which event is next in queue for triggering.
  • Next event is assigned to an output compare module.
  • Output compare becomes active when the next event reference tooth is reached.

Angular Event Triggering

  • Output compare calls event at predetermined time to achieve correct phase.

Ion Current Sampling

  • Creates asynchronous events to log samples of the spark gap ion current from the ADC module.
  • Creates and maintains buffers, pointers and variables to store samples for later use.

Peak Cylinder Pressure Point Calculation

  • Operates on the stored ADC samples to determine the crankshaft angle where peak cylinder pressure occurs.
  • The results are stored with reference to the engine RPM and load to allow the ECU to update the ignition timing maps.

Timing information transmission

  • The stored results are transmitted to the ECU via UART, CAN, SPI?

System Block Diagram

Thursday, 9 February 2012

Got SYNC!

Last night my mucking around with MPLAB proved fruitful and I was able to simulate an external interrupt and timer interacting with my program to track the crank shaft position.