mae 106 final project “prancess” - wordpress.com...mae 106 final project “prancess” section...

25
MAE 106 Final Project “Prancess” Section 10 Group 7 Spring 2015 Team: Joshua Bae April Craven Ronnel Jamir Tyler Sunderman

Upload: others

Post on 13-Jul-2020

14 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: MAE 106 Final Project “Prancess” - WordPress.com...MAE 106 Final Project “Prancess” Section 10 Group 7 Spring 2015 Team:Joshua Bae April Craven Ronnel Jamir Tyler SundermanSystem

MAE 106 Final Project “Prancess” Section 10 Group 7

Spring 2015

Team: Joshua Bae

April Craven Ronnel Jamir Tyler Sunderman

Page 2: MAE 106 Final Project “Prancess” - WordPress.com...MAE 106 Final Project “Prancess” Section 10 Group 7 Spring 2015 Team:Joshua Bae April Craven Ronnel Jamir Tyler SundermanSystem

System Description

Design of the robot was focused on ease of fabrication and structural rigidity, which led to a large wood­ and MDF­based chassis strong enough to shoulder check another robot mid­competition. Much of the final design ended up being a result of emphasizing simplicity after fabrication of the original design seemed infeasible. Initial designs intended for the base to be skeletal in design, but continuous design revisions eventually favored simplicity and trended toward a heavier robot. Initial characteristics included a skeletal chassis, off­center driveline, modular piston assembly, and a crankshaft drive. The only surviving design element of the robot ended up being the steering armature, made of steel and resting on the chassis base. Final design revisions influenced the robot as much as controls did, lending the bot attributes similar to Bowser’s from Mario Kart.

An MDF base provided mounting points for the steering assembly, piston, and large plywood columns which supported a second base and the tire itself. These four columns were large chunks of 2x4, and extended the full height of the robot from base to wheel, giving it relatively even weight distribution. Electrical components were mounted on foam padding attached directly to these supports and eliminated any need for special electronics­safe mounting. The chassis was effectively a solid wood cage, with the wheel mounted on top of another large platform up top.

The driveline was converted to a kicker and no longer required a solid rear axle. The piston was hard mounted to a wood wedge and hinge, and fired at a fixed angle into the ground. A rubber stopper acted as the actual contact surface with the floor. A variable­angle assembly was dropped due to time and space constraints, as the steering motor ended up directly in front of the piston. The lack of an adjustable contact angle necessitated a more complex control scheme which optimized distance per stroke, which will be explained later in this report.

The steering armature was a steel rack and pinion assembly made of simple beams and brackets. These beams rode directly on top of the MDF base to help alleviate issues with load­induced sagging. It was designed with a fixed upper beam and a lower beam that could slide laterally, pushing the wheels in either direction when a lever was actuated by the motor. The base was simply cut out to allow a full range of movement. Initial designs placed too much load on the sliding member and induced sagging which rendered the steering inoperable. The next revision tightened dimensions but had issues with camber, which caused the robot to drift off­axis; after multiple revisions the system utilized bearings and flush mounting to eliminate these effects. This system had enough inertia to provide some resistance to the motor and assist the controls software in smoothing out the actual behavior of the mechanism itself.

Page 3: MAE 106 Final Project “Prancess” - WordPress.com...MAE 106 Final Project “Prancess” Section 10 Group 7 Spring 2015 Team:Joshua Bae April Craven Ronnel Jamir Tyler SundermanSystem

Controls focused on smooth steering motion and variable piston strength. The design constraint of internal space meant that the piston needed variable stroke timing to maximize the distance travelled. Rather than blink, two new parameters called ‘inInterval’ and ‘outInterval’ were created which set the duty cycle and period of the piston. Comparative sensing took the difference between the values of the two top­mounted sensors and then pushed this value through a PID controller to induce a proportional response that roughly located the beacon. The pace of the robot was set such that the controller had ample time to steer less aggressively, preventing any jagged movements which could suddenly throw the sensors off­target. Rather than steer directly for the beacon, the controls were intended to simply drift toward the beacon. In the competition, this code made minute adjustments and featured some sense of finesse. Combined with the weight of the chassis and even weight distribution, the robot’s control scheme was extremely stable and dealt with external disturbances very well. Even when faced off­target, the robot was capable of sharper turns toward the beacon from obtuse angles. Issues with a faulty encoder which was biased toward the left side necessitated that the controller’s derivative value be cranked relatively high on that side to maintain solid tracking.

The cumulative effect of the software and hardware design was a very heavy, well paced robot which simply brunted all impacts and external disturbances. This in turn affected the strategy we used during competition; a delayed start allowed our robot to simply push through the traffic until other bots were crowded under the beacon, at which point it just nudged its way into the fray and pushed others out. Prancess wasn’t exactly popular with competitors, but then again neither was Bowser.

Page 4: MAE 106 Final Project “Prancess” - WordPress.com...MAE 106 Final Project “Prancess” Section 10 Group 7 Spring 2015 Team:Joshua Bae April Craven Ronnel Jamir Tyler SundermanSystem

CAD Model

The breadboard is located underneath the top layer just like in the actual design.

Page 5: MAE 106 Final Project “Prancess” - WordPress.com...MAE 106 Final Project “Prancess” Section 10 Group 7 Spring 2015 Team:Joshua Bae April Craven Ronnel Jamir Tyler SundermanSystem

Electrical and Pneumatic Circuit Diagram

Page 6: MAE 106 Final Project “Prancess” - WordPress.com...MAE 106 Final Project “Prancess” Section 10 Group 7 Spring 2015 Team:Joshua Bae April Craven Ronnel Jamir Tyler SundermanSystem

Software Code // this is the MOTOR code frankensteined with the blinker //­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­ // If using interrupts, it only works with motor 2 (unless the motor driver is remapped). const int D2 = 4; // D2 pin, disables the motors if low const int M2DIR = 8; // Motor 2 direction const int M2PWM = 10; // Motor 2 input (PWM) const int M2EN = 12; // Motor 2 Diag const int M2FB = 15; // (Analog1 pin) Motor 2 current sense const float CPR = 1200.0; // Encoder/interrupt pins const int encoderApin = 2; const int encoderBpin = 3; // Encoder status volatile int encoderA; volatile int encoderB; // Time variables float currentMicros; float oldMicros; int loopCount; // Position variables const int origPos = 0; // Original position volatile long rawPos; // Actual position float desPos; float Pos; float oldPos; // Old position value // Velocity variables float Vel; float desVel; float printVel; long pauseDuration = 15000000; //This is in microseconds long stopTime = 58000000; //This is in microseconds.

Page 7: MAE 106 Final Project “Prancess” - WordPress.com...MAE 106 Final Project “Prancess” Section 10 Group 7 Spring 2015 Team:Joshua Bae April Craven Ronnel Jamir Tyler SundermanSystem

long breakTime = 38000000; long saturation = 118000; long lowSaturation = 500; long satTime = 30000000; int satCount = 0; // Controller variables double u[2]; float printu; //­­­­­­­­­BLINKER CODE­­­­­­­­ // constants won't change. Used here to // set pin numbers: const int pistonPin = 9; // the number of the piston pin // Variables will change: int pistonState = LOW; // pistonState used to set the piston long previousMillis = 0; // will store last time piston was updated // the follow variables is a long because the time, measured in miliseconds, // will quickly become a bigger number than can be stored in an int. long outInterval = 175; // interval at which to blink (milliseconds) long inInterval = 250; // interval at which to blink (milliseconds) long pistonTimer = 0; //­­­­­­SENSOR CODE­­­­­­­­ // pin values for readIRsesnor int IRgnd = 10; int IRpwr = 9; long lastSensor0 = 0; long lastSensor1 = 0; int loopcount = 0; // Add this code to your program to create the IRsensor class class IRsensor

Page 8: MAE 106 Final Project “Prancess” - WordPress.com...MAE 106 Final Project “Prancess” Section 10 Group 7 Spring 2015 Team:Joshua Bae April Craven Ronnel Jamir Tyler SundermanSystem

private: int pin; int prevIRstate; long pulseTime; long pulseDuration; long pulseDuration_buffer; long offTime; long offDuration; long filteredDuration; long prevFilteredDuration; public: IRsensor(); IRsensor(int pinNumber); void updateIRsensor(); long readIRsensor(); int IRstate; ; IRsensor sensor0; IRsensor sensor1; //­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­// //­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­ SETUP ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­// //­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­// void setup() // Enable motors pinMode(D2, OUTPUT); digitalWrite(D2, HIGH); // Enable motor direction pin pinMode(M2DIR, OUTPUT); // Enable current sense pinMode(M2FB, INPUT);

Page 9: MAE 106 Final Project “Prancess” - WordPress.com...MAE 106 Final Project “Prancess” Section 10 Group 7 Spring 2015 Team:Joshua Bae April Craven Ronnel Jamir Tyler SundermanSystem

// Enable encoder pinMode(encoderApin, INPUT); pinMode(encoderBpin, INPUT); // Read encoder status encoderA = digitalRead(encoderApin); encoderB = digitalRead(encoderBpin); // Attach interrupts attachInterrupt(0, encoderAchange, CHANGE); attachInterrupt(1, encoderBchange, CHANGE); currentMicros = (float)micros(); oldMicros = currentMicros; loopCount = 0; rawPos = origPos; // Set raw position Pos = getPosition(); // Set position oldPos = Pos; // Set old position Vel = 0.0; desVel = 0.0; printVel = 0.0; u[0] = 0.0; u[1] = 0.0; printu = 0.0; Serial.begin(115200); // Open serial port //­­­­­BLINKER­­­­ // set the digital pin as output: pinMode(pistonPin, OUTPUT); //­­­­­­SENSOR­­­­ // Add this code to initialize a sensor plugged into pin 4 sensor0 = IRsensor(A3); // this adds an IR sensor plugged into pin 4

Page 10: MAE 106 Final Project “Prancess” - WordPress.com...MAE 106 Final Project “Prancess” Section 10 Group 7 Spring 2015 Team:Joshua Bae April Craven Ronnel Jamir Tyler SundermanSystem

sensor1 = IRsensor(A4); // make sure the pins aren't used by the shield (https://www.pololu.com/picture/view/0J4009) // initialize serial communication at 9600 bits per second: // make the pushbutton's pin an input: pinMode(IRgnd,OUTPUT); pinMode(IRpwr,OUTPUT); digitalWrite(IRgnd,LOW); digitalWrite(IRpwr,HIGH); //­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­// //­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­ LOOP ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­// //­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­// void loop() currentMicros = (float)micros(); //Read the infrared sensor values for sensor0 and sensor1 sensor0.updateIRsensor(); sensor1.updateIRsensor(); // Compute Pos/Vel and desired Pos/Vel based upon the current time, and the sensor values desPos = desiredPosition(sensor0.readIRsensor(), sensor1.readIRsensor()); Pos = getPosition(); desVel = desiredVelocity(desPos, Pos, currentMicros, oldMicros); if (currentMicros != oldMicros)

// Get the velocity of the motor by implementing // the 'getVelocity()' function you defined in the pre­lab

Page 11: MAE 106 Final Project “Prancess” - WordPress.com...MAE 106 Final Project “Prancess” Section 10 Group 7 Spring 2015 Team:Joshua Bae April Craven Ronnel Jamir Tyler SundermanSystem

// ENTER getVelocity() FUNCTION HERE: Vel = 1000000.0*(Pos ­ oldPos)/(currentMicros ­ oldMicros);

// Use the controller (and filter if needed) u[0] = controller(Pos, Vel, desVel, desPos); u[0] = 0.5*u[0] + 0.5*u[1]; u[1] = u[0]; // Run the motor if(currentMicros > pauseDuration && currentMicros < stopTime)

runMotor(u[0]); //­­­­­­­­BLINKER­­­­­­­­ // check to see if it's time to blink the piston; that is, if the // difference between the current time and last time you blinked // the piston is bigger than the interval at which you want to // blink the piston. unsigned long currentMillis = millis(); if(currentMillis > pistonTimer)

// save the last time you blinked the piston

if(currentMicros > breakTime) outInterval = 600000; Serial.println("BREAK");

/*

if(currentMicros > satTime && ((sensor0.readIRsensor() < lowSaturation && lastSensor0 > saturation) || (sensor1.readIRsensor() < lowSaturation && lastSensor1 > saturation))) if(satCount++ > 100) outInterval = 600000; Serial.println("BREAK");

Page 12: MAE 106 Final Project “Prancess” - WordPress.com...MAE 106 Final Project “Prancess” Section 10 Group 7 Spring 2015 Team:Joshua Bae April Craven Ronnel Jamir Tyler SundermanSystem

*/

// if the piston is off turn it on and vice­versa: if (pistonState == LOW)

pistonState = HIGH; //turn on the piston pistonTimer = currentMillis + outInterval;

else

pistonState = LOW; pistonTimer = currentMillis + inInterval;

// set the piston with the pistonState of the variable: if(currentMicros > pauseDuration && currentMicros < stopTime)

digitalWrite(pistonPin, pistonState); //digitalWrite(pistonPin, LOW);

else digitalWrite(pistonPin, LOW);

// Update values oldPos = Pos; oldMicros = currentMicros; printVel += Vel; printu += (float)u[0]; lastSensor0 = sensor0.readIRsensor(); lastSensor1 = sensor1.readIRsensor(); //­­­­­­­­­­­­­­­SENSOR­­­­­­­­­­­ // update each IR sensor each iteration of the loop sensor0.updateIRsensor(); sensor1.updateIRsensor(); if (loopcount++ > 1000)

loopcount = 0;

Page 13: MAE 106 Final Project “Prancess” - WordPress.com...MAE 106 Final Project “Prancess” Section 10 Group 7 Spring 2015 Team:Joshua Bae April Craven Ronnel Jamir Tyler SundermanSystem

//digitalWrite(13,1­sensor0.IRstate); // just for kicks, make the piston blink to show the IR pin voltage Serial.print(millis()); Serial.print("\n"); Serial.print(100000*digitalRead(sensor0.IRstate)); // check out the voltage of the IR pin Serial.print("\t"); Serial.println(sensor0.readIRsensor()); // this is how you read (make sure you also update it as above)

Serial.print(100000*digitalRead(sensor1.IRstate)); // check out the voltage of the IR pin Serial.print("\t"); Serial.println(sensor1.readIRsensor()); // this is how you read (make sure you also update it as above)

Serial.print(desPos); Serial.print("\t");

Serial.print(Pos); Serial.print("\t"); Serial.print(u[0]);

Serial.print("\n"); Serial.print(desVel); Serial.print("\t");

Serial.print(Vel); Serial.print("\t"); Serial.print(u[0]);

Serial.print("\n"); Serial.print(pistonState);

// constuctor IRsensor::IRsensor() this­>IRstate = 0;

Page 14: MAE 106 Final Project “Prancess” - WordPress.com...MAE 106 Final Project “Prancess” Section 10 Group 7 Spring 2015 Team:Joshua Bae April Craven Ronnel Jamir Tyler SundermanSystem

this­>prevIRstate = 0; this­>pulseTime = 0; this­>pulseDuration = 0; this­>pulseDuration_buffer = 0; this­>offTime = 0; this­>offDuration = 0; this­>filteredDuration = 0; this­>prevFilteredDuration = 0; IRsensor::IRsensor(int pinNumber) this­>IRstate = 0; this­>prevIRstate = 0; this­>pulseTime = 0; this­>pulseDuration = 0; this­>pulseDuration_buffer = 0; this­>offTime = 0; this­>offDuration = 0; this­>filteredDuration = 0; this­>prevFilteredDuration = 0; this­>pin = pinNumber; pinMode(pin, INPUT); // functions void IRsensor::updateIRsensor() prevIRstate = IRstate; IRstate = digitalRead(pin); if (IRstate != prevIRstate)

if (IRstate == 0) offDuration = micros()­offTime; if (offDuration > 200000) pulseDuration = pulseDuration_buffer; pulseTime = micros();

else

offTime = micros(); pulseDuration_buffer = micros()­pulseTime;

Page 15: MAE 106 Final Project “Prancess” - WordPress.com...MAE 106 Final Project “Prancess” Section 10 Group 7 Spring 2015 Team:Joshua Bae April Craven Ronnel Jamir Tyler SundermanSystem

if (micros()­pulseTime > 620000)

pulseDuration = 0; prevFilteredDuration = filteredDuration; float filterStrength = 1; // set between 0 and 1 to apply a digital filter filteredDuration = filterStrength*(pulseDuration) + (1­filterStrength)*prevFilteredDuration; long IRsensor::readIRsensor() return filteredDuration; //­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­// //­­­­­­­­­­­­­­­­­­­­­­ ADDITIONAL FUNCTION DEFINITIONS ­­­­­­­­­­­­­­­­­­­­// //­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­// float desiredPosition(long sensor0, long sensor1) float sensorCoefficient = 125000.0; //This is a magic number that affects how sharply the robot turns, NEGATIVE IF BACKWARDS AF float straightThreshhold = ­1; //This is a threshhold for how similar the sensor values can be for running only straight // Desired velocity (must be in rad/sec) float angleCoefficient = PI/3; //This coefficient converts the position to radians float desPos = 0.0; float difference = (sensor0 ­ sensor1) / sensorCoefficient; // if(abs(difference) < straightThreshhold)

return desPos; desPos = difference * angleCoefficient;

Page 16: MAE 106 Final Project “Prancess” - WordPress.com...MAE 106 Final Project “Prancess” Section 10 Group 7 Spring 2015 Team:Joshua Bae April Craven Ronnel Jamir Tyler SundermanSystem

//desVel = 2*PI; //Uncomment this line for a desired velocity of 1Hz return desPos; float desiredVelocity(float Pos, float desPos, long currentMicros, long oldMicros) float velocityCoefficient = 1000000.0; //Conversion coefficient from microseconds to seconds, so the velocity is in radians/seconds return ­velocityCoefficient * (desPos ­ Pos) / (currentMicros ­ oldMicros); double controller(float Pos, float Vel, float desPos, float desVel) //PD controller for position. double errorVel = 0.0; double errorPos = 0.0; double Kp = 0.0; double Kd = 0.0; double u = 0.0; // 1. Define the error errorVel = (double)(desVel ­ Vel); errorPos = (double)(desPos ­ Pos); // 2. Define the proportional gain of the controller //Kp = 700; Kp = 0.3; // 3. Define the derivative gain of the controller //Kd = 13; Kd = ­0.001; // 4. Define the control law u = Kp*(errorPos)+Kd*(errorVel); double negativeCompensation = 4; if(u < 0) u *= negativeCompensation;

Page 17: MAE 106 Final Project “Prancess” - WordPress.com...MAE 106 Final Project “Prancess” Section 10 Group 7 Spring 2015 Team:Joshua Bae April Craven Ronnel Jamir Tyler SundermanSystem

return u; float getPosition() return 2.0*PI*((float)rawPos)/CPR; // ************************************* /* float getVelocity(float currentMicros, float oldMicros, float Pos, float oldPos) //float currentMicros = 0; return 0; */ // ************************************* /* void encoderAchange() // Apply encoder logic to update position if ((encoderB == LOW) && (encoderA == LOW)) rawPos++; else if ((encoderB == LOW) && (encoderA == HIGH)) rawPos­­; else if ((encoderB == HIGH) && (encoderA == LOW)) rawPos­­; else if ((encoderB == HIGH) && (encoderA == HIGH)) rawPos++; encoderA = !encoderA; // Save the updated encoderA value! void encoderBchange() // Apply encoder logic to update position if ((encoderA == LOW) && (encoderB == LOW)) rawPos­­; else if ((encoderA == LOW) && (encoderB == HIGH)) rawPos++; else if ((encoderA == HIGH) && (encoderB == LOW)) rawPos++; else if ((encoderA == HIGH) && (encoderB == HIGH)) rawPos­­;

Page 18: MAE 106 Final Project “Prancess” - WordPress.com...MAE 106 Final Project “Prancess” Section 10 Group 7 Spring 2015 Team:Joshua Bae April Craven Ronnel Jamir Tyler SundermanSystem

encoderB = !encoderB; // Save the updated encoderB value! */ void encoderAchange() // Runs if there is a change in the A line of the endcoder // Apply encoder logic based on quadrature encoding to update position encoderA = !digitalRead(encoderApin); encoderB = digitalRead(encoderBpin); if ((encoderB == LOW) && (encoderA == LOW)) rawPos++; else if ((encoderB == LOW) && (encoderA == HIGH)) rawPos­­; else if ((encoderB == HIGH) && (encoderA == LOW)) rawPos­­; else if ((encoderB == HIGH) && (encoderA == HIGH)) rawPos++; encoderA = !encoderA; // Save the updated encoderA value! void encoderBchange() // Runs if there is a change in the B line of the encoder // Apply encoder logic based on quadrature encoding to update position encoderA = digitalRead(encoderApin); encoderB = !digitalRead(encoderBpin); if ((encoderA == LOW) && (encoderB == LOW)) rawPos­­; else if ((encoderA == LOW) && (encoderB == HIGH)) rawPos++; else if ((encoderA == HIGH) && (encoderB == LOW)) rawPos++; else if ((encoderA == HIGH) && (encoderB == HIGH)) rawPos­­; encoderB = !encoderB; // Save the updated encoderB value! void runMotor(double u) boolean forward = (u > 0.0); if (forward) digitalWrite(M2DIR, LOW);

Page 19: MAE 106 Final Project “Prancess” - WordPress.com...MAE 106 Final Project “Prancess” Section 10 Group 7 Spring 2015 Team:Joshua Bae April Craven Ronnel Jamir Tyler SundermanSystem

if (u > 255.0) analogWrite(M2PWM, 255); else analogWrite(M2PWM, (int)u);

else digitalWrite(M2DIR, HIGH);

if (u < ­255.0) analogWrite(M2PWM, 255); else analogWrite(M2PWM, ­(int)u);

/* float getVelocity(float currentMicros, float oldMicros, float Pos, float oldPos) float temp = (Pos ­ oldPos) / (currentMicros ­ oldMicros) * 1000000.0; return temp; */ //­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­

Page 20: MAE 106 Final Project “Prancess” - WordPress.com...MAE 106 Final Project “Prancess” Section 10 Group 7 Spring 2015 Team:Joshua Bae April Craven Ronnel Jamir Tyler SundermanSystem

Experimental Testing

An experimental test we conducted was observing how the distance traveled by our robot changes with respect to different frequencies of the actuating piston. As explained under the system descriptions, the robots final design for propulsion was hard mounting the piston to the chassis at an angle to the ground in which the piston will extend and retract at different frequencies to propel the robot forward. Within our control code we were able to modify the stroke frequency in two different ways ­ change the frequency at which the the piston extends (outInterval=_ms) and change the frequency at which the piston retracts (inInterval=_ms). The independent variables of the experiment are the extend and retract frequencies, the dependant variable is the distance traveled and the fixed variables are the following: tire pressure to supply the piston is 40 psi per trial, 10 seconds of actuating time and fixed angle at which the piston hits the ground.

In our first trial we set the outInterval to 100 ms and varied the inInterval from 100 to 300 ms in 25 ms increments and recorded the distance the robot traveled in 10 seconds. Here we found the robot traveled the farthest at inInterval = 250 ms.

Page 21: MAE 106 Final Project “Prancess” - WordPress.com...MAE 106 Final Project “Prancess” Section 10 Group 7 Spring 2015 Team:Joshua Bae April Craven Ronnel Jamir Tyler SundermanSystem

In our second trial, we set inInterval to 250 ms, the value we found in the first trial, and varied outInterval from 50 to 200 ms to find the value that would provide the greatest distance traveled by the robot. The robot traveled the farthest at outInterval = 175 ms. Based on these trials, inInterval was set to 250ms and outInterval was set to 175ms to maximize the distance that the robot could travel during competition.

A proportional derivative controller was used to drive the dc motor in our steering

system. The proportional gain ( ) controls how fast the system responds and theKP derivative gain ( ) controls the oscillations of the system. Ideally, the system wouldKd model that of a critically damped system so it moves to the desired position as quickly as possible without oscillating.

In order to find the Kp value, Kd was set to zero and Kp was increased until the system oscillated with a rise time of 0.038 seconds.

Page 22: MAE 106 Final Project “Prancess” - WordPress.com...MAE 106 Final Project “Prancess” Section 10 Group 7 Spring 2015 Team:Joshua Bae April Craven Ronnel Jamir Tyler SundermanSystem

Here we found that with Kp set to 700, the system oscillated with a rise time of

0.0384 seconds. Now a damping is added to the system, Kd, to control the oscillations. With Kp set to 700, Kd was added until the system was critically damped.

With the Kd value set to 13, the system now behaved as a critically damped system. With a higher Kd value, the system behaved as an overdamped system and was not optimal. In order to have a fast, stable system that did not oscillate, Kp was set to 700 and Kd was set to 13.

Page 23: MAE 106 Final Project “Prancess” - WordPress.com...MAE 106 Final Project “Prancess” Section 10 Group 7 Spring 2015 Team:Joshua Bae April Craven Ronnel Jamir Tyler SundermanSystem
Page 24: MAE 106 Final Project “Prancess” - WordPress.com...MAE 106 Final Project “Prancess” Section 10 Group 7 Spring 2015 Team:Joshua Bae April Craven Ronnel Jamir Tyler SundermanSystem

Mathematical Model The settling time of an amplifier or other output device is the time elapsed from the application of an ideal instantaneous step input to the time at which the amplifier output has entered and remained within a specified error band. Settling time includes a very brief propagation delay, plus the time required for the output to slew to the vicinity of the final value, recover from the overload condition associated with slew, and finally settle to within the specified error.

tolerance fraction = 2% = 0.02

wn =√ km =√ J

KpJ = moment of inertia

ζ = c

2√km = Kd2√J×Kp

T s = −ln(0.02)

×(√ JKp) ( Kd

2√J×Kp)= Kd

−2∙J ∙ln(0.02)

Theoretical Actual

Kd Ts Kd Ts

1 7.824*J 1 7.451*J

13 0.602*J 13 0.597*J

20 0.391*J 20 0.389*J Group Contributions

Page 25: MAE 106 Final Project “Prancess” - WordPress.com...MAE 106 Final Project “Prancess” Section 10 Group 7 Spring 2015 Team:Joshua Bae April Craven Ronnel Jamir Tyler SundermanSystem

Joshua Bae

CAD ­ designed a 3D model of the robot and updated the model as the design evolved.

Fabrication Assist ­ assisted with the assembly of the robot, finding parts necessary for the robot, and testing the robot in preparation for the competition.

April Craven

Electrical ­ designed final electrical circuitry, installed all components, soldered all connections, secured wiring, and designed the ir sensor mounts.

Fabrication Assist ­ assisted with final assembly of the robot and troubleshoot of the steering system. Implemented fixes for the four bar steering linkage.

Ronnel Jamir

Mechanical Fabrication: in charge of the physical fabrication design of the robot; finding parts, drilling holes, cutting wood and assembling the robot to make sure that the robot was able to coast and have a working steering system; made changes to the robot for optimization

Design: Assisted in coming up with the original design and in redesigning the whole robot once actual mechanical fabrication was being made

CAD Assist: assisted in creating the 3D design into solidworks: Lab Report: Worked with the team in creating and conducting the experimental

testing and writing a portion of the lab report Tyler Sunderman

Sofrware and hardware design Programming Initial mechanical design ­ created overall structure and direction of design Design revisions ­ worked with fabrication to draft and finalize all design revisions