News:

New Users: Send info@vems.com an email with your account name. I've turned off auto-approve to reduce the 100 new spam accounts a day. Thanks, -Jason

Main Menu

how to measure the speed of wheels? Which algorithm?

Started by mr_g, February 15, 2010, 03:17:33 PM

Previous topic - Next topic

mr_g

I have an intellectual dilemma, on creating algorithm for traction control module. Approximately I have:

700hz front approx 100kmph
430hz rear approx 100kmph

And twice as many pulses (interrupts) in the processor ... Let the processor run at 8MHz or 16MHz if necessary (the same as in VEMS v3)...

So, if I count the pulses per second, I would have each measuring 1 second late... This is not usable for TCM...

If I measure the time between 2 pulses, around 0.7ms, there will be an error in recalculation of the time in the speed will be greater...

What I thought was to measure the duration of 10 or 50 pulses... This would come in the time of 7ms or 35ms... Delay of 35ms for TCM electronics is not so bad, and the error would have been 10 or 50 times less then measuring only one pulse...

Or combine all those undergarments like every 0.1s, measure number of pulses, and meassure last pulse that didn't complete?

BTW, at 16MHz, 1 clock stroke is less than a micro-seconds, so I think that the processor must be fast enough to do 4 wheels and an algorithm for reducing the torque...

How does VEMS measure speed of a wheel or a speed of a engine?  ???

dnb

Count the teeth using the "time between n teeth" method and use a Kalman filter to smooth the speed.  A simple alpha filter with short memory would be sufficient.

N could even be 1 using this method because you will average out the timing errors.

mr_g

The error when converting time into a speed could be great in my opinion... And ATmega128 doesn't have hardware divider...

Does anybody know how VEMS do it?

dnb

Quote from: mr_g on February 18, 2010, 05:41:49 PM
The error when converting time into a speed could be great in my opinion...

That's why you smooth it with a sensible filter!

Let's assume you count clock cycles between wheel teeth:

If you use software interrupts on a processor running at 8Mhz, there are 11428 full clock cycles between wheel speed teeth.  It is unlikely more than a handfull of cycles will go "missing" between cycles.  500 clock cycles is only 4% at this speed, and at slower wheel speeds it is a considerably smaller percentage. 
I doubt this will cause too many problems with errors.

And if you're worried then have an "association test" as part of your filter - eg limit the maximum amount the wheel speed can change between sample windows, or simply throw the sample you suspect away and "coast" the last good speed.

GintsK


dnb

I used a LM2917 for my TVR tacho.  They work pretty well but noise may be prove to be an issue in some applications.

mr_g

Quote from: dnb on February 19, 2010, 02:10:24 AM
If you use software interrupts on a processor running at 8Mhz, there are 11428 full clock cycles between wheel speed teeth.  It is unlikely more than a handfull of cycles will go "missing" between cycles.  500 clock cycles is only 4% at this speed, and at slower wheel speeds it is a considerably smaller percentage. 
I doubt this will cause too many problems with errors.

time dividing to get the speed will take many clock cycles as ATmega doesn't have clock divider...

But thanks anyway... I would need this to calculate average consumption.. ;)

dnb

Not sure what you mean.  ATmega has at least one 16bit counter.  Use this (in a free-running mode) to count clock cycles between interrupts triggered by the wheel speed sensor.  (All the interrupt code would need to do is a subtraction of 2 numbers, check if the counter had wrapped and add a constant if so)

Outside of the interrupt, you can work out the speed from the time period - it doesn't matter really how long this takes since it will only affect latency, not accuracy.

Are you saying you've used up all the timers?



rob@vems.co.uk

Would anyone really want to use those connectors on their cars?

mr_g

Why not? I'm using them for a five years in about 150 cars in other application without any noticeable problems...



What do you have in mind?

gunni


mr_g

There is no high currents... The biggest current is 0.5A... So it's up for the task...

It is resistant to mechanical influence as long it is inside the vehicle in dry place.. :D 

dnb

G_man - I use those connectors on my TVR heater controller.  They work fine (and the OEM version used the same connectors)

I think Rob was refering to the PS2 connectors from lost's post.  These don't belong on cars for fairly obvious reasons.