Figure 1: An example RoboClaw motor controller.
1. Wire one or two motors to the RoboClaw. On dual channel RoboClaws the first motor is wired to M1A and M1B and the second motor to M2A and M2B. On the RoboClaw Solo a motor is wired to motor channel 1.
Figure 2: Wiring for both motor channels.
2. If encoders are being used they need to be wired to the RoboClaw. On dual channel RoboClaws the encoder for motor channel 1 is wired to the EN1 header and the encoder for motor channel 2 is wired to the EN2 header. On the RoboClaw Solo a single encoder is wired to pins 1A and 1B on the pin header block.
Power for the encoder is available at the 5V pins on both the dual channel and single channel RoboClaws. Be sure to also connect the encoder’s ground pin to ground on the RoboClaw.
Figure 3: Power and signal wiring for one encoder channel.
Refer to the pinout digagram of the encoder in use for correct wiring. This application note can be used an example of wiring encoders.
3. Connect a power supply or battery to the RoboClaw. The power terminals are labelled (+) for positive and (-) for negative. On the RoboClaw Solo the red lead is the positive connection and the black lead is the negative connection. Be careful to not connect the power source backwards as this will damage the RoboClaw.
Figure 4: Power wiring for the RoboClaw.
4. Connect the RoboClaw to a computer running Windows with a micro USB cable. Note that the USB cable does not power the RoboClaw, it is only used for communication between the RoboClaw and a computer.
Next, Motion Studio and a USB driver must be installed. See this application note for the details of the installation.
5. Open Motion Studio and connect to the RoboClaw by clicking “Connect Selected Unit” in the upper left-hand side of the application. Click on “PWM Settings” in the left-hand pane. Here the motors will be tested to make sure they’re working. Find the box labeled “Control”. Slide the sliders for Motor 1 and/or Motor 2. The motors should turn when operating the sliders. Also check to ensure that the motors turn forwards when sliding the sliders up and backwards when sliding the sliders down. If the motors do not turn the proper direction you need to reverse the wiring of one or both motors.
Figure 5: The PWM Settings motor sliders.
6. If encoders are being used they should be tested while still in the PWM Settings window. Use the sliders labeled “Motor 1” and “Motor 2” to move the motors forwards and backwards. Moving the slider up should move the motor forwards and down backwards. If the encoders are working properly the “M1 Encoder” and “M2 Encoder” values at the top of the window should increment when the motor moves in the forwards direction and decrement in the backwards direction. The the encoder counts do not increment and decrement properly reverse the encoder signal connections.
Figure 6: The location of the encoder counts in Motion Studio.
7. If encoders have been wired, the motor and encoder combination must be tuned. There is an auto tuning routine in Motion Studio that can be used for velocity control or position control. See this application note for instruction on auto-tuning.
If position control is being tuned be sure to set the minimum and maximum postions and check the range of motion after the tuning process.
8. Finally, the mode and any options for the mode must be set. For example, if packet serial is being used to communicate with a microcontroller, packet serial mode must be set as well as a baudrate and address. See the links below for details of setting the mode and options for each of the control modes for the RoboClaw.