The system actually has three sensors in the format offset as per the diagram.
However they are a royal pita to get out, so I'm looking at if one fails ignoring it, and creating the missing pulses from the remaining one/s.
The system actually has three sensors in the format offset as per the diagram.
However they are a royal pita to get out, so I'm looking at if one fails ignoring it, and creating the missing pulses from the remaining one/s.
some ideas
if cmc is the missing pulse then c_replacement lag would be 2x the lag between a and b ,duration is cma duration
if cmb missing then b_replacement lag is half the lag between a and c ,duration is cma duration (some info would be lost )
all calc have t0 at rising edge of cma
problem is to scale a timer to get sufficient resolution over minimum and maximum expected pulse widths
another thought
maybe some type of bucket brigade
It seems to me that monitoring the sensors for failure and producing the pulse train you describe could be two functions. By assigning one pin to each sensor - the presence of a second pulse on any pin, at any rotational speed, will require that one pulse will have occurred on all other pins - except failed sensors. The speeds are not great, even at 600 RPM either of the list MCUs should not have issue. Likely, even without interrupts.
I'm not sure how "error tolerant" the system is, but it seems that there will be need of some... as, when the shaft is speeding up or slowing down, calculating from the previous pulse will be flawed, unless you intend to use some pretty complex math - far beyond me, disregard post...
Producing two pulses, offset by 20 degrees, does not require monitoring three incoming pulses. Monitor one - any one - and divide the rotational speed by (360/20) 18 to determine the offset; repeat on the second signal for the third. Or, you might take the time between any two functioning sensors directly. A pre- or post-scaler may help scale the numbers; I cannot recall if these are settable by software but, if so, add a bit to the prescaler on a timer rollover, deduct one as timer values approach 0; the manual approach, counting rollovers, will work as well.
I may be way off in my approach, but I'm a little confused by the description you provided. In the initial post you describe 6 pulses per rotation, then later suggest 3 sensors provide the pulse pattern you attached. Neither is there any indication of scale or style of the pulses. The drawing seems to indicate square waves, like an encoder, but I would expect pulses from such a device to be equally spaced around the rotation and to have fewer sensors. Hall sensors would typically present a much shorter high (or low) pulse with variable time between pulses, but the drawing does not show this. Not exactly sure the hardware setup, so just some general thoughts...
Last edited by Amoque; - 14th September 2014 at 13:08.
Bookmarks