Last time, after a long discussion, we figured out how to calculate RPM. This time, hopefully, without a lot of discussion, we will get some detail about our ignition events. I also hinted before, that this will be done on a per-cylinder basis, and engines with multiple cylinders, would have multiple instances of the same operation.
I teach through metaphor as a means to explain a complicated idea using familiar imagery. The ignition management process is kind of like a carousel ride, with the riders trying to grab the gold ring. For a majority of the ride, the rider watches the target, and makes the plan. Then a short period of time before, adjust seating, and extend an arm. Then at the exact moment, clutch the ring and win the prize. Looking at the problem from the viewpoint of a single cylinder, the process is similar for ignition. The majority of the time is used for configuration and determining when we need to perform the spark. then, a short time before, we start dwell, then at just the right moment, the spark is ignited.
With this in mind we begin with the first group of equations. Each cylinder has, what is called a top dead center (TDC) point in its cycle. This is, independent of whether it is a two or four cycle operation, the position in the cycle of full compression, before the power stroke of the cycle following ignition. Moving earlier in the cycle is referred to as advance, while moving later in the cycle is referred to as retard. Advance and retard are angle based measurements and managed in degrees. Several factors go into the calculation, but for now the result is all that is important so the resultant total advance will be used for a working operator. The expression to add timing, means adding more angle to total advance. Conversely, taking away timing, or retarding, means subtracting angle from total advance.
Two factors go into the calculation of the total advance, first is rotational speed of the engine (measured in rpm), the second is the burn rate of the fuel (nothing happens instantly). Many factors affect both of these values, and need to be monitored over the course of operation. The desired effect is to have the maximization of the expansion of ignited gasses occur at the instant past TDC (for measurement this can be TDC) to produce the maximum amount of energy. This yields our first calculation.
sparkEventcyl = TDCcyl – totalAdvance;
Which seems pretty simple, but TDC is a point in the cycle for each cylinder and there is one TDC for each, so this calculation needs to be repeated for each cylinder. This brings the discussion to “timing” which is the mechanical derivative of the angle to time conversion. Even though there is a TDC for each cylinder, in discussion when the term TDC is used it references TDC of cylinder 1 or the first cylinder in the firing sequence. (Again mechanical versus mathematical definitions so cylinder numbers are one based and not zero based)
The spark event now depends on the spark generation, a dwell must be started some amount of time prior to the spark event. Again, several factors go into the calculation but for simplification, the resultant total dwell will be used for now. Total dwell is measured in time, which cannot be directly combined with the spark event and a conversion needs to occur. The two calculations for converting between time and angle are:
eventAngle = DEGS_PER_REV * eventTime / ROTATIONAL_SPEED;
or
eventTime = ROTATIONAL_SPEED * eventAngle / DEGS_PER_REV;
For discussion the calculations will be maintained in angle here, and the conversion will be from total dwell to dwell angle. This yields the second equation for start of dwell.
dwellStartcyl = sparkEventcyl – dwellAngle;
Again this equation is simple, but needs to be repeated for each cylinder. After the preceding operation we have obtained two events for each cylinder, the start of dwell, and the spark event. Both events need to be scheduled to occur based on the operation of the engine, and require a scheduling mechanism to link the event to the action.
This is a good point to start collecting constants and variable information. From the previous discussion there was a t0 and t1 used for the event time of the previous tooth event and the current tooth event. With that was dT for the delta between the two events, these items are candidates for variable data, where t1 becomes the new t0 at the next event. To keep track of information, the system will use a section called calibration values. Calibration values, are values that can be different for a specific motor's operation, but are not likely to change substantially during operation. Candidates for calibration values are; teeth per revolution, cam to TDC1, cylinder count, and cylinder TDC (for each). Last set of items are constants. These are physical constants that do no change like mass of dry air at sea level (handy for fueling), or number of degrees in a rotation, etc.
The basic discussion is complete, and the process is now ready to start coming together. The determination of angular velocity has already been determined, but it is necessary to locate the angular position in the rotation as well. The value of cam to TDC is used to locate the correct angle. From the previous discussion, it was determined, the cam event provides the angle of the crank event that preceded using the formula d0 = 2 * {degrees_per_rotation} - ((cam to TDC + 1) * degrees_per_tooth). For the question that is raised, "why use a term degrees per rotation in place of some accepted value?", please accept that numbering systems are being kept as flexible as possible early on in the process and units might need to be adjusted.
Finally for this section, as soon as the value of current angle (meaning the most recent crank event) it can be determined the time until start of dwell and ignition event (spark). This is done using the formulas
rotation_distance = sparkEventcyl - d0 {where d0 is the angle of the most recent event}
if rotation_distance is a negative number, then add (2 * degrees_per_rotation). Then converting from angle to time
time_to_event = ROTATIONAL_SPEED * rotation_distance / degrees_per_rotation
Similar equations are performed to determine start of dwell.
Promised information; a discussion about degrees in a circle. In mathematics, the units for angles is calculated in degrees, radians, and grads. Degrees are used because they date back centuries. Radians are used, mostly in mathematics because they represent a pi based ratio. Grads are used because they provide a decimal percentage of distance around the circle. Because this is a computer system, and integer operations are more portable to other processors, the system here will use a 16 bit value for angle where 360 degrees is equal to 32768. This was chosen, because two rotations are needed per cam cycle, and it also provides a signed angle capability. I leave it to you, to perform a number of operations to prove out the logic. For discussion of theory, the named constant will be used. Once the discussion changes to applied operation, the actual value will be used.
More to come,
Jack