This month, we'll be adding
the final functionality to Isotope's
program that will allow his
linear actuators to be remotely
controlled, giving him the ability to
traverse treacherous terrain. Let's
break it dowwwwn!
Bot Test Program
Refer to Figures 1 and 2 here.
There's a lot to be done here,
but as long as we keep our heads
about us, the additions to our Bot
Test program should be a walk in
• First, save your program as
• There are two new number
variables: LHydraulics and
RHydraulics. (Note: Our
linear actuators are not
actually hydraulic, but
they look kind of like car
hydraulics, hence the name!)
• Create a new Receive IR
Message block to write to
each variable. Pull
LHydraulics from mailbox 3 and RHydraulics from
• Read LHydraulics and use a Compare block to see if
it's outside of the range of - 5 to 5. Wire that block to
a logic switch.
• If the LHydraulics variable is outside of that range,
it means that the user wants the left actuator
to move. So, in the true side of the switch read
the LHydraulics variable; if it's less than 0, move the
left actuator (motor port 1 on our NXTMMX)
forward at full power for unlimited duration.
Similarly, if LHydraulics is greater than 0, move
the same motor backwards with an unlimited
• On the other side of the switch, stop motor 1 on the
NXTMMX. This will stop the actuator from moving
(more on this later).
• Copy the switch we just created along with the read
variable and compare blocks. Switch each instance of
LHydraulics to RHydraulics, and each instance of
Motor Port 1 to Motor Port 2.
• If you'd like to troubleshoot your program, you
can read one of the variables. In my case, I read
LHydraulics and displayed it on the NXT so I
can verify that Isotope is receiving the variable
That should do it for the Isotope side of the program.
Now, let's tackle the beast of the controller program.
There's a lot to do here!
Converting the Control
Refer to Figures 3 and 4.
• First, save your program as Isotope_Control_Test.
• The first addition to our control test program is
relatively easy. Add the following six number
variables: BDiff, BTotal, CDiff, CTotal, BLast, and
• Read the BTotal variable and send it as an IR
message to mailbox 3. Read the CTotal variable and
send it as an IR message to mailbox 4.
• If you want to troubleshoot, you can view one
SERVO 02.2012 71