Kubo: VCU and HCU Tuning - olinrobotics/gravl GitHub Wiki

0. Table of Contents

1. Overview

The Vehicle Control Unit (VCU) and the Hitch Control Unit (HCU) contain the electronics necessary for controlling the actuation of the tractor. The VCU manipulates the steering wheel angle and the velocity pedal angle, controlling the vehicle's speed and turning angle. The HCU manipulates the 3-point hitch manual levers, controlling the hitch's z-height and pitch.

The purpose of this page is to document the tuning procedure for the motor controllers. This process assumes that the control unit wiring is completed and can supply full power to the sensors and actuators. The process starts with installing the Roboclaw configuration software and ends with updating limit constants in the hindbrain firmware.

Notable information not covered on this page: TODO add links to appropriate locations

  • Component specifications
  • Wiring diagrams and instructions
  • Roboclaw Arduino Serial Interface API

2. Setup

  1. Install BasicMicro Motion Studio for Windows from this website (link)
  • Windows throws lots of virus warnings; ignore them, file is safe
  • Most recently tested and working version: 1.0.0.63
  1. Turn on both the tractor's primary electronics (turn the key one click) and the autonomous electronics (turn the battery switch above and behind the drivers seat to "ON:).
  • It is worth plugging one or both batteries into a charger while this process goes on, and plugging the tractor's AC converter into an AC outlet to provide separate power.
  1. Plug USB debug cable from VCU|HCU into computer
  2. Start Motion Studio; when the unit shows up in the left hand list (shown below), press "Connect Selected Unit"
    images/vcu-hcu/200224_gravl_ionmc-connect.PNG

3. VCU

3.0 Settings

images/vcu-hcu/200224_gravl_ionmc-gensettings.PNG

3.1 Sensor Ranging

Before tuning the system, determine the extreme sensor values for the potentiometer - the sensor only has a finite mechanical range and will be permanently destroyed if pushed past its limits.

  1. Remove potentiometer from mechanical assembly
  2. Gently turn shaft clockwise until it stops, record the value shown in Motion Studio
    images/vcu-hcu/200224_gravl_ionmc-encoders.PNG
  3. Repeat above step for counter-clockwise direction
  4. Turn shaft until value reads halfway between extreme points
  5. Re-mount potentiometer to mechanical assembly
Potentiometer CW Max Reading CCW Max Reading
Velocity 217 2037
Steering 210 2042

3.2 Velocity PID Tuning

In order for the motor controller to be able to control motor position, it first must be able to control motor velocity. A P-controller is sufficient for this purpose.

images/vcu-hcu/200224_gravl_ionmc-pidvel.PNG

3.3 Mechanical Ranging

Before tuning the positional controller, the sensor values for the extremes of the mechanical travel need to be determined.

  1. Physically (and carefully) drive the mechanical system to each of its limits and record the value in Motion Studio
  2. Set the Max and Min values in Motion Studio for the positional controller (See first image in the next heading
Potentiometer Max Pos Min Pos Center Pos
Velocity (F) 1220 (R) 1050 1115
Steering (R) 1600 (L) 650 1160

3.4 Positional PID Tuning

images/vcu-hcu/200224_gravl_ionmc-pidpos.PNG
Once the physical limts are set on the positional controller to prevent breaking the mechanical systems, proceed to tune the PID controllers to allow the motors to quickly and precisely reach a given point.

3.4.0 Velocity Motor

images/vcu-hcu/200224_gravl_ionmc-m1response-pos.PNG
The Velocity motor system has some issues that create a bad response as indicated above. The issues are as follows:

  • A deadband of 4 sensor degrees, which is a significant portion of the single rotation of the 10 turn potentiometer used for sensing
  • A non-constant force operating on the motor that changes depending on whether or not the pedal is moving forward or backward
  • A high I-term limit makes the system not able to settle (due to the deadband), but a lower I-term limit cannot let the motor get to position at its limits (where maximum force is acting)

3.4.1 Steering Motor

images/vcu-hcu/200224_gravl_ionmc-m2response-pos.PNG
The Steering motor system is much more forgiving and simple to control, and as such the response is much more normal.

3.5 Teensy Firmware

Now that the Motor controller is fully tuned, the refined parameters need to be set in the Teensy firmware, specifically in HindBrain.h.

4. HCU

images/vcu-hcu/200218_gravl_hcu.JPG

4.0 Hardware

M# Actuator Type Sensor Type Control Surface
M1 Linear Actuator Internal Potentiometer Hitch Pitch Lever (Coming Soon!)
M2 Linear Actuator Internal Potentiometer Hitch Height Lever

4.1 Sensor Ranging

Unlike the custom-built mechanical systems, there is no fear of destroying the linear actuator systems by overdriving them. As such, this step is unnecessary.

4.2 Velocity PID Tuning

In order for the motor controller to be able to control motor position, it first must be able to control motor velocity. A P-controller is sufficient for this purpose.

images/vcu-hcu/200218_gravl_hcu-velpid.JPG

4.3 Mechanical Ranging

Before tuning the positional controller, the sensor values for the extremes of the mechanical travel need to be determined.

  1. Physically (and carefully) drive the mechanical system to each of its limits and record the value in Motion Studio
  2. Set the Max and Min values in Motion Studio for the positional controller

images/vcu-hcu/200218_gravl_hcu-velmaxmin.JPG

4.4 Positional PID Tuning

Once the physical limts are set on the positional controller to prevent breaking the mechanical systems, proceed to tune a PID controller to allow the motor to quickly and precisely reach positions within the system.

images/vcu-hcu/200218_gravl_hcu-pospid.JPG

4.5 Teensy Firmware

Now that the Motor controller is fully tuned, the refined parameters need to be set in the Teensy firmware, specifically in HindBrain.h.

#TODO Insert Code