1 / 15

Automatic Control

Automatic Control. Mike Robinson. You can measure the distance from the RC car to some target . What could your program do to keep the car as close to the target as possible?. Proportional control. Error = target position – current position kp = proportional gain Duty cycle = kp *error.

Download Presentation

Automatic Control

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Automatic Control Mike Robinson

  2. You can measure the distance from the RC car to some target. What could your program do to keep the car as close to the target as possible?

  3. Proportional control Error = target position – current position kp = proportional gain Duty cycle = kp*error

  4. Think back to your vibrations class. What does the proportional response look like? Why is this not surprising? What could we do to reduce the oscillations we see?

  5. Proportional control X m F

  6. Proportional + Derivative control error = target position – current position derivative = (error – past error)/change in time kp = proportional gain kd = derivative gain Duty cycle = kp*error + kd*derivative

  7. Why has adding derivative control made the car more jittery?

  8. D = Derivative, D = Danger!Beware of noise when you are taking a numerical derivative

  9. What would happen if we only had derivative control? Would the car still move to the target? Would the control do anything noticeable?

  10. What could we add to get rid of the errors in position at steady state?

  11. Proportional + Integral + Derivative control error = target position – current position derivative = (error – past error)/change in time integral = past error + error* change in time kp = proportional gain ki = integral gain kd = derivative gain Duty cycle = kp*error+ki*integral+kd*derivative

  12. What would happen if we only had integral control?

  13. A few words about commenting BAD GOOD //Code for lab 3 intinput = 0; //Declare variable input intinDist = 0; //Declare variable inDist /* This code reads an analog voltage from an ultrasonic sensor, converts the voltage to a distance in centimeters and prints the distance to the serial monitor Circuit: Connect +5 and ground to sensor Connect analog output from sensor to pin A0 Last edit: MDR 2/11/13 */ intultrasonicPin = 0; //Analog input pin for ultrasonic sensor intultrasonicDist = 0; //distance measurement in centimeters

  14. Preview of this weeks lab +5V Motor

  15. Motor inductance Preview of this weeks lab Motor resistance +5V

More Related