What I meant was, how to mimic the crankshaft signal pattern on the simulator circuit that feeds the simulated waves into the CarDuino. While in traffic, you can only afford split second glances at your CarDuino screen anyway, so it does not add any value to have an rpm reading that is dead precise. 3163 rpm would show up on the TFT screen either as 3160 or 3150. Once my CarDuino can reliably calculate the revs, I was going to round off whatever figure it comes up with to the nearest multiple of ten, maybe even fifty, before displaying it on the screen. For simplicity's sake, it will definitely be the way forward to just count the rising edges as they happen, and simply assume that one crankshaft turn is 32 teeth/ 32 risings. No, I completely understand what you're saying. Is that an issue for a graphical user interface? Basically itd say 3000 RPM on the screen, but in reality it could be between 29 ish. So we know esentially, we are 1600 ticks +/- 4 ish (might be +/- 2.someone may clarify).īeing 4 rises/ticks out out of 1600 = 0.25% inaccuracy. Now we don't know where the crank ended on a cycle.might be in a "dip" bit where there is a gap or not.but there are only 4 in that last cycle. You'd also be using an interupt and a timer to time the time between 2 interupts on a pin.even more hardware and software usage with more complication.Įxample, while driving at 3000rpm, the crankshaft will turn from its current position 3000/60 times = 50 revolutions of the crankshaft in a second. You'd use an interrupt for what you want, which causes "some" code blocking. I think you are adding a lot of complication for the sake of say 0.3% accuracy in revs for a user's graphical user interface. Then reset the timers to 0 again (TCNT0 = 0 etc.) ready for the next loop round. You will just be incrementing them using an "external clock source".the crankshaft sensor/fuel injector sensors/ etc.Īll your main loop will then do, is every cycle of the loop() you will check the time gone by (millis() on a spare timer) and then get the values held in the timer registers (like TCNT0, TCNT1, TCNT2 etc.). The timers are hardware.you can only set one software variable for them, the "overflow".but you wont be doing that. You will be using timers to count pulses from the crankshaft.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |