Motor selection
There are
two motors at the rear
of RickBot. The possible control options
are:
ACTION |
Left
motor |
Right
motor |
|
|
|
STOP |
Inactive |
Inactive |
BRAKE |
Stall (if
supported) |
Stall (if
supported) |
|
|
|
SLOW FORWARD |
Forward 33% |
Forward 33%
|
NORMAL
FORWARD |
Forward 66% |
Forward 33% |
FAST FORWARD |
Forward 100% |
Forward 100% |
|
|
|
SLOW
BACKWARD |
Reverse 33% |
Reverse 33% |
NORMAL
BACKWARD |
Reverse 66% |
Reverse 66% |
|
|
|
FORWARD
LEFT |
(2/3
forward) |
(forward) |
FORWARD
RIGHT |
(forward) |
(2/3
forward) |
FWD SHARP
LEFT |
(1/3
forward) |
(forward) |
FWD SHARP
RIGHT |
(forward) |
(1/3
forward) |
|
|
|
BACKWARD LEFT |
(2/3
reverse) |
(reverse) |
BACKWARD
RIGHT |
(reverse) |
(2/3 reverse) |
BKWD SHARP
LEFT |
(1/3
reverse) |
(reverse) |
BKWD
SHARP RIGHT |
(reverse) |
(1/3
reverse) |
|
|
|
ROTATE
LEFT |
Reverse 33% |
Forward 33% |
ROTATE
RIGHT |
Forward 33% |
Reverse 33% |
|
|
|
Obviously, by using stepper motors,
we can provide all sorts of complicated
arrangements.
The stall "if supported" is because our
driver IC may not like a stalled motor. One potential
way of forcing this is to assert step and keep it
asserted for a time-out, perhaps 3 seconds?
The
forward/reverse in brackets means that we will be moving
forward (or backwards) at the nominated speed, and to
effect the turn the motor speeds will be adjusted as
specified.
For example: Normal speed forward,
both motors will be running at 66%. To effect a left
turn, we will keep the right motor running at 66%, but
we will run the left motor at two thirds of 66% - which
is 44%.
What is
100%?
At this time, the actual value of
100% is undecided.
Let's work on a theory. If the motor step is 7.5º,
this means 48 steps make a complete rotation. We shall
round this to 50... which just happens to be the
frequency that the ticker interrupts at. Therefore we
can hook onto the 50Hz timer to control the motor. Now
if we assume the motor is connected 1:1 to a wheel about
the same dimensions as a mini-CD, this gives us a
traversal distance of about 26 centimetres per
second.
It is not easy to divide 50 by 3, so if we
divide by two, our normal speed is based upon 25Hz
ticks, which is 13cm/second. The slow speed is based
upon three ticks, or 16.6Hz, which is 8.6cm/second.
To summarise, assuming 1:1 connection to a
mini-CD sized wheel:
Speed option
|
50Hz
divisor
|
Distance
travelled in one
second
|
SLOW |
3
(16.6Hz) |
26
centimetres |
NORMAL |
2
(25Hz) |
13
centimetres |
FAST |
1
(50Hz) |
8.6
centimetres |
Note that this has
yet to be implemented in
actuality.