A little more work on the calculations.
So now that I know the RPM what's next? Well I need to know how fast are the degrees flying by.
so (RPM x 360 degrees) / 60 = degrees per second.
Example: 300 x 360 = 108,000 per minute
108,000 / 60 = 1,800 degrees per second
I know that my Hall sensor is 55 degrees before top dead center, so how long do I have before the crank goes from 55 degrees to TDC?
Time to TDC is 55 / 1,800 = 0.03056 seconds or 30.56 milli-seconds.
How much time is 1 degree? I can reduce this down to 1 degree by dividing the time by 55.
0.03056 / 55 =0.000556 seconds per degree or
1 / 1,800 = 0.000556 seconds per degree or 0.556 milli-sec or 556 micro-sec
so if I wanted say to have 10 degrees advance BTDC then I would tell the MCU to wait 45 degrees before firing and since the Arduino works with either milli or micro seconds, I'll use micro seconds because I plan to go higher RPMs:
45 x 556 usec = 25,020 usec. before sending out a coil fire trigger.
The 1 thing I haven't mentioned yet is the amount of time the MCU takes to calculate the RPM, do the table lookup from the EEROM to get the amount of timing advance at the calculated RPM, and send out the fire trigger pulse. I can setup a way in the code to time all this; trigger in, calc, lookup, and trigger out. Once I have this I then need to subtract that from the 55 degrees. So if the calculations take say 1 milli-second to do then my wait time would be 25,020 - 1,000 = a wait time of 24,020 usec before the fire trigger.
All this can seem a bit mysterious I know. I've had people with a degree in computer science that can't quite understand that the MCU can not forecast the future and needs time to do the calculation and WAIT to fire the coil. I think the confusion lies in the terms used such as advance the timing by telling the MCU to wait less time. But one has to remember that if you want to use an advance of say 20 BTDC then the Hall can not be set at 20 degrees BTDC because 20-20 = 0. The MCU will not have any time to do the calculations and will fire the coil at less than 20 degrees. This is because as the MCU is doing the calculations the crank is still turning toward TDC and time is burning up and the MCU will fire after the calculations are done, so no advance. This also brings us to "is the MCU fast enough to do the calculations at the RPM I want to use?" As for the Arduino Nano I don't know yet because I haven't finished my testing. I do have MCUs that are up to 200 times faster just incase the Nano can't handle 10,000 RPM on a single cylinder but, I think it can. I know it will not do 5,000 RPM on a 18 cylinder engine. This also brings us to "is there enough time to charge the coil 2-5 msec?" Might have to use more than 1 distributor and use 2 Nanos/MCUs or 2 distributors and 1 fast MCU. Mind you one can always use 18 LS1 coils and a fast MCU.
Cheers
Ray.
So now that I know the RPM what's next? Well I need to know how fast are the degrees flying by.
so (RPM x 360 degrees) / 60 = degrees per second.
Example: 300 x 360 = 108,000 per minute
108,000 / 60 = 1,800 degrees per second
I know that my Hall sensor is 55 degrees before top dead center, so how long do I have before the crank goes from 55 degrees to TDC?
Time to TDC is 55 / 1,800 = 0.03056 seconds or 30.56 milli-seconds.
How much time is 1 degree? I can reduce this down to 1 degree by dividing the time by 55.
0.03056 / 55 =0.000556 seconds per degree or
1 / 1,800 = 0.000556 seconds per degree or 0.556 milli-sec or 556 micro-sec
so if I wanted say to have 10 degrees advance BTDC then I would tell the MCU to wait 45 degrees before firing and since the Arduino works with either milli or micro seconds, I'll use micro seconds because I plan to go higher RPMs:
45 x 556 usec = 25,020 usec. before sending out a coil fire trigger.
The 1 thing I haven't mentioned yet is the amount of time the MCU takes to calculate the RPM, do the table lookup from the EEROM to get the amount of timing advance at the calculated RPM, and send out the fire trigger pulse. I can setup a way in the code to time all this; trigger in, calc, lookup, and trigger out. Once I have this I then need to subtract that from the 55 degrees. So if the calculations take say 1 milli-second to do then my wait time would be 25,020 - 1,000 = a wait time of 24,020 usec before the fire trigger.
All this can seem a bit mysterious I know. I've had people with a degree in computer science that can't quite understand that the MCU can not forecast the future and needs time to do the calculation and WAIT to fire the coil. I think the confusion lies in the terms used such as advance the timing by telling the MCU to wait less time. But one has to remember that if you want to use an advance of say 20 BTDC then the Hall can not be set at 20 degrees BTDC because 20-20 = 0. The MCU will not have any time to do the calculations and will fire the coil at less than 20 degrees. This is because as the MCU is doing the calculations the crank is still turning toward TDC and time is burning up and the MCU will fire after the calculations are done, so no advance. This also brings us to "is the MCU fast enough to do the calculations at the RPM I want to use?" As for the Arduino Nano I don't know yet because I haven't finished my testing. I do have MCUs that are up to 200 times faster just incase the Nano can't handle 10,000 RPM on a single cylinder but, I think it can. I know it will not do 5,000 RPM on a 18 cylinder engine. This also brings us to "is there enough time to charge the coil 2-5 msec?" Might have to use more than 1 distributor and use 2 Nanos/MCUs or 2 distributors and 1 fast MCU. Mind you one can always use 18 LS1 coils and a fast MCU.
Cheers
Ray.