??? 05/06/05 16:56 Read: times |
#93101 - A (better?) way Responding to: ???'s previous message |
Stanley,
I think Steve is suggesting the formula in your post doesn't implement hysteresis, or deadband. Try this - Delta = |ADCNew - ADCAccepted| if (Delta => HystVal) then ADCAccepted = ADCNew Elevation Position = f(ADCAccepted) Russell Bull's post of implementing filtering could be useful, too. Try implementing an exponential filter in the firmware similar to the following - ADCAccepted = Kpast * ADCAccepted + Knew * ADCNew subject to: Kpast + Knew = 1. Recognize the following - if Knew > Kpast, the filter output is more responsive if Kpast > Knew, the filter output is more sluggish Make Knew and Kpast easily implemented using right shifts, or right shifts and adds of the variables ADCAccepted and ADCNew. My experience is that lots of precision in the Knew and Kpast weighting is not necessary EXCEPT when the constants are in a high gain loop. In that case the high gain induces rounding errors that are exacerbated by truncation error from previous operations. Cheers, Bruce |
Topic | Author | Date | |
It's alive! | 01/01/70 00:00 | ||
Use the Force Luke! | 01/01/70 00:00 | ||
I'm thinking... | 01/01/70 00:00 | ||
filtering | 01/01/70 00:00 | ||
Shaking | 01/01/70 00:00 | ||
Mainly in vertical | 01/01/70 00:00 | ||
Damping | 01/01/70 00:00 | ||
Maybe the ADC | 01/01/70 00:00 | ||
cause/cure of multiple sclerosis | 01/01/70 00:00 | ||
Unstable feedback control system!! | 01/01/70 00:00 | ||
HALF stable | 01/01/70 00:00 | ||
Speculation | 01/01/70 00:00 | ||
X - Y < constant | 01/01/70 00:00 | ||
Deadband | 01/01/70 00:00 | ||
Hysteresis! | 01/01/70 00:00 | ||
oh yea ? | 01/01/70 00:00 | ||
A (better?) way | 01/01/70 00:00 | ||
Sample code ? | 01/01/70 00:00 | ||
Exponential Filter Code | 01/01/70 00:00 | ||
Cooooool | 01/01/70 00:00 | ||
Viewtiful | 01/01/70 00:00 | ||
I like it | 01/01/70 00:00 | ||
Extinguisher? | 01/01/70 00:00 | ||
Exactly! | 01/01/70 00:00 | ||
why the hate | 01/01/70 00:00 | ||
No hate | 01/01/70 00:00 | ||
Well done Eric | 01/01/70 00:00 | ||
smokers![]() | 01/01/70 00:00 | ||
Yes,It is! | 01/01/70 00:00 | ||
May not be visible light | 01/01/70 00:00 | ||
Electronic cat? | 01/01/70 00:00 | ||
Good work | 01/01/70 00:00 | ||
Cant Play on my Win2000. | 01/01/70 00:00 | ||
windoz media player > 7.0 | 01/01/70 00:00 | ||
Download Accelerator | 01/01/70 00:00 | ||
Just An Idea! | 01/01/70 00:00 | ||
Great! | 01/01/70 00:00 | ||
Seems to be hungry... | 01/01/70 00:00 | ||
Try point source light | 01/01/70 00:00 | ||
Or rotate the light source by 90° | 01/01/70 00:00 | ||
Not point source | 01/01/70 00:00 | ||
post the code to here | 01/01/70 00:00 | ||
Nice! | 01/01/70 00:00 | ||
What are the light sensors? | 01/01/70 00:00 | ||
***NEW CLIP HERE*** | 01/01/70 00:00 | ||
Obvious improvement! | 01/01/70 00:00 | ||
not shaking anymore | 01/01/70 00:00 |