Can someone please check my working out here - Page 1
Forum section: electronics / general

author: Mjolinor
author_rank: Frequent Contributor
timestamp: July 28, 2018, 08:09:31 am
content: This should be mental arithmetic but I seem to be getting stupid numbers out of it.I am trying to write some software to take a hall effect input and fire a spark with application of an advance / revs curve. I will extract the information using a trend line in a spreadsheet to give me the times so from a degrees advance / rev graph from the net I need to extract a "time to spark" in microseconds but the number seem crap so maybe I am thinking wrong.Starting at 500 rpm1/500 = 8.3 revs per second8.3 = 0.12 seconds per rev0.12 = 0.000333 seconds per degreeOn to advance:At 500 RPM advance = 1 degree1 degree = 333 usCounting from 40 degrees before TDC (detect is at 40 degrees before TDC)40 degrees @ 500 RPM = 13333.33 UStime to fire after 40 degrees before TDC = 13000 USAnother example at 5000 RPM1/5000 = 83.3 revs per second83 = 0.012 seconds per rev0.12 = 0.0000333 seconds per degreeOn to advance:At 5000 RPM advance = 24 degree24 degree = 800 usCounting from 40 degrees before TDC (detect is at 40 degrees before TDC)40 degrees @ 5000 RPM = 1333.33 UStime to fire after 40 degrees before TDC = 533 USIf someone can just check my thinking it will save me making a cock up and having to go back later if it is not right. It should be easy but my noodle is baking trying.

author: brucehoult
author_rank: Super Contributor
timestamp: July 28, 2018, 08:36:52 am
content: 60/500/360*(40-1) = 13000 us60/5000/360*(40-24) = 533 usYup.

author: mikerj
author_rank: Super Contributor
timestamp: July 28, 2018, 10:32:06 am
content: Be aware the crankshaft speed changes considerably over each rotation, so using a single trigger point can introduce surprisingly large errors, especially during acceleration. This is the primary reason that modern engines sensor crank position at multiple points e.g. 36 or 60 are common.

author: Mjolinor
author_rank: Frequent Contributor
timestamp: July 28, 2018, 10:48:52 am
content: Quote from: mikerj on July 28, 2018, 10:32:06 amI realise that and it is why I will also have one just before TDC for starting.That will give me 4 points, detect then un-detect at about 40 degrees before to give me a rev figure and detect around 10 before then un-detect at 4 before (possibly a different hall effect sensor). Consecutive detects on the same sensor to give me a check figure for revs compared to the detect un-detect at 40 before to give me rotational speed variation, 4 before is the static timing of the standard ignition points open. Old motor bike.I had considered using the starter ring gear and also considered using a knock sensor, both of which are possible and not really hard but I do not want to make any changes to the basic bike in a way that is not entirely reversible as it will affect the value of the bike if it cannot be made original retrospectively.

author: mikerj
author_rank: Super Contributor
timestamp: July 30, 2018, 01:23:54 pm
content: Quote from: Mjolinor on July 28, 2018, 10:48:52 amThat's a sound plan, many of the OEM (analog) ignition modules use a secondary pulse input close to TDC for starting. This avoids dealing with the huge speed variation during cranking and potentially having to handle multiple timer overflows due to low cranking speed.Is this a single cylinder engine? Are you going to include any engine load sensing?