View Single Post
  #16   Spotlight this post!  
Unread 10-09-2008, 17:06
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: Servo 'smoothing'

Quote:
Originally Posted by Kevin Sevcik View Post
Erik,

Translating your IIR to fixed point doesn't seem entirely straightforward to me. Or, at least, we should remind the audience of the wonderful effects known as truncation and loss of precision. You'd need to process your new value and carry your old value as scaled integers, or you'd lose everything behind the decimal point and get weird jumps in your values. So it'd look something like:
Kevin - You are 100% correct in calling me on missing the target audience. Sorry all!

You will have to forgive me, I was working under the assumption that the processor had a built-in 32bit FPU. I'm so glad that >> and << optimizations will soon be a thing of the past. I started on the old PBASIC systems, and quickly learned that some optimizations simply obfuscate code. Now I make sure that the first pass is as easy to read as possible - sweet beautiful pseudo code. The second pass can compile.


Your translation is correct, I think. For those following along at home, Kevin moved tau from the 0..1 domain to the 0..15 domain. This allows him to use fixed point math and the shift operator. I'd move it into the 0..255 domain so you can use a wheel input as tau. If you do this, use 16 bit numbers.