moving can cause small movements to
overshoot by a large amount. This can
lead to what is called a “limit cycle,” or
“hunting,” where the controller tries to
move to a requested position but
overshoots and then tries to move
back to the correct position and
In cases where the stiction is
excessive, a dead zone may need to be
added to eliminate this “limit cycle.”
One final source of potential
problems is noise in the sensor
readings. Analog sensors (like
potentiometers) can have drift in their
signal because their power source isn’t
stable or there is noise from the motor
on the ground line. If the voltage
going into a potentiometer isn’t
smooth, then the signal coming out of
it won’t be either.
Enough theory. Let’s examine
some real robot world examples. For
these examples, you will need a
RoboClaw motor controller (any model
is okay; this example uses the smallest
model, the 2x7A; #ION404), a
Windows PC, IonMotion software, and
the RoboClaw USB driver (both of
these pieces of software can be
downloaded from www.ionmc.com).
Note: All of the preliminary
information provided at the beginning
of this article is valid for almost any
motor/motion controller, but the
remaining examples will be more
specific to RoboClaw controllers. The
steps, however, for manually tuning
will be similar on most other brands of
controllers as well.
For our DC motor with incremental
encoder, we will be using the Pololu
70:1 metal gearmotor (#2825)
37Dx70L mm with 64 CPR encoder
(150 RPM at 12V, 300 mA no load, 5A
1. Good speed control with a
4480 counts per rotation encoder. The
PIV can be auto-tuned, but manual
tuning is available.
2. Good position control with a
reasonably high resolution, this motor
can accurately reach any signal
encoder position under light loads.
Under heavy loads, there is an error of
± 5 counts with a tuning setup.
3. No dead zone is required to
compensate for stiction. Stiction on
this motor has no noticeable effect.
4. Requires homing since it uses a
quadrature encoder. For use as a robot
wheel actuator, homing is unnecessary.
However, this motor has enough
torque, so it can be used as a good
quality servo actuator with the addition
of a home or zero position sensor.
5. Backlash reduces accurate
positioning slightly on the output
shaft. I estimate about one degree of
slop on the output shaft.
Wire It Up
Follow along with Figures 2
through 4 for connecting the Pololu
gearmotor to the RoboClaw motor
controller. DC motor color wiring to
the RoboClaw 2x7A motor controller
terminals is as follows:
Red to M1A
Black to M1B
Green to Encoder GND (- pins next
to encoder channel pins)
Blue to Encoder 5V on RoboClaw
(+ pin next to encoder
Yellow to ENC1 pin nearest edge of
White to Second ENC1 pin
Step-by-Step Speed Control Setup
on a RoboClaw 2x7A Motor
1. STOP! Verify one more time
that the motor is wired to the
RoboClaw correctly. Connect a USB
cable from your PC to the RoboClaw.
Open the IonMotion software and click
Connect under the device menu after
the RoboClaw is detected. Click the
PWM Settings button. Slide the Motor
1 slider up to start turning the motor.
Check that the M1 encoder value is
increasing. If it is decreasing, the ENC1
pins are backwards and need to be
2. Determine the QPPS setting (we
will need this value in the Velocity
Settings screen) and move the slider all
the way up to 100%. Wait for the
motor speed to level out. The speed is
at 100% of the QPPS value (e.g., the
feed forward value). Stop the motor.
50 SERVO 05.2016
Figure 2. Use
the motor to
Figure 4. All of the wiring is complete.
Lacking a white jumper wire for the
encoder (-) connection, I used another
Figure 3. You will need two M-M jumper
wires for attaching the motor’s power
connectors to the RoboClaw screw