Kubo: Outdated Roboclaw Setup - olinrobotics/gravl GitHub Wiki
#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
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
Install Ion Studio from ION Motion Control website Downloads page (link)
Windows throws lots of virus warnings; ignore them, file is safe
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.
Plug RoboClaw into computer via microUSB-USB and update firmware through Ion Studio
Setup and Tuning of Potentiometers
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
Solder resistors in-line with 5VDC POT line (see next step for identification tables)
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
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
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)
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
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
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
Install Roboclaw Arduino library & examples from Ionmc; Move resulting folder to Arduino libraries folder (link)