BASICMICRO RoboClaw Series Brushed DC Motor Controllers RoboClaw Solo RoboClaw 2x5A RoboClaw 2x7A RoboClaw 2x15A RoboClaw 2x30A RoboClaw 2x45A RoboClaw 2x45A ST RoboClaw 2x60A Roboclaw 2x60HV Roboclaw 2x120A Roboclaw 2x160A Roboclaw 2x200A User Manual Firmware 4.1.20 and Newer Hardware V3, V4, V5 and V6 User Manual Revision 5.6 (c) 2014, 2015 Ion Motion Control.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Contents Firmware History................................................................................................. 8 Warnings............................................................................................................. 9 Introduction...................................................................................................... 10 Motor Selection............................................................................
BASICMICRO RoboClaw Series Brushed DC Motor Controllers Control Modes.................................................................................................... 28 Setup.......................................................................................................... 28 USB Control................................................................................................. 28 RC............................................................................................................
BASICMICRO RoboClaw Series Brushed DC Motor Controllers USB Control....................................................................................................... 49 USB Connection............................................................................................ 49 USB Power................................................................................................... 49 USB Comport and Baudrate............................................................................
BASICMICRO RoboClaw Series Brushed DC Motor Controllers 8 - Drive Forward.......................................................................................... 66 9 - Drive Backwards...................................................................................... 66 10 - Turn right.............................................................................................. 66 11 - Turn left................................................................................................
BASICMICRO RoboClaw Series Brushed DC Motor Controllers Encoders............................................................................................................ 80 Cloose Loop Modes....................................................................................... 80 Encoder Tunning........................................................................................... 80 Quadrature Encoders Wiring...........................................................................
BASICMICRO RoboClaw Series Brushed DC Motor Controllers 65 - Buffered Drive M1 with signed Speed, Accel, Deccel and Position.................. 97 66 - Buffered Drive M2 with signed Speed, Accel, Deccel and Position.................. 97 67 - Buffered Drive M1 & M2 with signed Speed, Accel, Deccel and Position.......... 98 Reading Quadrature Encoder - Arduino Example............................................... 99 Speed Controlled by Quadrature Encoders - Arduino Example............................
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Firmware History RoboClaw is an actively maintained product. New firmware features will be available from time to time. The table below outlines key revisions that could affect the version of RoboClaw you currently own. Revision 4.1.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Warnings There are several warnings that should be noted before getting started. Damage can easily result by not properly wiring RoboClaw. Harm can also result by not properly planning emergency situations. Any time mechanical movement is involved the potential for harm is present. The following information can help avoid damage to RoboClaw, connected devices and help reduce the potential for harm or bodily injury.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Introduction Motor Selection When selecting a motor controller several factors should be considered. All DC brushed motors will have two current ratings, maximum stall current and continuous current. The most important rating is the stall current. Choose a model that can support the stall current of the motor selected to insure the motor can be driven properly without damage to the motor controller.
BASICMICRO RoboClaw Series Brushed DC Motor Controllers Logic Power When powering external devices from RoboClaw ensure the maximum BEC output rating is not exceeded. This can cause RoboClaw to suffer logic brown out which will cause erratic behavior. Some low quality encoders can cause excessive noise being put on the +5VDC rail of the RoboClaw. This excessive noise will cause unpredictable behavior. Encoders RoboClaw features dual channel quadrature/absolute decoding.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Getting Started Initial Setup RoboClaw offers several methods of control. Each control scheme has several configuration options. The following is quick start guide which will cover the basic initialization of RoboClaw. Most control schemes require very little configuration. The control options are covered in detail in this manual. The following is a basic setup procedure. 1. Read the Introduction and Hardware Overview sections of this manual.
BASICMICRO RoboClaw Series Brushed DC Motor Controllers Hardware Overview I/O RoboClaw's I/O is setup to interface to both 5V and 3.3V logic. This is accomplished by internally current limiting and clipping any voltages over 3.3V. RoboClaw outputs 3.3V which will work with any 5V or 3.3V logic. This is also done to protect the I/O from damage. Headers RoboClaw's share the same header and screw terminal pinouts accross models in this user manual.
BASICMICRO RoboClaw Series Brushed DC Motor Controllers Encoder Power (+ -) The pins labeled + and - are the source power pins for encoders. The positive (+) is located at the board edge and supplies +5VDC. The ground (-) pin is near the heatsink. On ST models all power must come from the single 5v screw terminal and the single GND screw terminal Main Battery Screw Terminals The main power input can be from 6VDC to 34VDC on a standard RoboClaw and 10.5VDC to 60VDC on an HV (High Voltage) RoboClaw.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Ion Studio Overview Ion Studio The Ion Studio software suite is design to configure, monitor and maintain RoboClaw. It's used to configure all the available RoboClaw modes and options. Ion Studio can be used to monitor and control RoboClaw. It can be download from http://www.ionmc.com. Once installed, each time Ion Studio is ran it will check for the latest version online. Connection This is the first screen shown when first running Ion Studio.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Device Status Once a RoboClaw is connected, the connection screen becomes active (1) and is now the Device Status screen. All status indicators (3,4) and monitored parameter feilds (2) will update to reflect the current status and values of the connected RoboClaw. When an RoboClaw is connected the Stop All (5) button becomes active. There is a small check box to activate the Stop All function by using the space bar on the keyboard.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Status Indicator (4) The status indicators shown at the bottom of the screen are an abbreviated duplication of the main status indicators shown on the device status screen. Label Description M1OC Motor 1 over current. M2OC Motor 2 over current. MBHI Main battery over voltage. MBLO Main battery under voltage. LBHI Logic battery over voltage. LBLO Logic battery under voltage.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO General Settings The general settings screen can be used to configure RoboClaw. This includes modes, mode options and monitored parameters. For detailed explanations see the Configuration with Ion Studio section of this manual. 4 1 5 2 3 6 Configuration Options Each control mode will have several configuration options. Some options will appear grayed out to indicate the option is not available for the selected mode.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO PWM Settings The PWM settings screen is used to control RoboClaw for testing. Slider are provided to control each motor channel. This screen can also be used to determine the QPPS of attached encoders. 1 4 3 2 (1) Graph Function Grid Description Displays channel data with 100mS update rate and one second horizontal divisions. (2) PWM/Torque Settings Function Description L MCP only. Motor Inductance in Henries. R MCP only.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO (3) Control Function Description Motor 1 Controls motor 1 duty percentage forward and reverse. Motor 2 Controls motor 2 duty percentage forward and reverse. Sync Motors Synchronises Motor 1 and Motor 2 Sliders. Accel Acceleration rate used when moving the sliders. Duty Displays the numberic value of the motor slider in 10ths of a Percent (0 to +/1000).
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Velocity Settings The Velocity settings screen is used to set the encoder and PID settings for speed control. The screen is also used for testing and plotting. 1 2 4 3 (1) Graph Function Grid Description Displays channel data with 100mS update rate and one second horizontal divisions. (2) Velocity Settings Function Description Velocity P Proportional setting for PID. Velocity I Integral setting for PID.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO (3) Control Function Description Motor 1 Motor 1 velocity control (0 to +/- maximum motor speed). Motor 2 Motor 2 velocity control (0 to +/- maximum motor speed). Sync Motors Synchronises Motor 1 and Motor 2 Sliders. On Release Will not update new speed until the slider is released. Accel Acceleration rate used when moving the sliders. Velocity Shows the numeric value for the sliders current position.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Position Settings The Position settings screen is used to set the encoder and PID settings for position control. The screen is also used for testing and plotting. 1 2 3 4 (1) Graph Function Grid RoboClaw Series User Manual Description Displays channel data with 100mS update rate and one second horizontal divisions.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO (2) Graph Channels Function Description Scale Sets vertical scale to fit the range of the specified Channel. Channels Select data to display on the channel. The channel is graphed in the color shown.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO (4) Control Function Description Motor 1 Motor 1 velocity control (0 to +/- maximum motor speed). Motor 2 Motor 2 velocity control (0 to +/- maximum motor speed). Sync Motors Synchronises Motor 1 and Motor 2 Sliders. On Release Will not update new speed until the slider is released. Accel Acceleration rate used when moving the sliders. Deccel Decceleration rate used when moving the sliders. Speed Speed to use with slide move.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Firmware Updates Ion Studio Setup Download and install the Ion Studio application. Win7 or newer is required. When opening Ion Studio, it will check for updates and search for a USB Windows Driver to verify installation. If the USB driver is not found, Ion Studio will install it. 1. Open the Ion Studio application. 2. Apply a reliable power source such as a fully charge battery to power the motor controller. 3.
BASICMICRO RoboClaw Series Brushed DC Motor Controllers 1. When a new version of firmware is shown click the update button (3) to start the process. 2. Ion Studio will begin to update the firmware. While the firmware update is in progress the onboard LEDs will begin to flash. The onboard flash memory will first be erased. It is important power is not lost during this process or the motor controller will no longer function. There is no recovery if power fails during the erase process. 3.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Control Modes Setup RoboClaw has several fucntional control modes. There are two methods to configure these modes. Using the built-in buttons or Ion Studio. This manaul covers both methods of configuration. Ion Studio offers greater options for each mode and can be easier to configure the RoboClaw in several situations. However the built-in buttons are more than adequate in most all modes.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Configuration Using Ion Studio Mode Setup Download and install the Ion Studio application from http://www.ionmc.com. A PC with Windows 7 or newer is required. Ion Studio will check for a newer version each time it is ran. It will then search for the USB RoboClaw Windows Driver to verify installation. If the USB driver is not found Ion Studio will install it. 1. Open the Ion Studio application. 2.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Control Mode Setup Select the Control Mode drop down (1). There are 4 main modes. See the Control Modes section of this manual for a detailed explanation of each available mode.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Control Mode Options The general settings screen is used to configure RoboClaw. Each control mode will have several configuration options. Grayed out options are not available for the selected mode. Once all settings are configured they must be saved to RoboClaw. This is done by selecting Save Settings from the File menu in the menu bar.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO (1) Setup Main drop down for setting the control modes and confirguration options. Function Description Control Mode Drop down to set main control mode. Some options may grey out if not available in the selected mode. PWM Mode Drop down to set the main MOSFET driving scheme. This option should never be change but in rare circumstances. Bridge Channels Used to bridge motor channe 1 and 2.
BASICMICRO RoboClaw Series Brushed DC Motor Controllers (3) Battery Main and logic battery voltage settings. Sets cut off and protection limits. Function Description Battery Cut Off Sets main battery cut off based on LiPo cell count. Can also be set to auto detect or User Settings for manual configuration. Auto detect requires a properly charged battery. User Settings allows editing of the voltage values manually. See Battery Settings. Max Main Battery Sets main battery maximum voltage.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO (5) Motors Motor current limit settings. The accel and deccel settings apply to RC, Analog and commands with no Accel and Deccel arugements. Function Description M1 Max Current Sets maximum motor current for channel 1. Can not exceed RoboClaw rated peak current. M2 Max Current Sets maximum motor current for channel 2. Can not exceed RoboClaw rated peak current. M1 Default Accel Sets the ramp rate of acceleration for motor channel 1.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Configuration with Buttons Mode Setup The 3 buttons on RoboClaw are used to set the different configuration options. The MODE button sets the interface method such as Serial or RC modes. The SET button is used to configure the options for the mode. The LIPO button doubles as a save button and configuring the low battery voltage cut out function of RoboClaw. To set the desired mode follow the steps below. 1.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Mode Options Each mode will have several possible configuration settings. The settings need to be setup after the initial mode is selected. Follow the steps below. 1. After the desired mode is set and saved press and release the SET button for options setup. The STAT2 LED will begin to blink out the current option setting. 2. Press SET to increment to the next option. Press MODE to decrement to the previous option. 3.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Battery Cut Off Settings The RoboClaw is able to protect the main battery by utilizing a battery voltage cut off. The cut off voltage will vary depending on the size of battery used. The table below shows the battery option setting with the type of battery it will protect and at what voltage the cutoff will kick in. The battery settings can be set by following the steps below. 1. Press and release the LIPO button.
BASICMICRO RoboClaw Series Brushed DC Motor Controllers Battery Settings Automatic Battery Detection on Startup Auto detect will sample the main battery voltage on power up or after a reset. All Lipo batteries, depending on cell count will have a minimum and maximum safe voltage range. The attached battery must be within this acceptable voltage range to be correctly detected. Undercharged or overcharged batteries will cause false readings and RoboClaw will not properly protect the battery.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Wiring Basic Wiring The MCP has many control modes and each mode may have unique wiring requirments to ensure safe and reliable operation. The diagram below illustrates a very basic wiring configuration used in a small motor system where safety concerns are minimal. This is the most basic wiring configuration possible. Any wiring of RoboClaw should include a main battery shut off switch, even when safety concerns are minimal.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Safety Wiring In all system with movement, safety is a concern. The wiring diagram below illustrates a properly wired system with several safety features. An external main power cut off is required for safety. When the RoboClaw is switched off or the fuse is blown, a high current diode (D1) is required to create a return path to the battery for any regenerative voltages.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Logic Battery Wiring An optional logic battery is supported. Under heavy loads the main power can suffer voltage drops, causing potential logic brown outs which may result in uncontrolled behavior. A separate power source for the motor controllers logic circuits, can remedy potential problems from main power voltage drops. The logic battery maximum input voltage is 34VDC with a minimum input voltage of 6VDC.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Status LEDs Status and Error LEDs RoboClaw includes 3 LEDs to indicate status. Two green status LEDs labeled STAT1 and STAT2 and one red error LED labeled ERR. When the motor controller is first powered on all 3 LEDs should blink briefly to indicate all LEDs are functional. The LEDs will behave differently depending on the mode.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO LED Blink Sequences When a warning or fault occurs RoboClaw will use the LEDs to blink a sequence. The below table details each sequence and the cause. LED Status Condition Type Description All three LEDs lit. E-Stop Fault Motors are stopped by braking. Error LED lit while condition is active. Over 85c Temperature Warning Motor current limit is recalculated based on temperature. Error LED blinks once with short delay. Other LEDs off.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Inputs S3, S4 and S5 Setup RoboClaw S3, S4 and S5 inputs support the use of home switches, limit switches, Voltage Clamping and E-Stops. A limit switch is used to detect the travel limits. Travel limits are typically used on a linear slide to detect when the assembly has reached the end of travel. A home switch is used to create a known start position. In some situations both may be required.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Limit / Home / E-Stop Wiring S4 controls motor channel 1 and S5 controls motor channel 2. A pull-up resistor to 5VDC or 3.3VDC should be used if wire lengths exceed 6” (150mm). The circuit below shows a NO (normally open) style switch. Connect the NO to S4 or S5 and the COM end to a power ground shared with RoboClaw.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Regenerative Voltage Clamping Voltage Clamp When using power supplies regenerative voltage spikes will need to be dissipated. This can be done with a simple circuit shown below and using a V-Clamp pin to activate it. A solid state switch (Q1) and large wattage resistor (R3) are required. The regenerative voltage will be dissipated as heat.
BASICMICRO RoboClaw Series Brushed DC Motor Controllers Voltage Clamp Setup and Testing Open Ion Studio and set S5 to the Voltage Clamp option in the drop down and save the setting before exiting the application (see user manual). The circuit shown will need to be tuned for each application to properly dissipate the regenerative voltages. Testing should consist of a running the motor up to 25% of its speed and then quickly slowing down without braking or e-stop while checking the voltage spike.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Bridge Mode Bridging Channels RoboClaws dual channels can be bridge to run as one channel, effectively doubling its current capability for one motor. RoboClaw will be damaged if it is not set to bridged channel mode before wiring. Download and install Ion Studio application. Connect the motor controller to the computer using an available USB port. Run Ion Studio and in general settings check the option to "Bridge Channels".
RoboClaw Series Brushed DC Motor Controllers BASICMICRO USB Control USB Connection When RoboClaw is connected, it will automatically detect it has been connected to a powered USB master and will enable USB communications. USB can be connected in any mode. When the Roboclaw is not in packet serial mode USB packet serial commands can be used to read status information and set configuration settings, however motor movement commands will not function.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO RC Control RC Mode RC mode is typically used when controlling RoboClaw from a hobby RC radio. This mode can also be used to simplify driving RoboClaw from a microcontroller using servo pulses. In this mode S1 controls the direction and speed of motor 1 and S2 controls the direction and speed of motor 2. RC Mode With Mixing This mode is the same as RC mode with the exception of how S1 and S2 controls the attached motors.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO RC Wiring Example Connect the RoboClaw as shown below. Set mode 1 with option 1. Before powering up, center the control sticks on the radio transmitter, turn the radio on first, then the receiver, then RoboClaw. It will take RoboClaw about 1 second to calibrate the neutral positions of the RC controller.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO RC Control - Arduino Example The example will drive a 2 motor 4 wheel robot in reverse, stop, forward, left turn and then right turn. The program was written and tested with a Arduino Uno and P5 connected to S1, P6 connected to S2. Set mode 2 with option 4. //RoboClaw RC Mode //Control RoboClaw with servo pulses from a microcontroller. //Mode settings: Mode 2(RC mixed mode) with Option 4(MCU with Exponential). #include
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Analog Control Analog Mode Analog mode is used when controlling RoboClaw from a potentiometer or a filtered PWM signal. In this mode S1 and S2 are set as analog inputs. The voltage range is 0V = Full reverse, 1V = Stop and 2V = Full forward. Analog Mode With Mixing This mode is the same as Analog mode with the exception of how S1 and S2 control the attached motors.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Analog Wiring Example RoboClaw uses a high speed 12 bit analog converter. Its range is 0 to 2V. The analog pins are protected and 5V tolerant. The potentiometer range will be limited if 5V is utilized as the reference voltage. A simple resistor divider circuit can be used to reduce the on board 5V to 2V for use with a potentiometer(POT). See the below schematic. The POT acts as one half of the resistor divider.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Stand Serial Control Standard Serial Mode In this mode S1 accepts TTL level byte commands. Standard serial mode is one way serial data. RoboClaw can receive only. A standard 8N1 format is used. Which is 8 bits, no parity bits and 1 stop bit. If you are using a microcontroller you can interface directly to RoboClaw. If you are using a PC a level shifting circuit (eg: Max232) is required.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Standard Serial Wiring Example In standard serial mode the RoboClaw can only receive serial data. The below wiring diagram illustrates a basic setup of RoboClaw for use with standard serial. The diagram below shows the main battery as the only power source. Make sure the LB jumper is set correctly. The 5VDC shown connected is only required if your MCU needs a power source. This is the BEC feature of RoboClaw.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Standard Serial Mode With Slave Select Slave select is used when more than one RoboClaw is on the same serial bus. When slave select is set to ON the S2 pin becomes the select pin. Set S2 high (5V) and RoboClaw will execute the next set of commands sent to S1 pin. Set S2 low (0V) and RoboClaw will ignore all received commands. Any RoboClaw connected to a bus must share a common signal ground (GND) shown by the black wire.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Standard Serial - Arduino Example The following example will start both channels in reverse, stop, forward, stop, turn left, stop turn right stop. The program was written and tested with a Arduino Uno and Pin 11 connected to S1 and pin 10 connected to S2. //Roboclaw simple serial example. #include "BMSerial.h" Set mode to 5. Option to 4(38400 bps) BMSerial mySerial(10,11); void setup() { mySerial.begin(38400); } void loop() { mySerial.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Packet Serial Packet Serial Mode Packet serial is a buffered bidirectional serial mode. More sophisticated instructions can be sent to RoboClaw. The basic command structures consist of an address byte, command byte, data bytes and a CRC16 16bit checksum. The amount of data each command will send or receive can vary. Address Packet serial requires a unique address when used with TTL serial pins(S1 and S2).
BASICMICRO RoboClaw Series Brushed DC Motor Controllers Packet Timeout When sending a packet to RoboClaw, if there is a delay longer than 10ms between bytes being received in a packet, RoboClaw will discard the entire packet. This will allow the packet buffer to be cleared by simply adding a minimum 10ms delay before sending a new packet command in the case of a communications error. This can usually be accomodated by having a 10ms timeout when waiting for a reply from the RoboClaw.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Handling values larger than a byte Many Packet Serial commands require values larger than a byte can hold. In order to send or receive those values they need to be broken up into 2 or more bytes. There are two ways this can be done, high byte first or low byte first. Roboclaw expects the high byte first. All command arguments and values are either single bytes, words (2 bytes) or longs (4 bytes).
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Packet Serial Wiring In packet serial mode the RoboClaw can transmit and receive serial data. A microcontroller with a UART is recommended. The UART will buffer the data received from RoboClaw. When a request for data is made to RoboClaw the return data will have at least a 1ms delay after the command is received if the baud rate is set at or below 38400. This will allow slower processors and processors without UARTs to communicate with RoboClaw.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Multi-Unit Packet Serial Wiring In packet serial mode up to eight Roboclaw units can be controlled from a single serial port. The wiring diagram below illustrates how this is done. Each Roboclaw must have multi-unit mode enabled and have a unique packet serial address set. This can be configured using Ion studio. Wire the S1 and S2 pins directly to the MCU TX and RX pins. Install a pull-up resistor (R1) on the MCU RX pin. A 1K to 4.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Commands 0 - 7 Compatibility Commands The following commands are used in packet serial mode.
BASICMICRO RoboClaw Series Brushed DC Motor Controllers 3 - Set Maximum Main Voltage (Command 57 Preferred) Sets main battery (B- / B+) maximum voltage level. The valid data range is 30 - 175 (6V 34V). During regenerative breaking a back voltage is applied to charge the battery. When using a power supply, by setting the maximum voltage level, RoboClaw will, before exceeding it, go into hard braking mode until the voltage drops below the maximum value set.
BASICMICRO RoboClaw Series Brushed DC Motor Controllers Commands 8 - 13 Mixed Mode Compatibility Commands The following commands are mix mode commands used to control speed and turn for differential steering. Before a command is executed, both valid drive and turn data packets are required Once RoboClaw begins to operate the motors turn and speed can be updated independently. 8 - Drive Forward Drive forward in mix mode. Valid data range is 0 - 127. A value of 0 = full stop and 127 = full forward.
BASICMICRO RoboClaw Series Brushed DC Motor Controllers Packet Serial - Arduino Example The example will start the motor channels independently. Then start turns with mix mode commands. The program was written and tested with an Arduno Uno with P11 connected to S1 and P10 connected to S2. Set mode 7 and option 4. Additional example programs can be downloaded from Ionmc.com. //Set mode to 7(packet serial address 0x80) and option to 4(38400) //Includes required to use Roboclaw library #include "BMSerial.
BASICMICRO RoboClaw Series Brushed DC Motor Controllers roboclaw.TurnLeftMixed(address, 0); //stop turn roboclaw.BackwardMixed(address, 127); //half speed backward delay(2000); roboclaw.TurnRightMixed(address, 64); //half speed turn right delay(2000); roboclaw.TurnLeftMixed(address, 64); //half speed turn left delay(2000); } roboclaw.ForwardMixed(address, 0); //stop going backward roboclaw.TurnRightMixed(address, 64); //half speed right turn delay(2000); roboclaw.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Advance Packet Serial Commands The following commands are used to read RoboClaw status information, version information and to set or read configuration values. All commands sent to RoboClaw need to be signed with a CRC16 (Cyclic Redundancy Check of 2 bytes) to validate each packet it received. This is more complex than a simple checksum but prevents errors that could otherwise cause unexpected actions to execute on the Roboclaw.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Command Description 104 Read CTRLs 133 Set M1 Maximum Current 134 Set M2 Maximum Current 135 Read M1 Maximum Current 136 Read M2 Maximum Current 148 Set PWM Mode 149 Read PWM Mode 21 - Read Firmware Version Read RoboClaw firmware version. Returns up to 48 bytes(depending on the Roboclaw model) and is terminated by a line feed character and a null character. Send: [Address, 21] Receive: [“RoboClaw 10.2A v4.1.
BASICMICRO RoboClaw Series Brushed DC Motor Controllers 27 - Set Maximum Logic Voltage Level Note: This command is included for backwards compatibility. We recommend you use command 58 instead. Sets logic input (LB- / LB+) maximum voltage level. The valid data range is 30 - 175 (6V 34V). RoboClaw will shutdown with an error if the voltage is above this level. The formula for calculating the voltage is: Desired Volts x 5.12 = Value. Examples of valid values are 12V = 62, 16V = 82 and 24V = 123.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO 60 - Read Logic Battery Voltage Settings Read the Logic Battery Voltage Settings. The voltage is calculated by dividing the value by 10 Send: [Address, 60] Receive: [Min(2 bytes), Max(2 bytes), CRC(2 bytes)] 68 - Set M1 Default Duty Acceleration Set the default acceleration for M1 when using duty cycle commands(Cmds 32,33 and 34) or when using Standard Serial, RC and Analog PWM modes.
BASICMICRO RoboClaw Series Brushed DC Motor Controllers 75 - Get S3, S4 amd S5 Modes Read mode settings for S3,S4 and S5. See command 74 for mode descriptions Send: [Address, 75] Receive: [S3mode, S4mode, S5mode, CRC(2 bytes)] 76 - Set DeadBand for RC/Analog controls Set RC/Analog mode control deadband percentage in 10ths of a percent. Default value is 25(2.5%). Minimum value is 0(no DeadBand), Maximum value is 250(25%).
RoboClaw Series Brushed DC Motor Controllers BASICMICRO 90 - Read Status Read the current unit status.
BASICMICRO RoboClaw Series Brushed DC Motor Controllers 94 - Write Settings to EEPROM Writes all settings to non-volatile memory. Values will be loaded after each power up. Send: [Address, 94] Receive: [0xFF] 95 - Read Settings from EEPROM Read all settings from non-volatile memory.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO 98 - Set Standard Config Settings Set config bits for standard settings.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO 99 - Read Standard Config Settings Read config bits for standard settings See Command 98. Send: [Address, 99] Receive: [Config(2 bytes), CRC(2 bytes)] 100 - Set CTRL Modes Set CTRL modes of CTRL1 and CTRL2 output pins(available on select models). Send: [Address, 20, CRC(2 bytes)] Receive: [0xFF] On select models of Roboclaw, two Open drain, high current output drivers are available, CTRL1 and CTRL2.
BASICMICRO RoboClaw Series Brushed DC Motor Controllers 102 - Set CTRL1 Set CTRL1 output value(available on select models) Send: [Address, 102, Value(2 bytes), CRC(2 bytes)] Receive: [0xFF] Set the output state value of CTRL1. See 100 - Set CTRL Modes for valid values. 103 - Set CTRL2 Set CTRL2 output value(available on select models) Send: [Address, 103, Value(2 bytes), CRC(2 bytes)] Receive: [0xFF] Set the output state value of CTRL2. See 100 - Set CTRL Modes for valid values.
BASICMICRO RoboClaw Series Brushed DC Motor Controllers 136 - Read M2 Max Current Limit Read Motor 2 Maximum Current Limit. Current value is in 10ma units. To calculate divide value by 100. MinCurrent is always 0. Send: [Address, 136] Receive: [MaxCurrent(4 bytes), MinCurrent(4 bytes), CRC(2 bytes)] 148 - Set PWM Mode Set PWM Drive mode. Locked Antiphase(0) or Sign Magnitude(1). Send: [Address, 148, Mode, CRC(2 bytes)] Receive: [0xFF] 149 - Read PWM Mode Read PWM Drive mode. See Command 148.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Encoders Cloose Loop Modes RoboClaw supports a wide range of encoders for close loop modes. Encoders are used in velocity, position or a cascaded velocity with position control mode. This manual mainly deals with Quadrature and Absolute encoders. However additional types of encoders are supported. Encoder Tunning All encoders will require tuning to properly function.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Absolute Encoder Wiring RoboClaw is capable of reading absolute encoders that output an analog voltage. Like the Analog input modes for controlling the motors, the absolute encoder voltage must be between 0v and 2v. If using standard potentiometers as absolute encoders the 5v from the RoboClaw can be divided down to 2v at the potentiometer by adding a resistor from the 5v line on the RoboClaw to the potentiometer. For a 5k pot R1 / R2 = 7.
BASICMICRO RoboClaw Series Brushed DC Motor Controllers Encoder Tuning To control motor speed and or position with an encoder the PID must be calibrated for the specific motor and encoder being used. Using Ion Studio the PID can be tuned manually or by the auto tune fucntion. Once the encoders are tuned the settings can be saved to the onboard eeprom and will be loaded each time the unit powers up. The Ion Studio window for Velocity Settings will auto tune for velocity.
BASICMICRO RoboClaw Series Brushed DC Motor Controllers Manual Velocity Calibration Procedure 1. Determine the quadrature pulses per second(QPPS) value for your motor. The simplest method to do this is to run the Motor at 100% duty using Ion Studio and read back the speed value from the encoder attached to the motor. If you are unable to run the motor like this due to physical constraints you will need to estimate the maximum speed in encoder counts the motor can produce. 2.
BASICMICRO RoboClaw Series Brushed DC Motor Controllers 4. Once your position control is acting relatively smoothly and coming close to the set position you can think about adjusting the I setting. Adding I will help reach the exact set point specified but in most motor systems there is enough slop in the gears that instead you will end up causing an oscillation around the specified position. This is called hunting. The I setting causes this when there is any slop in the motor/encoder/gear train.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Encoder Commands The following commands are used with the encoders both quadrature and absolute. The Encoder Commands are used to read the register values for both encoder channels. Command Description 16 Read Encoder Count/Value for M1. 17 Read Encoder Count/Value for M2. 18 Read M1 Speed in Encoder Counts Per Second. 19 Read M2 Speed in Encoder Counts Per Second. 20 Resets Encoder Registers for M1 and M2(Quadrature only).
BASICMICRO RoboClaw Series Brushed DC Motor Controllers 17 - Read Quadrature Encoder Count/Value M2 Read M2 encoder count/position. Send: [Address, 17] Receive: [EncCnt(4 bytes), Status, CRC(2 bytes)] Quadrature encoders have a range of 0 to 4,294,967,295. Absolute encoder values are converted from an analog voltage into a value from 0 to 2047 for the full 2v range. The Status byte tracks counter underflow, direction and overflow.
BASICMICRO RoboClaw Series Brushed DC Motor Controllers 22 - Set Quadrature Encoder 1 Value Set the value of the Encoder 1 register. Useful when homing motor 1. This command applies to quadrature encoders only. Send: [Address, 22, Value(4 bytes), CRC(2 bytes)] Receive: [0xFF] 23 - Set Quadrature Encoder 2 Value Set the value of the Encoder 2 register. Useful when homing motor 2. This command applies to quadrature encoders only.
RoboClaw Series Brushed DC Motor Controllers BASICMICRO Advance Motor Control Advanced Motor Control Commands The following commands are used to control motor speeds, acceleration distance and position using encoders. The PID can also be manually adjusted using Advance Motor Control Commands. Command Description 28 Set Velocity PID Constants for M1. 29 Set Velocity PID Constants for M2. 32 Drive M1 With Signed Duty Cycle. (Encoders not required) 33 Drive M2 With Signed Duty Cycle.
BASICMICRO RoboClaw Series Brushed DC Motor Controllers 28 - Set Velocity PID Constants M1 Several motor and quadrature combinations can be used with RoboClaw. In some cases the default PID values will need to be tuned for the systems being driven. This gives greater flexibility in what motor and encoder combinations can be used. The RoboClaw PID system consist of four constants starting with QPPS, P = Proportional, I= Integral and D= Derivative.
BASICMICRO RoboClaw Series Brushed DC Motor Controllers 33 - Drive M2 With Signed Duty Cycle Drive M2 using a duty cycle value. The duty cycle is used to control the speed of the motor without a quadrature encoder. The command syntax: Send: [Address, 33, Duty(2 Bytes), CRC(2 bytes)] Receive: [0xFF] The duty value is signed and the range is -32768 to +32767 (eg. +-100% duty). 34 - Drive M1 / M2 With Signed Duty Cycle Drive both M1 and M2 using a duty cycle value.
BASICMICRO RoboClaw Series Brushed DC Motor Controllers 35 - Drive M1 With Signed Speed Drive M1 using a speed value. The sign indicates which direction the motor will turn. This command is used to drive the motor by quad pulses per second. Different quadrature encoders will have different rates at which they generate the incoming pulses. The values used will differ from one encoder to another. Once a value is sent the motor will begin to accelerate as fast as possible until the defined rate is reached.
BASICMICRO RoboClaw Series Brushed DC Motor Controllers 39 - Drive M2 With Signed Speed And Acceleration Drive M2 with a signed speed and acceleration value. The sign indicates which direction the motor will run. The acceleration value is not signed. This command is used to drive the motor by quad pulses per second and using an acceleration value for ramping. Different quadrature encoders will have different rates at which they generate the incoming pulses.
BASICMICRO RoboClaw Series Brushed DC Motor Controllers 42 - Buffered M2 Drive With Signed Speed And Distance Drive M2 with a speed and distance value. The sign indicates which direction the motor will run. The distance value is not signed. This command is buffered. Each motor channel M1 and M2 have separate buffers. This command will execute immediately if no other command for that channel is executing, otherwise the command will be buffered in the order it was sent.
BASICMICRO RoboClaw Series Brushed DC Motor Controllers 45 - Buffered M2 Drive With Signed Speed, Accel And Distance Drive M2 with a speed, acceleration and distance value. The sign indicates which direction the motor will run. The acceleration and distance values are not signed. This command is used to control the motors top speed, total distanced traveled and at what incremental acceleration value to use until the top speed is reached. Each motor channel M1 and M2 have separate buffers.
BASICMICRO RoboClaw Series Brushed DC Motor Controllers 50 - Drive M1 / M2 With Signed Speed And Individual Acceleration Drive M1 and M2 in the same command using one value for acceleration and two signed speed values for each motor. The sign indicates which direction the motor will run. The acceleration value is not signed. The motors are sync during acceleration. This command is used to drive the motor by quad pulses per second and using an acceleration value for ramping.
BASICMICRO RoboClaw Series Brushed DC Motor Controllers 53 - Drive M2 With Signed Duty And Acceleration Drive M1 with a signed duty and acceleration value. The sign indicates which direction the motor will run. The acceleration values are not signed. This command is used to drive the motor by PWM and using an acceleration value for ramping. Accel is the rate at which the duty changes from the current duty to the specified dury.
BASICMICRO RoboClaw Series Brushed DC Motor Controllers 62 - Set Motor 2 Position PID Constants The RoboClaw Position PID system consist of seven constants starting with P = Proportional, I= Integral and D= Derivative, MaxI = Maximum Integral windup, Deadzone in encoder counts, MinPos = Minimum Position and MaxPos = Maximum Position. The defaults values are all zero.
BASICMICRO RoboClaw Series Brushed DC Motor Controllers 67 - Buffered Drive M1 & M2 with signed Speed, Accel, Deccel and Position Move M1 & M2 positions from their current positions to the specified new positions and hold the new positions. Accel sets the acceleration value and deccel the decceleration value. QSpeed sets the speed in quadrature pulses the motor will run at after acceleration and before decceleration.
BASICMICRO RoboClaw Series Brushed DC Motor Controllers Reading Quadrature Encoder - Arduino Example The example was tested with an Arduino Uno using packet serial wiring and quadrature encoder wiring diagrams. The example will read the speed, total ticks and direction of each encoder. Connect to the program using a terminal window set to 38400 baud. The program will display the values of each encoders current count along with each encoder status bit in binary and the direction bit.
BASICMICRO RoboClaw Series Brushed DC Motor Controllers if(valid3){ terminal.print(speed1,HEX); terminal.print(" "); } else{ terminal.print("invalid "); } terminal.print("Speed2:"); if(valid4){ terminal.print(speed2,HEX); terminal.print(" "); } else{ terminal.print("invalid "); } terminal.
BASICMICRO RoboClaw Series Brushed DC Motor Controllers Speed Controlled by Quadrature Encoders - Arduino Example The following example was written using an Arduino UNO using packet serial wiring and quadrature encoder wiring diagrams. The example will command a 4wheel robot to move forward, backward, right turn and left turn slowly. You can change the speed by adjusting the value of Speed and Speed2 variables. Additional example programs can be downloaded from Ionmc.com.
BASICMICRO RoboClaw Series Brushed DC Motor Controllers void displayspeed(void) { uint8_t status1,status2,status3,status4; bool valid1,valid2,valid3,valid4; } int32_t enc1= roboclaw.ReadEncM1(address, &status1, &valid1); int32_t enc2 = roboclaw.ReadEncM2(address, &status2, &valid2); int32_t speed1 = roboclaw.ReadSpeedM1(address, &status3, &valid3); int32_t speed2 = roboclaw.ReadSpeedM2(address, &status4, &valid4); terminal.print("Encoder1:"); if(valid1){ terminal.print(enc1,DEC); terminal.
BASICMICRO RoboClaw Series Brushed DC Motor Controllers void loop() { roboclaw.SpeedM1(address,speed); roboclaw.SpeedM2(address,speed); for(uint8_t i = 0;i<100;i++){ displayspeed(); delay(10); } roboclaw.SpeedM1(address,-speed); roboclaw.SpeedM2(address,-speed); for(uint8_t i = 0;i<100;i++){ displayspeed(); delay(10); } roboclaw.SpeedM1(address,0); roboclaw.SpeedM2(address,0); delay(2000); roboclaw.SpeedM1(address,speed2); roboclaw.
BASICMICRO RoboClaw Series Brushed DC Motor Controllers Warranty Basicmicro warranties its products against defects in material and workmanship for a period of 1 year. If a defect is discovered, Basicmicro will, at our sole discretion, repair, replace, or refund the purchase price of the product in question. Contact us at sales@basicmicro.com. No returns will be accepted without the proper authorization. Copyrights and Trademarks Copyright© 2015 by Basicmicro, Inc. All rights reserved.