Combat Robot RC Setup

Introduction

Figure 1: Team Huge posing with their awesome build.

This Application Notes details how to configure a RoboClaw motor controller and RC transmitter/receiver pair to control a combat robot. Two possible control schemes are available: single stick and dual stick, also known as tank style and arcade style. After completing this Application Note a combat robot can be driven around via radio control for testing purposes or in it’s final form.

Materials

(1) Roboclaw with pin headers
(2) motors
(1) power supply
(1) RC transmitter
(1) RC receiver
(2-3) female to female servo cables
(1) power switch (optional)
(1) fuse (optional)
(1) 1-3A power diode (optional)
(1) micro USB cable
(1) computer running Microsoft Windows 7, 8 or 10

Let’s Get Started

1. Install Basicmicro Motion Studio on the computer. Please see the tutorial here. Note that Basicmicro Motion Studio requires Windows 7 or later.

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. Attached 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.

Figure 1: Power wired properly to the RobClaw.

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. Follow the section named “Updating Firmware” in this Application Note to update the firmware.

Once you’ve verified that you can connect the RoboClaw to Motion Studio click “Disconnect Selected Unit” to stop communication with the RoboClaw.

Figure 2: 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. You must do it in this order or you will damage the RoboClaw. If your battery has a switch you can simply open the switch to disconnect power.

6. It is recommended, but optional, to install a fuse and bypass diode in the power wiring harness. See this Application Note for details of how to do so. The wiring diagrams below show a fuse and bypass diode installed on the power wiring harness along with a power switch.

7. Now we will begin wiring the motors to the RoboClaw. Locate the terminals labeled M1A and M1B. 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.

Figure 3: Two motors wired to the RoboClaw properly.

Note: 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 will likely draw large amounts of current. Large current spikes can temporarily lower the main battery voltage low enough to cause the RoboClaw to brown out. A logic battery is attached to the pin header labeled “LB IN”. During operation the RoboClaw will automatically select the power source to use so their is no further configuration needed to use this feature.

9. Reconnect power to the RoboClaw as done earlier.

10. Open Basicmicro Motion Studio again and reconnect the RoboClaw again by clicking “Connect Selected Unit”. Click on “PWM Settings” in the left-hand pane. Here we will test the motors to make sure they’re working. Find the box labeled “Control”. Slide the sliders for Motor 1 and 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 4: The motor sliders used to test both motors.

11. Disconnect the RoboClaw in Motion Studio and remove power from the RoboClaw as done earlier.

Control Schemes

There are two control schemes that are commonly used to control combat robots: the dual stick setup (tank drive) and the single stick setup (arcade drive). The dual stick setup ties one motor to each controls stick. Moving forwards or backwards is carried out by moving both stick forwards or backwards at the same time. To turn a robot with a dual stick configuration each stick is moved in opposite directions. In a single stick configuration forwards and backwards movements are 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 forwards and backwards motion with turning at the same time.

Follow the set of instructions below for the control scheme desired to finish this application note.

Figure 5: Single stick control scheme.

Figure 6: Twin stick control scheme.

Single Stick Setup (arcade drive)

1. Using a servo cable connect the elevator channel of the receiver to the S1 header of the RoboClaw. Be sure to note the proper orientation of the signal wire at both sides of the connection. Next, connect the aileron channel of the receiver to the S2 header of the RoboClaw.

Note: The RoboClaw will power the receiver from the onboard BEC. If the receiver is being powered by an external battery or the BEC of another speed controller the 5V lead on the servo cables must be cut or removed entirely. This prevents a conflict between voltage sources.

RoboClaw BEC Powering the Receiver

Figure 7: In this wiring configuration the 5V line is connected between the RoboClaw and receiver. The RobClaw powers the receiver.

Receiver with External Power

Figure 8: In this wiring configuration the receiver is powered externally and the 5V line between the RobClaw and receiver has been removed.

Figure 9: A servo cable altered to remove the 5V line when using an external BEC or battery.

Figure 10: Two RC channels connected to the RoboClaw.

Figure 11: Two RC channels connected to the RoboClaw with modified servo cables.

2. There is an option to enable a “flip switch” so that if a robot is flipped over the controls can be reversed by the signal from another RC channel. The best option is to tie this option to a channel on the transmitter that has a switch. The first step in configuring this option is to use a servo cable connect the chosen channel on the receiver to the S3 header on the RoboClaw. The software configuration for this option is handled in the next step.

3. Reconnect power to the RoboClaw, connect the RoboClaw to the computer with a USB cable and open Motion Studio. Once again connect the RoboClaw in Motion Studio. Click on “General Settings” on the left-hand side of the application. Now locate the pane labeled “Setup”. Set the Control Mode to “RC”. Next, locate the pane labeled “RC/Analog Settings”. The first option to set is mixing. Click the checkbox labeled “Mixing”. If the a logic battery has been attached or the robot is unlikely to experience brownouts click the checkbox labeled “MCU”. However if the robot is likely to experience brownout or the reciver in use has failsafes against signal loss leave this box unchecked. If a channel has been connected for a flip switch check the box labeled “RC Flip/Mode Switch”. Finally click on “Device” in the menu at the top of the application. In the dropdown that appears click on “Write Settings” to save the configuration to the RoboClaw. More advanced optional settings are available in RC mode. For a breakdown of these options see this Application Note.

Note: The primary difference between leaving MCU mode disabled and enabling it is the autocalibration feature. When MCU mode is disable (default setting) RoboClaw uses the radio’s stick position at startup as the center of the range of motion. Autocalibration will also adjust the minimum and maximum endpoints if they deviate from the pre-programmed values. When MCU mode is enabled none of these adjustments occur and the center position as well as endpoints are determined by preset values.

Figure 12: In Motion Studio the RC mode is set and mixing enabled. If desired the MCU mode can be set. See the step above for details.

4. For future use the configuration should be saved to a file. See this Application Note for instructions on how to do this. Several ready to use RC mode configuration files can be found here. They can be loaded on to the RoboClaw by following this Application Note.

Figure 13: The menu location in Motion Studio where settings are saved to a file.

5. 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.

6. Disconnect the USB cable from the RoboClaw.

Dual Stick Setup (tank drive)

1. Using a servo cable connect the throttle channel of the receiver to the S1 header of the RoboClaw. Be sure to note the proper orientation of the signal wire at both sides of the connection. Next, connect the elevator channel of the receiver to the S2 header of the RoboClaw.

Note: The RoboClaw will power the receiver from the onboard BEC. If the receiver is being powered by an external battery or the BEC of another speed controller the 5V lead on the servo cables must be cut or removed entirely. This prevents a conflict between voltage sources.

RoboClaw BEC Powering the Receiver

Figure 14: In this wiring configuration the 5V line is connected between the RoboClaw and receiver. The RobClaw powers the receiver.

Receiver with External Power

Figure 15: In this wiring configuration the receiver is powered externally and the 5V line between the RobClaw and receiver has been removed.

Figure 16: A servo cable altered to remove the 5V line when using an external BEC or battery.

Figure 17: Two RC channels connected to the RoboClaw.

Figure 18: Two RC channels connected to the RoboClaw with modified servo cables.

2. There is an option to enable a “flip switch” so that if a robot is flipped over the controls can be reversed by the signal from another RC channel. The best option is to tie this option to a channel on the transmitter that has a switch. The first step in configuring this option is to use a servo cable connect the chosen channel on the receiver to the S3 header on the RoboClaw. The software configuration for this option is handled in the next step.

3. Reconnect power to the RoboClaw, connect the RoboClaw to the computer with a USB cable and open Motion Studio. Once again connect the RoboClaw in Motion Studio. Click on “General Settings” on the left-hand side of the application. Now locate the pane labeled “Setup”. Set the Control Mode to “RC”. Next, locate the pane labeled “RC/Analog Settings”. If the a logic battery has been attached or the robot is unlikely to experience brownouts click the checkbox labeled “MCU”. However if the robot is likely to experience brownout or the receiver in use has failsafes against signal loss leave this box unchecked. If a channel has been connected for a flip switch check the box labeled “RC Flip/Mode Switch”. Finally click on “Device” in the menu at the top of the application. In the dropdown that appears click on “Write Settings” to save the configuration to the RoboClaw. More advanced optional settings are available in RC mode. For a breakdown of these options see this Application Note.

Note: The primary difference between leaving MCU mode disabled and enabling it is the autocalibration feature. When MCU mode is disable (default setting) RoboClaw uses the radio’s stick position at startup as the center of the range of motion. Autocalibration will also adjust the minimum and maximum endpoints if they deviate from the pre-programmed values. When MCU mode is enabled none of these adjustments occur and the center position as well as endpoints are determined by preset values.

Figure 19: In Motion Studio RC mode is set. In addition MCU mode can be set. See the step above for details.

4. For future use the configuration should be saved to a file. See this Application Note for instructions on how to do this. Several ready to use RC mode configuration files can be found here. They can be loaded on to the RoboClaw by following this Application Note.

Figure 20: The menu location in Motion Studio where settings are saved to a file.

5. 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.

6. Disconnect the USB cable from the RoboClaw.

Testing

If the transmitter and receiver need to be bound do so before further testing. Disconnect power from the RoboClaw and the receiver if it’s being powered from an external battery. Turn the transmitter on and then re-power the RoboClaw. The RoboClaw should now respond to input from the transmitter by moving the motors in response to moving the appropriate sticks.

If things don’t work as expected there are a few things to check. First check that the servo cables connections are seated properly and are oriented correctly both at the receiver and at the RoboClaw. If using external power check to see if the battery is adequately charged and that the 5V line of the servo cables has been disconnected completely. Lastly, reconnect the RoboClaw to Motion Studio and ensure the settings listed previously are set and saved to the board.

Note: 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 receiver will continue to send the last know stick positions to the RoboClaw. This can result in a robot running away or crashing. Some radio and receiver combinations can be programmed with failsafe positions to prevent these problems from occurring. Consult the documentation for the system being used for further details.