Combat Robot RC Setup

Spread the love

Control a combat robot using a RoboClaw motor controller with an RC transmitter and receiver: the tutorial covers wiring the receiver, setting the Control Mode to RC in BasicMicro Motion Studio, and choosing single stick (arcade) or dual stick (tank) driving, for testing or the arena.

Two combat robots fighting in an arena
Figure 1: A pair of battle bots in action.

The RoboClaw reads standard servo pulses straight from a hobby RC receiver, so no other electronics are needed between the radio system and the motors. After completing this guide the robot can be driven around via radio control, whether for testing purposes or in its final form.

Configuration is done in BasicMicro Motion Studio, which requires a computer running Windows 10 or newer.

Some photos in this guide show an older RoboClaw revision with onboard configuration buttons. Button configuration is deprecated; all current RoboClaw models are configured with Motion Studio.

What You Need

  • 1 RoboClaw motor controller with pin headers
  • 2 Brushed DC motors
  • 1 Battery or power supply
  • 1 RC radio transmitter
  • 1 RC radio receiver
  • 2-3 Female to female servo cables
  • 1 Power switch (optional)
  • 1 Fuse (optional)
  • 1 Power diode, 1-3A (optional)
  • 1 USB A to micro-B cable
  • 1 Small screwdriver
  • 1 Computer running Windows 10 or newer

Choosing an RC Receiver

There are three distinct types of receivers on the market: air, surface, and marine receivers. There are also two frequency bands in use: 2.4GHz spread spectrum, which is the standard on current systems, and FM, which is found on older equipment. The radio and receiver must operate on the same frequency band. Furthermore, the radio and receiver type should be paired: surface radios with surface receivers and air radios with air receivers. Generally any combination of radio and receiver can be used for combat robots, but air radios and receivers offer the most flexibility. The control scheme is more flexible with an air radio, and air receivers often feature programmable failsafe options that are useful for combat robots.

Choosing a Control Scheme

There are two control schemes commonly used to control combat robots: the single stick setup (arcade drive) and the dual stick setup (tank drive). The choice of control scheme determines how the receiver is wired to the RoboClaw.

Single Stick (Arcade Drive)

In a single stick configuration, forward and backward movement is carried out by moving a single stick up or down. To turn, the same stick is moved either left or right. The single stick configuration makes it easy to mix forward and backward motion with turning at the same time. Generally the right stick should be used for a single stick setup because on most radios this stick returns to center when released.

Single stick arcade control scheme for a combat robot, with one stick handling forward, reverse, and turning
Figure 2: Single stick control scheme.

Dual Stick (Tank Drive)

The dual stick setup ties one motor to each control stick. Moving forward or backward is carried out by moving both sticks forward or backward at the same time. To turn a robot with a dual stick configuration, each stick is moved in opposite directions.

Dual stick tank control scheme for a combat robot, with one stick per motor
Figure 3: Dual stick control scheme.

Powering the Receiver: BEC or External Battery

The RC receiver can be powered directly from the RoboClaw or from a secondary battery pack. When powering the RC receiver from the RoboClaw, the receiver is supplied with 5VDC from the center wire of the 3 pin servo cable. This system is known as a BEC (battery elimination circuit). The benefit of this scheme is a reduction in the complexity of the wiring. The downside to using the BEC is that a low main battery or a sudden power dip can cause a brownout condition that will cause the RoboClaw and receiver to behave erratically. If the main battery will be run low or the motors of the robot will draw a large amount of current, a secondary battery for the receiver is recommended. The wiring diagrams below show the wiring for using the BEC as well as using a receiver battery for both control schemes.

Wiring with the RoboClaw BEC

Follow the wiring diagrams below to wire the receiver to the RoboClaw. Wiring with the RoboClaw’s BEC uses an unmodified standard 3 wire servo cable. Pay attention to the connections between the appropriate receiver channels and the S1 and S2 headers of the RoboClaw. The S1 and S2 header pins are labeled with polarity markings.

Single Stick (Arcade Drive)

Wire the elevator channel to S1 and aileron channel to S2.

Combat robot wiring diagram for single stick arcade control with the RoboClaw BEC powering the RC receiver, elevator channel on S1 and aileron channel on S2
Figure 4: In this wiring configuration the 5V line is connected between the RoboClaw and receiver. The RoboClaw powers the receiver.

Dual Stick (Tank Drive)

Wire the throttle channel to S1 and elevator channel to S2.

Combat robot wiring diagram for dual stick tank control with the RoboClaw BEC powering the RC receiver
Figure 5: In this wiring configuration the 5V line is connected between the RoboClaw and receiver. The RoboClaw powers the receiver.
Two RC receiver channels connected to the S1 and S2 headers of a RoboClaw motor controller with servo cables
Figure 6: Two RC channels connected to the RoboClaw.

Wiring with an External Receiver Battery

Follow the wiring diagrams below when the receiver is powered from its own battery. In this configuration the RoboClaw’s BEC is bypassed, so the standard 3 pin servo cable must be modified by removing the center pin, which is the 5V positive line. Only the signal and ground wires connect the receiver to the RoboClaw. As before, pay attention to the connections between the appropriate receiver channels and the S1 and S2 headers of the RoboClaw.

Single Stick (Arcade Drive)

Wire the elevator channel to S1 and aileron channel to S2.

Combat robot wiring diagram for single stick arcade control with an externally powered RC receiver and the 5V servo line removed
Figure 7: In this wiring configuration the receiver is powered externally and the 5V line between the RoboClaw and receiver has been removed.

Dual Stick (Tank Drive)

Wire the throttle channel to S1 and elevator channel to S2.

Combat robot wiring diagram for dual stick tank control with an externally powered RC receiver and the 5V servo line removed
Figure 8: In this wiring configuration the receiver is powered externally and the 5V line between the RoboClaw and receiver has been removed.
Servo cable altered to remove the 5V line for use with an externally powered RC receiver
Figure 9: A servo cable altered to remove the 5V line when using an external BEC or battery.
Two modified servo cables with the 5V line removed connecting an RC receiver to a RoboClaw motor controller
Figure 10: Two RC channels connected to the RoboClaw with modified servo cables.

Installing the RoboClaw Hardware

  1. Download BasicMicro Motion Studio from basicmicro.com/downloads and install it. The Installing BasicMicro Motion Studio guide covers the process step by step.
  2. Identify the positive and negative leads of the battery. There are two screw terminals on the RoboClaw labeled + and -. Find these terminals and loosen the screws on them. Attach the negative lead first by placing the lead in the loosened terminal and tightening the screw down until the connection is snug. Repeat this step with the positive lead.
    Battery leads wired to the positive and negative screw terminals of a RoboClaw motor controller
    Figure 11: Power wired properly to the RoboClaw.
  3. Connect the USB cable between the RoboClaw and your computer.
  4. Open BasicMicro Motion Studio. In the upper left hand corner of the application you should see a box labeled “Attached Devices”. Your RoboClaw should appear here; if not, check your USB connection and check that power has been properly applied to the RoboClaw. If your device is listed, select it and click “Connect Selected Unit”. The Stat1 LED on the RoboClaw will begin flashing. While Motion Studio is open, check to see if the RoboClaw’s firmware needs to be updated by following the section named “Updating Firmware” in Layout and Common Operations in Motion Studio. Once you have verified that you can connect the RoboClaw to Motion Studio, click “Disconnect Selected Unit” to stop communication with the RoboClaw.
    Attached Devices list in BasicMicro Motion Studio showing a connected RoboClaw
    Figure 12: The location in Motion Studio where a RoboClaw is connected.
  5. Disconnect power from the RoboClaw by removing the positive lead and then the negative lead. If your battery has a switch you can simply open the switch to disconnect power.
    Always remove the positive lead first. Disconnecting the negative lead while the USB cable or other signal grounds are still attached creates a ground loop that can permanently damage the RoboClaw or the connected devices.
  6. It is recommended, but optional, to install a fuse and bypass diode in the power wiring harness. See Motor Controller Protection: Diodes, Clamps, and Pre-Charge Resistors for details on how to do so. The wiring diagrams earlier in this guide show a fuse (F1) and bypass diode (D1) installed on the power wiring harness along with a power switch on B+.
  7. Now begin wiring the motors to the RoboClaw. Locate the terminals labeled M1A and M1B and loosen the screws on these terminals before you begin wiring. Wire the first motor to the terminals labeled M1A and M1B by placing one end of the bare wire in each terminal and tightening the screws with your screwdriver until the connection is snug. Note that the order of wiring does not matter for the first motor.
  8. The second motor is wired to the terminals labeled M2A and M2B. The order of wiring does matter for this motor. Look at the first motor you wired and note what color wire you wired to the M1A terminal. Connect the same colored wire of the second motor to the M2A terminal. Lastly, connect the final wire of the second motor to the M2B terminal. Make sure that your motor wire connections are secure and do not come loose from the terminals.
    Two motors wired to the M1 and M2 screw terminals of a RoboClaw motor controller
    Figure 13: Two motors wired to the RoboClaw properly.
    An additional logic battery can be used to power the RoboClaw’s internal logic. This option is a good choice if the robot’s motors are likely to draw large amounts of current. Large current spikes can temporarily pull the main battery voltage low enough to cause the RoboClaw to brown out. A logic battery attaches to the pin header labeled “LB IN”. During operation the RoboClaw automatically selects the power source to use, so there is no further configuration needed to use this feature.
  9. Reconnect power to the RoboClaw as done earlier, negative lead first and then positive.
  10. Open BasicMicro Motion Studio again and reconnect the RoboClaw by clicking “Connect Selected Unit”. Click on “PWM Settings” in the left-hand pane. Here the motors are tested to make sure they are working. Find the box labeled “Control” and slide the sliders for Motor 1 and Motor 2. The motors should turn when operating the sliders. Also check that the motors turn forward when sliding the sliders up and backward when sliding the sliders down. If the motors do not turn the proper direction, reverse the wiring of one or both motors.

Configuring RC Mode in Motion Studio

  1. Ensure that power is still connected to the RoboClaw. Open Motion Studio once again and connect the RoboClaw in the application. On the left-hand side of the application click “General Settings”. This is where the RC mode and options are configured.
  2. In the pane labeled “Setup”, set the Control Mode to RC. This is the one setting that must be set for all control schemes and wiring configurations.
    Control Mode set to RC in the Setup pane of BasicMicro Motion Studio
    Figure 14: The control mode setting in Motion Studio.

The remaining RC options are configured on the same General Settings screen. Which of them apply depends on the control scheme and hardware in use.

Mixing

This setting mixes two control channels together. Only enable this setting for the single stick control scheme; the dual stick control scheme does not use it.

Mixing option in the RC settings of BasicMicro Motion Studio
Figure 15: The mixing setting in Motion Studio.

Flip Switch

This option allows a third control channel to reverse the controls if the robot is flipped over. Check the checkbox to enable it, and also set the S3 Mode dropdown to Flip/Reverse; the checkbox alone does not activate the feature. A servo cable must be wired between the desired channel on the receiver and the S3 header to make this work.

Flip switch option in the RC settings of BasicMicro Motion Studio
Figure 16: The flip switch setting in Motion Studio.

MCU Mode

MCU mode controls how the RoboClaw interprets the incoming RC pulses. With MCU mode disabled, which is the default, the RoboClaw auto-calibrates at startup: the stick position at power-up is captured as the center of the range, and the endpoints start at defaults of 1250 and 1750 microseconds and adjust automatically if the incoming pulses travel past them. With MCU mode enabled, no calibration occurs; the center and endpoints are fixed presets of 1120, 1520, and 1920 microseconds.

Enable MCU mode when a microcontroller generates the control pulses instead of an RC receiver, or to avoid recalibration after a brownout resets the RoboClaw. Otherwise leave it disabled and let the startup auto-calibration adapt to the radio.

MCU mode checkbox in the RC settings of BasicMicro Motion Studio
Figure 17: The MCU mode setting in Motion Studio.

Exponential

This setting dampens the robot’s response around the center of the radio’s travel range. It can make a robot easier to control and less touchy in its response to stick movement.

Exponential setting in the RC settings of BasicMicro Motion Studio
Figure 18: The exponential setting in Motion Studio.

Deadband

This setting sets the range of stick travel from center for which there is no motor response. Small stick motions around the center of the stick’s range will result in no movement of the robot. The value defaults to 2.5% but can be customized to any value that is appropriate.

Deadband setting in the RC settings of BasicMicro Motion Studio
Figure 19: The deadband setting in Motion Studio.

Encoders

When this option is selected the RoboClaw will use attached encoders to maintain velocity or position, depending on what tuning has been configured. See Auto Tuning with Motion Studio for details on how to tune a RoboClaw for velocity or position control.

Encoders option in the RC settings of BasicMicro Motion Studio
Figure 20: Location in Motion Studio to enable encoders in RC mode.

RC Timeout

A loss of signal between the RC transmitter and receiver, either due to range or turning the transmitter off, can result in issues with the control of a robot. Many receivers will continue to send the last known stick positions to the RoboClaw, which can result in a robot running away or crashing. Enabling the “RC Timeout” checkbox stops the motors whenever the input signal is lost for more than 100 milliseconds. In addition, some radio and receiver combinations can be programmed with failsafe positions; consult the documentation for the system being used.

  1. Save the settings to the RoboClaw by selecting “Save Settings” from the File menu.
    File menu in BasicMicro Motion Studio showing the option used to save settings
    Figure 21: The menu location in Motion Studio where settings are saved.
  2. For future use the configuration can also be saved to a file. See Saving and Restoring RoboClaw Configurations for instructions on how to do this.
  3. Once the settings have been saved, click “Disconnect Selected Unit” in the upper left-hand side of the application to disconnect the RoboClaw from Motion Studio.
  4. Disconnect the USB cable from the RoboClaw.

Settings Overview

The table below is a quick reference of the settings and connections needed for each control scheme.

Setting Single Stick (Arcade) Dual Stick (Tank)
S1 connection Elevator channel Throttle channel
S2 connection Aileron channel Elevator channel
Control Mode RC RC
Mixing Enabled Disabled
MCU mode Per auto-calibration needs (see MCU Mode) Per auto-calibration needs (see MCU Mode)
Flip switch Optional, via S3 Optional, via S3

Testing the Robot

If the transmitter and receiver need to be bound, do so before further testing. Disconnect power from the RoboClaw, and from the receiver if it is being powered from an external battery. Turn the transmitter on first and center both control sticks, then re-power the RoboClaw. At startup the RoboClaw takes about one second to calibrate the neutral stick positions, and the Stat1 LED begins flashing once RC pulses are detected. The RoboClaw should now respond to input from the transmitter by moving the motors in response to the appropriate sticks.

Troubleshooting

If things do not work as expected, run through the following checks:

  1. Check that the servo cable connections are seated properly and oriented correctly, both at the receiver and at the RoboClaw.
  2. If using external power, check that the receiver battery is adequately charged and that the 5V line of the servo cables has been removed completely.
  3. Reconnect the RoboClaw to Motion Studio and confirm the settings listed previously are set and saved to the board.

Next Steps

The combat robot can now be driven with the RC transmitter. The guides below build on this setup.