# Write a algorithm for Chris and be Loved...

Well folks,

I have been working on this problem for 4 days now and don't seem to be making any headway. There has got to be a math or programming geek out there that can figure this one out. The video should be self-expanitory, and the chart with the values is right here. In addition, I attached the pic as a file as well (full size) so you might be able to see the numbers a bit better. --Sorry no scanner.

AttachmentSize
Walter_1.3_Joystick_001.jpg2.68 MB

## Comment viewing options

You nailed it dude...

Now, I do have to kick myself for the 4 days I racked my brain on this one... I can't believe how simple the final code is!

Thanks again

Ah. you coded it already. Fairy nuff. My approach was only slightly different. My bot takes as its inputs (1) speed and (2) radius of turn. I was about to sit and figure out how to convert speed and radius of turn (the results from MY algorithm) into coaxial track PWMs!

Do I still get the Coveted Rusty Soldering Iron Trophy for doing it first?

No prob, hope it gets Walter going well. I hope to use this idea on an outdoor wanderer, to take over control when needed. Probably use an XBee link, with some of the little joysticks. I have some like you've shown, except no knob on the end so may have to Shapeloc something.

I recreated a diagram like it, using expected values. Correcting for SIN(joystick-angle). The Y/X numbers along the SE and SSE positions are reversed. And most numbers are off from the predicted values by as much as 30 (at ESE and NNW for example).

But from the resulting values I can deduce that your stick does not move around in a circle, but in a square. And a motor does not get full power unless the other motor is completely stopped.

But maybe that is just the way I expected them to be.

(Little geometry joke for you there!)

2D pots are normally like that. The X limit is flat for the full Y extents and vice-versa. I agree - it's not intuitive. My first calculations overflowed for exactly the reasons you mention. Whatever I'd done, the bot went wherever I told it EXCEPT in a straight line.

I have the same problem when coding the nunchuck controller and the most clever solution I find was the if/else coding mess.... I have came up with this remote controller as OddBot already metioned and it feeds my needs :)

must try to understand the robologist solution, seems much more easier than I though