We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › Good at Equations
Page Index Toggle Pages: 1
Good at Equations? (Read 917 times)
Good at Equations?
Feb 28th, 2006, 2:14pm
 
I shall add this this project I'm working on to the hardware communications section once I get the documentation sorted out but in the mean time I have a small question concerning an equation.

I'm communicating with a Scribbler robot using the Serial library. The major hurdle in this is the fact that I can't send a byte array to the bot because PBASIC reads byte arrays as an ASCII string. Java uses unicode so this complicates things. I got around the problem by sending the information piecemeal a bit at a time. Like I said - I'll post the documentation so anyone else new to communicating with PBASIC can have a crack. (The instant joy - just add Processing - factor has been the highlight of my week, this robot is really easy for stupid people, no, really).

Anyhoo ->

I have a subroutine in the Scribbler hacked from the demo code for the robot. It takes speed for each wheel and a duration for movement.

In the demo, for 90 degrees left it uses:

motor_r = +50
motor_l = -50
move_time = 30

(Max speed of 100). So that works out as 3 degrees per move_time = 1 at speed = 50. Or PI/60 radians.

I'm trying to figure out the equation that spells out the relationship between degrees/radians, move_time and speed.

I'm not even close right now, could anyone offer any insights I'm hoping to build a class that will offer some precise control over the robot. (I'd build a library but I'm waiting for that page on Processing Hacks telling you how to build stuff in Eclipse to appear).
Re: Good at Equations?
Reply #1 - Feb 28th, 2006, 2:55pm
 
angle=(motor_r-motor_l)*move_time*(PI/6000)

(this gives the angle in radians counter-clockwise)

So for your example,
Code:

angle=(50-(-50))*30*(PI/6000)
angle= 100 *30*(PI/6000)
angle= 3000 *(PI/6000)
angle=PI/2

Re: Good at Equations?
Reply #2 - Feb 28th, 2006, 3:35pm
 
You might find this paper, an old favourite, useful if you're simulating/modelling two-wheeled robots:

A Tutorial and Elementary Trajectory Model for the Differential Steering System of Robot Wheel Actuators by G.W. Lucas
Re: Good at Equations?
Reply #3 - Feb 28th, 2006, 7:08pm
 
Thanks guys, that helps a lot. I figured out a similar equation to ambulate the virtual robot before the commands were sent but I hadn't guessed at (motor_r-motor_l). The robot steering paper is very helpful too, cheers.

I should be able to rearrange the equation easily to project motor movement from vectors.

Funnily enough - the robot has cruddy DC motors. I'm not going to get some very accurate results with this. Ho hum.
Page Index Toggle Pages: 1