Dual differential odometry video
Graham Stabler
Posts: 2,510
I couldn't resist after getting this working yesterday and then adding some graphics today.
Its basically two quadrature encoders taped together with a wheel attached to each. Position and angle is derived encoder-pulse by encoder-pulse in assembly, that's what all that cordic stuff is about, doing the trig.
Then it is displayed as a sprite on the screen. There is a trail of the last 20 points displayed (the assembly cog doesn't loose track but the graphics is slower) and there is also a vector that pops out of the body showing inclination as per the memsic object demo
here's the video: Dual differential odometry
Thanks to Chip and Beau for the cordic code mine was based on and some nice ideas on the graphics side from chips object.
Graham
p.s. This is for work, probably can't release all code but Cordic stuff will be.
Its basically two quadrature encoders taped together with a wheel attached to each. Position and angle is derived encoder-pulse by encoder-pulse in assembly, that's what all that cordic stuff is about, doing the trig.
Then it is displayed as a sprite on the screen. There is a trail of the last 20 points displayed (the assembly cog doesn't loose track but the graphics is slower) and there is also a vector that pops out of the body showing inclination as per the memsic object demo
here's the video: Dual differential odometry
Thanks to Chip and Beau for the cordic code mine was based on and some nice ideas on the graphics side from chips object.
Graham
p.s. This is for work, probably can't release all code but Cordic stuff will be.
Comments
I have the Trig in Code (BASIC Language) and I have to convert it to something that will work on the propeller... It's nice to see that you have this completed.
I like the video. Thanks for sharing... Any code that you can share please forward it along.
I actually think I'm usind similar Encoders· I have two US DIgial S1-100-B's
Best Regards,
Eric
What is your application if I might ask?
Graham
A proper object will follow that will allow spin programs to access a cordic cog that will do a number of different operations but often you want raw speed so you may want to just cut and paste the asm.
Cheers,
Graham
My·project is I'm trying to make a moble robotic platform. I want it to know where it is based on encoder inputs... These encoders will not be attached to the drive wheels but will be free wheeling so just incase the wheels slip I won't accumulate a ton of error.
Anyhow.. I am Using the SX28 the read two encoders and sends that information to the propeller. I know I could us the propeller for the encoders but one of my goals was to interface the SX28 with the propeller. Basically the Propeller receives an accumulated count of encoder ticks. So My input to the Cordic Routine should be (Wheel Diameter * PI ) / EncoderTicks. If I know the distance the left wheel move and the distance the right wheel move. I can calculate (X,Y,Theta).·
The cordic routing computes R.Cos(theta) and R.Sin(theta) how you use those functions is up to you, as I was evaluating the position on every single encoder pulse my moves are always made up of little triangles (unless both move in same direction at same exact time) so it helps find the lengths of the triangles. If you do it a different way you may need to process the data differently.
Graham
That is something Beau thought up and I guess only the Propeller can do.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"If you want more fiber, eat the package.· Not enough?· Eat the manual."········
These puppys give me 2000 ppr after decode.
Position seems very accurate so far, I intend to do some acid tests when I get some round wheels [noparse]:)[/noparse]
Graham