Difference between revisions of "Design Philosophy for Rigatoni’s Automated Steering Subsystem"

From RoboJackets Wiki
Jump to navigation Jump to search
m (added purpose)
 
(19 intermediate revisions by one other user not shown)
Line 1: Line 1:
= Purpose =
+
This Wiki article is designed to give RoboRacing members insight into the design of the electrical steering subsystem for RoboRacing’s autonomous go kart Rigatoni. Rigatoni is a full-size Top Kart electric go cart that RoboRacing is modifying to become autonomous, and it will compete in the 2020 evGrandPrix competition. This article will provide readers with an overview of the main parts driving the automated steering system: the stepper motor that will physically turn the steering shaft, the encoder that will tell the central processor the current steering angle and the design of the PCB running the steering subsystem. It will also provide brief reasoning for why each part was picked.
 +
 
 +
= Stepper Motor =
 +
 
 +
=== Decision Process ===
 +
[[File:Nema 23.jpg|325px|thumb|right|'''Figure 1.''' An image of the Nema 23 closed-loop geared stepper motor and its gearbox.]]
 +
In order to have an automated go kart, the go kart must be able to steer on its own, and to do that it must be able to move the steering column on its own. To achieve this, a secondary motor dedicated to driving the steering system must be installed. This motor must be able to rotate to precise angular positions and have enough torque to be able to turn the steering column, so a stepper motor was chosen instead of a servo. Although servos have built in potentiometers and are accurate, many do not have the torque required to maintain a steady position. A stepper motor does have the necessary torque but requires a driver to take the angular input and turn the motor to the correct position. Stepper motors are made up of a DC motor with multiple coils to drive it. These coils are powered in a specific sequence allowing the motor to turn in steps. They have much more torque than a regular DC motor at low speed and are good for precision at low RPM. Because they move in predictable steps, rotational speed control is easily achieved. Unfortunately, stepper motors do not have internal feedback for their position like servos do, so an external solution is required, such as an absolute rotary encoder.
 +
 
 +
=== Nema 23 Closed-loop Geared Stepper Motor ===
 +
 
 +
Shortly after deciding to use a stepper motor, the RoboRacing team leads spec’d and chose the Nema 23 Closed-loop Geared Stepper Motor. It features 1.25 N•m holding torque motor attached to a planetary gearbox with a 15.3 gear ratio with 30 N•m maximum permissible torque and 50 N•m of moment permissible torque. To run it, RoboRacing chose the Stepperonline CL57T Closed-loop Stepper Drive. Communication with the stepper motor is done via a 15 pin ethernet connector, and the drive communicates using jumper wires plugged into screw sockets. This stepper motor and drive in tandem with an appropriate absolute encoder will be able to accurately choose and hold a steering angle during a race.
 +
 
 +
=== Complications ===
 +
 
 +
RoboRacing has decided to keep the seat and steering wheel for the go kart so that it can still be driven manually. Although convenient, this decision requires a work around. The Nema 23 has very low gear ratios and thus a lot of torque, so a driver (person, not the stepper driver) cannot turn the steering wheel if the stepper motor is always mounted to the steering system. A clutch system is being planned to put in place to detach the stepper motor from the steering system when the kart is being driven manually.
 +
 
 +
= Encoder =
 +
 
 +
=== Decision Process ===
 +
 
 +
The other important part of an automated steering system is knowing the angular position of the steering column. The decision to keep the seat and steering wheel so that it can still be driven manually required the design to include an absolute rotary encoder rather than incremental encoder or limit switches. An absolute rotary encoder differs from an incremental encoder in that it can keep track of absolute angular position, even when powered off, whereas incremental encoders only report a change in position. Limit switches positioned at the limits of the steering angle were considered, however the steering would have to go through a zeroing sequence upon start-up, and the current angle would be held as a variable in software which does not account for physical shifts in the steering position that could be induced in a crash or other disturbance during a race.
 +
[[File:MFG AMT22-V.jpg|325px|thumb|right|'''Figure 2.''' An image of the CUI Devices AMT222B-V absolute rotary encoder with its various bore sockets.]]
 +
 
 +
An absolute rotary encoder allows for precise feedback to the software of the steering column’s real-time angle, rather than just assuming the angle within the software. It also allows the autonomous system to know precisely the angle of the steering column upon applying power. This way it does not matter the angle the steering column was left in when switching from manual to autonomous control.
 +
 
 +
The two most common types of encoders operate optically or magnetically. Optical encoders require photo-sensors and a led to read in differences in light to understand where the absolute angular position of the shaft that they are attached to. Although they are precise, they are susceptible to interference from inconsistent light and dirt, so they are not ideal for use on a racing go kart. Magnetic encoders use Hall effect sensors with magnets to read in angular position, and although they are rugged, they are not as precise as optical encoders and are susceptible to interference from other magnetic fields, which can be an issue if they are positioned near a stepper motor, which would be an issue as a stepper motor is being used in Rigatoni.
 +
 
 +
The steering sub team at RoboRacing opted to use a capacitive encoder, which reads modulations in a high frequency reference signal. This signal is modulated by a disk embedded with a sinusoid that rotates between a transmitter and a receiver, and the modulations are then translated into angular increments. This encoder is both rugged and precise, making it ideal for use on an autonomous go kart.
 +
 
 +
=== CUI Devices AMT222B-V Absolute Encoder ===
 +
 
 +
The encoder that was decided on is a CUI Devices AMT222B-V, which is a through-shaft radial single-turn capacitive rotary encoder. It offers 14-bit precision through a Serial Peripheral Interface (SPI) and its reference frequency updates every 100 μs or operates at 10,000 Hz. Since the steering column never goes through 360 degrees of rotation, only a single turn rotary encoder is necessary, and with 14-bit precision it can detect 16,384 positions.
 +
 
 +
=== Complications ===
 +
 
 +
Unfortunately, the through-shaft bore can only range from 2 to 8 mm, which is small for our application, so a parallel shaft will have to be mounted to rotate with the steering column at the correct gear ratio. Through-shaft encoders are available with bores that are much larger, however the prices of these encoders are much too high for RoboRacing’s budget; the AMT222B-V was chosen because it fits in our budget.
 +
 
 +
= Circuitry =
 +
[[File:Board.png|325px|thumb|right|'''Figure 3.''' The final PCB designed by the RoboJackets RoboRacing team that will drive the automated steering subsystem.]]
 +
 
 +
Since this is a custom build, many of the parts need custom circuitry in order to communicate with each other. All of the designing of the circuitry was completed in Autodesk Eagle and included custom part schematics designed by members of the electrical steering sub team. The schematic shows the different electrical components used and connections made on the steering PCB, including the various switches, connectors and the microprocessor.
 +
 
 +
=== Microprocessor ===
 +
 
 +
Driving the steering subsystem is an Arduino Leonardo ATmega32u4. This specific processor has the necessary data and interrupt pins as well as built-in USB communication for easier firmware programming. This processor was used in all testing for the parts and so it was easiest to just use it in the final design.
 +
 
 +
=== POE and Communication ===
 +
 
 +
Power and communication with Rigatoni’s central processor are done via ethernet. A WIZnet W5500 ethernet shield was outfitted to the steering board to achieve this. This specific chip provides the power-over-ethernet and can also handle SPI communication, which is necessary to communicate with the AMT222B-V encoder.
 +
 
 +
For current members: the board and schematic can be better viewed by cloning the Steering branch of the [https://github.com/RoboJackets/roboracing-electrical/tree/Steering RoboJackets RoboRacing GitHub repository] and viewing it in Eagle.
 +
 
 +
= Firmware =
 +
 
 +
The firmware driving the stepper motor was developed through testing the stepper motor. It is currently very simple, and only turns the motor one step at a time with an interrupt by pushing a button. The firmware for the encoder on the other hand was provided free on CUI’s website. It requires modification as right now it is very general (designed to run multiple ATM22 series encoders), but gave RoboRacing a great starting point for developing our own firmware.
 +
 
 +
=== Stepper Motor Firmware ===
 +
 
 +
<nowiki>// Notes:
 +
// Need to connect VDC GND and dir- to common GND
 +
// Need to have feedback connected to function
 +
// 15.3 (gear ratio) * 1600 = pulses per revolution
 +
 
 +
byte dirPin = 3;
 +
byte pulsePin = 6;
 +
byte interruptPin = 2;
 +
 
 +
void setup() {
 +
  Serial.begin(115200);
 +
  pinMode(dirPin, OUTPUT);
 +
  pinMode(pulsePin, OUTPUT);
 +
  pinMode(interruptPin, INPUT_PULLUP);
 +
  attachInterrupt(digitalPinToInterrupt(interruptPin), interrupt, FALLING);
 +
  digitalWrite(dirPin, LOW); // HIGH: clockwise, LOW: counter clockwise
 +
  delayMicroseconds(30);
 +
  for(int i=0; i<24480; i++)
 +
  {
 +
    delay(.01);
 +
    Serial.print("tick");
 +
    digitalWrite(pulsePin, HIGH);
 +
    delayMicroseconds(20);
 +
    digitalWrite(pulsePin, LOW);
 +
    delayMicroseconds(20);
 +
  }
 +
}
 +
 +
void loop() {
 +
 
 +
}
 +
 
 +
void interrupt(){
 +
  digitalWrite(pulsePin, HIGH);
 +
  delayMicroseconds(20);
 +
  digitalWrite(pulsePin, LOW);
 +
  delayMicroseconds(20);
 +
}</nowiki>
 +
 
 +
=== Encoder Firmware ===
 +
 
 +
The encoder firmware is quite long, so it better viewed on the RoboJackets RoboRacing GitHub&nbsp;[https://github.com/RoboJackets/roboracing-firmware/blob/evgp_steering/new_cari/encoder/encoder.ino here].
 +
 
 +
= Additional notes =
 +
 
 +
The RoboJackets RoboRacing electrical sub team has divided the tasks to building the electrical system for Rigatoni into four more sub teams: drive control, e-stop, radio control, and steering control. What is written in this Wiki only focused on the electrical steering control but other sub-sub team members are welcome to add articles similar to this one to fully document the design of the electrical system in Rigatoni. This Wiki is also welcome to be changed in the future with changes to Rigatoni’s electrical steering system.
 +
 
 +
= About the Author =
 +
 
 +
Kyle Carter is a 4th year computer engineering major at Georgia Tech set to graduate in the summer of 2020. He is a member of the RoboJackets RoboRacing electrical team, currently working on the autonomous evGrandPrix go kart, a.k.a. Rigatoni. When he first joined RoboRacing, there was little documentation on the designs for the previous robots and to fix that has decided to document his team’s work on the steering subsystem for Rigatoni in a Wiki article, providing other and new RoboRacing members with useful information while fulfilling a documentation requirement for ECE 3005 (Professional and Technical Communication).
 +
 
 +
[[Category: RoboRacing]]

Latest revision as of 00:31, 20 May 2020

This Wiki article is designed to give RoboRacing members insight into the design of the electrical steering subsystem for RoboRacing’s autonomous go kart Rigatoni. Rigatoni is a full-size Top Kart electric go cart that RoboRacing is modifying to become autonomous, and it will compete in the 2020 evGrandPrix competition. This article will provide readers with an overview of the main parts driving the automated steering system: the stepper motor that will physically turn the steering shaft, the encoder that will tell the central processor the current steering angle and the design of the PCB running the steering subsystem. It will also provide brief reasoning for why each part was picked.

Stepper Motor

Decision Process

Figure 1. An image of the Nema 23 closed-loop geared stepper motor and its gearbox.

In order to have an automated go kart, the go kart must be able to steer on its own, and to do that it must be able to move the steering column on its own. To achieve this, a secondary motor dedicated to driving the steering system must be installed. This motor must be able to rotate to precise angular positions and have enough torque to be able to turn the steering column, so a stepper motor was chosen instead of a servo. Although servos have built in potentiometers and are accurate, many do not have the torque required to maintain a steady position. A stepper motor does have the necessary torque but requires a driver to take the angular input and turn the motor to the correct position. Stepper motors are made up of a DC motor with multiple coils to drive it. These coils are powered in a specific sequence allowing the motor to turn in steps. They have much more torque than a regular DC motor at low speed and are good for precision at low RPM. Because they move in predictable steps, rotational speed control is easily achieved. Unfortunately, stepper motors do not have internal feedback for their position like servos do, so an external solution is required, such as an absolute rotary encoder.

Nema 23 Closed-loop Geared Stepper Motor

Shortly after deciding to use a stepper motor, the RoboRacing team leads spec’d and chose the Nema 23 Closed-loop Geared Stepper Motor. It features 1.25 N•m holding torque motor attached to a planetary gearbox with a 15.3 gear ratio with 30 N•m maximum permissible torque and 50 N•m of moment permissible torque. To run it, RoboRacing chose the Stepperonline CL57T Closed-loop Stepper Drive. Communication with the stepper motor is done via a 15 pin ethernet connector, and the drive communicates using jumper wires plugged into screw sockets. This stepper motor and drive in tandem with an appropriate absolute encoder will be able to accurately choose and hold a steering angle during a race.

Complications

RoboRacing has decided to keep the seat and steering wheel for the go kart so that it can still be driven manually. Although convenient, this decision requires a work around. The Nema 23 has very low gear ratios and thus a lot of torque, so a driver (person, not the stepper driver) cannot turn the steering wheel if the stepper motor is always mounted to the steering system. A clutch system is being planned to put in place to detach the stepper motor from the steering system when the kart is being driven manually.

Encoder

Decision Process

The other important part of an automated steering system is knowing the angular position of the steering column. The decision to keep the seat and steering wheel so that it can still be driven manually required the design to include an absolute rotary encoder rather than incremental encoder or limit switches. An absolute rotary encoder differs from an incremental encoder in that it can keep track of absolute angular position, even when powered off, whereas incremental encoders only report a change in position. Limit switches positioned at the limits of the steering angle were considered, however the steering would have to go through a zeroing sequence upon start-up, and the current angle would be held as a variable in software which does not account for physical shifts in the steering position that could be induced in a crash or other disturbance during a race.

Figure 2. An image of the CUI Devices AMT222B-V absolute rotary encoder with its various bore sockets.

An absolute rotary encoder allows for precise feedback to the software of the steering column’s real-time angle, rather than just assuming the angle within the software. It also allows the autonomous system to know precisely the angle of the steering column upon applying power. This way it does not matter the angle the steering column was left in when switching from manual to autonomous control.

The two most common types of encoders operate optically or magnetically. Optical encoders require photo-sensors and a led to read in differences in light to understand where the absolute angular position of the shaft that they are attached to. Although they are precise, they are susceptible to interference from inconsistent light and dirt, so they are not ideal for use on a racing go kart. Magnetic encoders use Hall effect sensors with magnets to read in angular position, and although they are rugged, they are not as precise as optical encoders and are susceptible to interference from other magnetic fields, which can be an issue if they are positioned near a stepper motor, which would be an issue as a stepper motor is being used in Rigatoni.

The steering sub team at RoboRacing opted to use a capacitive encoder, which reads modulations in a high frequency reference signal. This signal is modulated by a disk embedded with a sinusoid that rotates between a transmitter and a receiver, and the modulations are then translated into angular increments. This encoder is both rugged and precise, making it ideal for use on an autonomous go kart.

CUI Devices AMT222B-V Absolute Encoder

The encoder that was decided on is a CUI Devices AMT222B-V, which is a through-shaft radial single-turn capacitive rotary encoder. It offers 14-bit precision through a Serial Peripheral Interface (SPI) and its reference frequency updates every 100 μs or operates at 10,000 Hz. Since the steering column never goes through 360 degrees of rotation, only a single turn rotary encoder is necessary, and with 14-bit precision it can detect 16,384 positions.

Complications

Unfortunately, the through-shaft bore can only range from 2 to 8 mm, which is small for our application, so a parallel shaft will have to be mounted to rotate with the steering column at the correct gear ratio. Through-shaft encoders are available with bores that are much larger, however the prices of these encoders are much too high for RoboRacing’s budget; the AMT222B-V was chosen because it fits in our budget.

Circuitry

Figure 3. The final PCB designed by the RoboJackets RoboRacing team that will drive the automated steering subsystem.

Since this is a custom build, many of the parts need custom circuitry in order to communicate with each other. All of the designing of the circuitry was completed in Autodesk Eagle and included custom part schematics designed by members of the electrical steering sub team. The schematic shows the different electrical components used and connections made on the steering PCB, including the various switches, connectors and the microprocessor.

Microprocessor

Driving the steering subsystem is an Arduino Leonardo ATmega32u4. This specific processor has the necessary data and interrupt pins as well as built-in USB communication for easier firmware programming. This processor was used in all testing for the parts and so it was easiest to just use it in the final design.

POE and Communication

Power and communication with Rigatoni’s central processor are done via ethernet. A WIZnet W5500 ethernet shield was outfitted to the steering board to achieve this. This specific chip provides the power-over-ethernet and can also handle SPI communication, which is necessary to communicate with the AMT222B-V encoder.

For current members: the board and schematic can be better viewed by cloning the Steering branch of the RoboJackets RoboRacing GitHub repository and viewing it in Eagle.

Firmware

The firmware driving the stepper motor was developed through testing the stepper motor. It is currently very simple, and only turns the motor one step at a time with an interrupt by pushing a button. The firmware for the encoder on the other hand was provided free on CUI’s website. It requires modification as right now it is very general (designed to run multiple ATM22 series encoders), but gave RoboRacing a great starting point for developing our own firmware.

Stepper Motor Firmware

// Notes:
// Need to connect VDC GND and dir- to common GND
// Need to have feedback connected to function
// 15.3 (gear ratio) * 1600 = pulses per revolution

byte dirPin = 3;
byte pulsePin = 6;
byte interruptPin = 2;

void setup() {
  Serial.begin(115200);
  pinMode(dirPin, OUTPUT);
  pinMode(pulsePin, OUTPUT);
  pinMode(interruptPin, INPUT_PULLUP);
  attachInterrupt(digitalPinToInterrupt(interruptPin), interrupt, FALLING);
  digitalWrite(dirPin, LOW); // HIGH: clockwise, LOW: counter clockwise
  delayMicroseconds(30);
   for(int i=0; i<24480; i++)
  {
    delay(.01);
    Serial.print("tick");
    digitalWrite(pulsePin, HIGH);
    delayMicroseconds(20);
    digitalWrite(pulsePin, LOW);
    delayMicroseconds(20);
  }
}
 
void loop() {

}

void interrupt(){
  digitalWrite(pulsePin, HIGH);
  delayMicroseconds(20);
  digitalWrite(pulsePin, LOW);
  delayMicroseconds(20);
}

Encoder Firmware

The encoder firmware is quite long, so it better viewed on the RoboJackets RoboRacing GitHub here.

Additional notes

The RoboJackets RoboRacing electrical sub team has divided the tasks to building the electrical system for Rigatoni into four more sub teams: drive control, e-stop, radio control, and steering control. What is written in this Wiki only focused on the electrical steering control but other sub-sub team members are welcome to add articles similar to this one to fully document the design of the electrical system in Rigatoni. This Wiki is also welcome to be changed in the future with changes to Rigatoni’s electrical steering system.

About the Author

Kyle Carter is a 4th year computer engineering major at Georgia Tech set to graduate in the summer of 2020. He is a member of the RoboJackets RoboRacing electrical team, currently working on the autonomous evGrandPrix go kart, a.k.a. Rigatoni. When he first joined RoboRacing, there was little documentation on the designs for the previous robots and to fix that has decided to document his team’s work on the steering subsystem for Rigatoni in a Wiki article, providing other and new RoboRacing members with useful information while fulfilling a documentation requirement for ECE 3005 (Professional and Technical Communication).