Shop OBEX P1 Docs P2 Docs Learn Events
Dual differential odometry video — Parallax Forums

Dual differential odometry video

Graham StablerGraham Stabler Posts: 2,510
edited 2006-10-20 23:04 in Propeller 1
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.

Comments

  • SailerManSailerMan Posts: 337
    edited 2006-10-18 22:29
    Wow!! This is almost exactly what I was working on.

    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
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2006-10-18 22:55
    Well I'll post the cordic stuff tommorow in this thread, its assembly and you can just drop it in to your program (assuming its assembly also), given a vector length and angle it resolves it into x and y directions.

    What is your application if I might ask?

    Graham
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2006-10-19 09:47
    Attached is some code that does a cordic, its not a real object but allows you to prove to yourself that the code works and then you can paste it in to your own code. Read the comments if confused, if really confused ask.

    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
  • SailerManSailerMan Posts: 337
    edited 2006-10-20 11:34
    I know how to do dual odometery, but not the cordic way... and on top of that it is in ASM..needless to say I dont understand the code. shakehead.gif

    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).·
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2006-10-20 12:49
    It doesn't work properly with accululated data, there are several ways of getting the same accumulated data from the different moves, the errors will tend to mount up. For example you get the same data if you turn slightly and go forward as you do if you go forward and then turn slightly but you are indifferent positions.

    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
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-10-20 17:11
    Quite impressive. I see you are using two servos as rotary senors/encoders.

    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."········
    ···················· Tropical regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2006-10-20 23:04
    No I'm using panel mount quadrature encoders but while I wait for better wheels I have a pair of plastic gears as wheels, they must look a bit like servo disks.

    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
Sign In or Register to comment.