Skip to content

Kubo: Outdated Roboclaw Setup

Connor Novak edited this page Feb 1, 2020 · 1 revision

#WARNING: THESE SETTINGS ARE NO LONGER CORRECT

Introduction

Goal: Set up one Roboclaw Motor Controller on Kubo to drive a linear actuator and a DC motor, and set up another Roboclaw Motor Controller to drive a second linear actuator. On the first Roboclaw, the linear actuator (M1) controls the velocity pedal of the tractor, while the dc motor (M2) controls the steering wheel. The Roboclaw will in turn be sent position commands for M1 and M2 by the Arduino Teensie on serial port 1. On the second Roboclaw, the linear actuator (M2) controls the lever to raise and lower the hitch on the back of the tractor. This Roboclaw will be sent position commands for M2 by the Teensie on serial port 2.

Parts

For specific information on these parts, please see the Kubo hardware documentation. (documentation)

  • 2X45 RoboClaw Motor Controller
  • Linear Actuator
  • Steering Actuator
  • Steering Potentiometer

Procedure

Initial Setup of RoboClaw

  1. Check that stall current of motors can be handled by RoboClaw
  • Stall current of velocity actuator: 15A
  • Stall current of steering actuator: 44.4A
  • Stall current of hitch actuator: 5A
  • Peak current (per channel) of 2X45 RoboClaw: 60A
  1. Install Ion Studio from ION Motion Control website Downloads page (link)
  • Windows throws lots of virus warnings; ignore them, file is safe
  1. Wire 12V source to +/- on the main screw terminal
  • DOUBLE-CHECK THIS, OTHERWISE YOU KILL THE ROBOCLAW
  • MAKE SURE YOUR POWER SUPPLY CAN SOURCE OPERATING CURRENT! A lead-acid battery is a good choice.
  1. Plug RoboClaw into computer via microUSB-USB and update firmware through Ion Studio

Setup and Tuning of Potentiometers

  1. Choose resistors for potentiometers in actuators (see p. 81 of RoboClaw User Manual) (link)
  • 10K Velocity Potentiometer: In-line resistor value 15K
  • 10K Steering Potentiometer: In-line resistor value 15K
  • 10K Hitch Potentiometer: In-line resistor value 15K
  1. Solder resistors in-line with 5VDC POT line (see next step for identification tables)
  2. Plug encoders and motors into RoboClaw as shown on p. 81 of RoboClaw User Manual
  • RoboClaw PowerWerx Connectors: (see image 1 below)
Color PUR BLU YEL BLK RED
Purpose POT GND SIG 5VDC POT ACT GND 12VDC ACT
  • RoboClaw Wires: (see image 1 below)
Color GRN WHI BLK(sm) BLK(lg) RED
Purpose SIG 5VDC POT POT GND ACT GND 12VDC ACT
  • Velocity Potentiometer: (see image 2 below)
Color BLU YEL WHI
Purpose SIG 5VDC GND
  • Steering Potentiometer: (see image 3 below)
Color YEL RED BRN
Purpose SIG 5VDC GND
  • Hitch Actuator Wires:
Color BLUE WHITE YELLOW BLK RED
Purpose SIG 5VDC POT POT GND ACT GND 12VDC ACT
  1. On General Settings page in Ion Studio:
  • Make sure "Control Mode" is set to "Packet Serial" and "PWM Mode" is set to "Locked Antiphase"
  • Change "Encoder 1 Mode" and "Encoder 2 Mode" to "Absolute"
  • Save settings and power cycle the RoboClaw
  1. Using the "PWM Settings" window in Ion Studio, ensure motor spins-actuates in correct direction corresponding to increasing encoder values (switch motor wires on RoboClaw ports if necessary)
  • Velocity actuator: RED = -, BLK = +
  • Steering actuator: RED = +, BLU = -
    If the encoders are switched, check the box in the "General Settings" window labeled "Encoder Channels - Swap Encoder Channels" (Kubo's encoder channels are switched)
  1. Run motor speed test using PWM settings screen to determine QPPS value and set in Velocity settings screen
  • WARNING: DON'T DRIVE THE STEERING MOTOR TO THE STOPS, IT CAN BREAK MANY THINGS
  • Velocity actuator: max 160 in + dir, neg. dir behaved funky
  • Steering actuator: max 490 when turning left to right
  • Hitch actuator: max 310
  1. PID-Tune each motor velocity (instructions on p. 83 of RoboClaw User Manual)
  • Velocity actuator:
P I D
0.95000 0.30000 0.00000
  • Steering actuator:
P I D
0.95000 0.30000 0.00000
  • Hitch actuator:
P I D
0.95000 0.30000 0.00000
  1. PID-Tune each motor position (instructions on p. 83 of RoboClaw User Manual)
  • Velocity actuator:
P I D Min Pos Max Pos
1000.00 40.0000 0.00000 190 2048
  • Steering actuator:
P I D Min Pos Max Pos
500.000 1.00000 20.0000 600 1200
  • Hitch actuator:
P I D Min Pos Max Pos
2600 0.00000 0.00000 540 1300

Packet Serial Communication Setup

  1. Install Roboclaw Arduino library & examples from Ionmc; Move resulting folder to Arduino libraries folder (link)

  2. Cut USB 5V Pad from Teensy 5V Pad (link)

  3. Wire Arduino Rx, Tx, 5V, & GND ports to Roboclaw using Roboclaw user manual diagram on page 62

GRN WHI
S1 (Rx) S2 (Tx)
  1. Change Roboclaw mode to 7 and option to 4 using Roboclaw user manual instructions on page 35-36

  2. Start running code from Arduino Examples

  3. Useful link: https://www.pjrc.com/teensy/td_uart.html

Connor Novak last edited on 17/09/21

Clone this wiki locally