3-wheeled omni drive with rotation compensation

We’re thinking about starting a vex IQ program at our school so I bought one to “familiarize myself” (play with). This is the first robot I built, just for fun I decided to bust out my MacGuyver programming skills and write a taylor series approximation for sine and cosine using modkit. It took me forever to debug the code, there was an obvious error staring me right in the face and I kept looking right past it. D’oh

I included annotated code. And yes, that is a lot more digits of Pi than I really need. I reduced it in later iterations of the code and it didn’t seem to make any difference.

I didn’t include code for the individual motors, it will only allow me to post 5 images.
It is simple though:
Motor 1: x/3+y/1.732+r
Motor 2: x/3-y/1.732+r
motor 3: -2x/3 +r

Obviously, these values aren’t running the motors as fast as they could be. I might add a normalizing algorithm to be used if the joystick is in a max position.

My next step is going to be to code it with robotC and see if it doesn’t process the trig faster (I’m sure it will)

caa3a5c3979da9401693daec89579156.jpg

28b2a48af99660e366976102a4b9f533.jpg

cbabc029a19c884c22dae5e2472f6151.jpg



Sorry if the annotations are hard to read I had to resize it after I annotated it to fit the constraints of the forum.

Hi there,

You can find a bunch of omniwheel ROBOTC code on my site: Rotacaster Minifig Vomit Mobile – Bot Bench. You can find more by searching for omniwheel. It’s for the NXT, but should be fairly trivial to port to VEX IQ.

= Xander

it is very cool!

Looks awesome.