[DPRG] Motor control
Subject: [DPRG] Motor control
From: Dale Wheat
dale at dalewheat.com
Date: Sat Jun 7 16:16:00 CDT 2003
David,
Thanks for the good information about motor control. Thanks also for
explaining it to me in agonizing detail last Tuesday. Although I'm chomping
at the bit to understand PID motor speed control algorithms (which will be
fun, because I barely know what an integral (The I in PID) is and until last
Tuesday had no clue what a derivative (The D in PID) was), I have to make
sure I completely understand what has been covered so far.
As usual, I'd like to go over a few points in some more detail, mostly
concerning units of measure. Please correct me if my assumptions are
incorrect.
The "arbitrary scale" of 100 to +100 in the first method expresses a value
of power applied to the motors. This is "openloop power control" and does
not take into account variations in motors/gears/wheels, friction, voltage,
slopes, etc. Applying an equal amount of power to both wheels does not
guarantee driving in a straight line.
The next step involves dealing with the abstract quantites velocity and
rotation. Velocity is defined as distance over time. For our purposes, the
distance can be measured in shaft encoder counts (which hopefully can be
accurately translated into some more traditional linear measurement like
feet, inches, furlongs, parsecs, etc.), while the time is broken down into
the units between each measurement made. On SR04, for example, the time is
50ms, since measurements are taken 20 times a second. So (linear) velocity
is expressed as encoder counts over timer ticks.
Rotation (or more accurately rotational velocity) is defined as angular
displacement over time. To use the equations presented, where rotation is
added or subtracted from the left and right velocities, respectively, the
units of measure would of course have to be the same, namely encoder counts
over timer ticks. If the wheelbase (the effective distance between the
wheels) is expressed in encoder counts, then the angular displacement can
also be expressed in radians, using one of the odometry equations,
specifically "theta = (right  left) / wheelbase". The rotational velocity
can then be expressed as the angular displacement (either in radians or
encoder counts) per timer tick.
If the observer (me) is looking down on the robot from a height (and until I
build a flying/hovering robot, I will be), rotation to the left
(counterclockwise) would be expressed as a positive angle and rotation to
the right (clockwise) would be a negative angle. Since turning to the left
necessitates slowing down the left motor, or speeding up the right motor (or
both), shouldn't the equations be:
Left_motor = Velocity  Rotation
Right_motor = Velocity + Rotation
instead of the other way around?
This next step seems like it will make things much simpler when traveling in
a straight line (I wish!) or turning in place, but what about describing an
arc? It seems to me that it would be easier or at least more accurate to
make a turn about a point other than the center of the robot, since the
measured distances would be larger and suffer less from roundoff error in
odometry, or would these benefits be outweighed by the increased cumulative
navigational error? It occurs to me that there should be a simple way to
express this given the level of abstraction already in place. The exact
translation escapes me at the moment. Also, since all my robots seem bound
and determined to travel in arcs, anyway, I think it would be wise to "go
with your strengths" and find a way to let them do what they do best, and
still do what I want.
Any thoughts would be appreciated. All you other navgeeks feel free to
pitch in. The last couple of days' discussion on "dead reckoning" have also
been enlightening.
Thanks,
Dale Wheat
http://dalewheat.com
(972) 4861317
(800) 3301915, access code 00
 Original Message 
>From: "David P. Anderson" <dpa at io.isem.smu.edu>
To: <dprglist at dprg.org>
Sent: Saturday, June 07, 2003 11:18 AM
Subject: [DPRG] Motor control
>
> Howdy
>
> As per our discussion of motor control from last week's
> RBNO, I thought I'd try to summarize the scribblings on
> the whiteboard and perhaps clarify a couple of points.
>
(omitted)
> Left_motor = Velocity + Rotation
> Right_motor = Velocity  Rotation
>
(omitted)
>
> Next week, the PID Speed Controller...
>
> hope this helps!
> cheers,
> dpa
>
> _______________________________________________
> DPRGlist mailing list
> DPRGlist at dprg.org
> http://nimon.ncc.com/mailman/listinfo/dprglist
>
>
More information about the DPRG mailing list
