Design of a Simulink-Based Control Workstation for Mobile Wheeled Vehicles with Variable-Velocity Differential Motor Drives Kevin Block, Timothy De Pasion, Benjamin Roos, Alexander Schmidt Gary Dempsey Bradley University Electrical and Computer Engineering Department March 1, 2016
Presentation Outline Background Benjamin Roos Timothy De Pasion Alexander Schmidt Kevin Block Conclusion 2
Overview What: Design and Implement Control Workstation with a Model-Based PID Controller that has Feed-Forward Compensation How: Combination Simulink and Experimental Platform Why: Future Control Algorithm Research, Development, and Testing at Bradley University 3
Objectives Simulink System Integration Complete Controller Development Complete Controller Code Written Experimental Platform Integration Complete Simulink GUI Complete System Integration in Progress System Testing in Progress 4
Division of Labor TABLE I. DIVISION OF LABOR Task Name Team Member Name Simulink Integration Timothy De Pasion Controller Development Benjamin Roos Controller Code Kevin Block Experimental Platform Integration Benjamin, Kevin, Timothy Simulink GUI Alexander, Timothy System Integration All Team Members System Testing Alexander, Benjamin, Timothy Fig. 1 Division of Labor 5
Overview Fig. 2 High Level Block Diagram 6
Experimental Platform Fig. 3 Experimental Platform Block Diagram 7
Simulink System Fig. 4 Simulink System Block Diagram 8
Overall Gantt Chart Fig. 5 Team Gantt Chart 9
Presentation Outline Background Benjamin Roos Timothy De Pasion Alexander Schmidt Kevin Block Conclusion 10
Presentation Outline Background Benjamin Roos Controller Development PI Feedback Controller Controller Specification Verification Current Source and Dynamic Model Matching Timothy De Pasion Alexander Schmidt Kevin Block Conclusion 11
Vehicle Plant Bode Diagram Fig. 6 Vehicle Plant Bode Diagram 12
Vehicle Plant Root Locus Fig. 7 Vehicle Plant Root Locus 13
Plant and Controller Root Locus Fig.8 Vehicle and Controller Root Locus with Zero at s = -19.5 rad/s 14
Controller and Plant Bode Diagram Fig. 9 Continuous Vehicle and Controller Bode with Controller Gain = 500 15
Discrete PI Controller Step Response Fig. 10 Complete Controller Response to Worst Case Conditions, Settling Time = 1 second 16
Presentation Outline Background Benjamin Roos Controller Development PI Feedback Controller Controller Specification Verification Current Source and Dynamic Model Matching Timothy De Pasion Alexander Schmidt Kevin Block Conclusion 17
Disturbance Rejection Specification The drive control system shall minimize the effect of external torque disturbances. Performance Specification: Shaft RPM change of less than or equal to 40% Test Measurements: Max Instantaneous Error of 35.75% at 20 RPM Spec has been met for the Simulink Model 18
Disturbance Rejection Specification Fig. 11 Disturbance Response Curves with Disturbance Change at 2 seconds 19
Step Tracking Specification The drive control system shall reduce vehicle tracking errors for step commands. Performance Specification: Average difference between input and output of less than or equal to 20% over 4 seconds Test Measurements: Max Error is about 14% at 400 RPM Spec has been met for the Simulink Model 20
Step Tracking Specification Fig. 12 Average Error of Step Responses 21
Ramp Tracking Specification The drive control system shall reduce vehicle tracking errors for ramp commands. Performance Specification: Average difference between input and output of less than or equal to 20% over 4 seconds Test Measurements: Max Error is about 35% at 400 RPM/s 22
Ramp Tracking Specification Fig. 13 Average Error for Ramp Responses 23
Ramp Tracking Specification Fig. 14 Ramp Response Curve with a Ramp Input = 400 RPM/s 24
Parabolic Tracking Specification The drive control system shall reduce vehicle tracking errors for parabolic commands. Performance Specification: Average difference between input and output of less than or equal to 40% over 4 seconds Test Measurements: Max Error is about 20% at 400 RPM/s^2 25
Parabolic Tracking Specification Fig. 15 Average Error for Parabolic Responses 26
Presentation Outline Background Benjamin Roos Controller Development PI Feedback Controller Controller Specification Verification Current Source and Dynamic Model Matching Timothy De Pasion Alexander Schmidt Kevin Block Conclusion 27
Current Source Torque Disturbance Matching Fig. 16 The Experimental Platform Disturbance Input should match that of the Simulink Model 28
Plant Inertia Differences Between Systems Simulink Vehicle and Motor Inertia: J = 5.28 10 3 kg m 2 Experimental Platform Motor and Generator Inertia: J = 6.12 10 6 kg m 2 Goal: Match Acceleration Based on T SIM J SIM = T EXP J EXP = a T = Net Torque J = Moment of Inertia a = rotational acceleration 29
Presentation Outline Background Benjamin Roos Timothy De Pasion Alexander Schmidt Kevin Block Conclusion 30
Presentation Outline Background Benjamin Roos Timothy De Pasion Simulink Integration Controller Development Feed Forward Terrain Creation GUI Creation Alexander Schmidt Kevin Block Conclusion 31
Simulink System Fig. 17 Simulink System Block Diagram 32
Simulink Integration Goal: Combine individual Simulink models into one overall model Problems: Timing Problems Model Redesign 33
Simulink Integration: Timing Problems Fig. 18 Simulation Time Improvement 34
Simulink Integration: Model Redesign Rotary Encoder Fig. 19 Rotary Encoder Simulink Model 35
Simulink Integration: Final Simulink Model Fig. 20 Final Simulink System 36
Presentation Outline Background Benjamin Roos Timothy De Pasion Simulink Integration Controller Development Feed Forward Terrain Creation GUI Creation Alexander Schmidt Kevin Block Conclusion 37
Controller Development Feed Forward Specifications 40% Overshoot 2 Second Settling Time Used a digital redesign method to create the transfer function 3250.3 1 0.9986 z 1 1 0.6667 + z 1 Eq. 38-1 Ts=0.001 seconds 38
Controller Development Feed Forward Simulink System Fig. 21 Simulink Controller 39
Feed Forward Controller Performance Fig. 22 Step Response with and without Feed Forward 40
Feed Forward Controller Performance Fig. 23 Zoomed in Step Response 41
Feed Forward Controller: Error Fig. 24 Error with and without Feed Forward 42
Presentation Outline Background Benjamin Roos Timothy De Pasion Simulink Integration Controller Development Feed Forward Terrain Creation GUI Creation Alexander Schmidt Kevin Block Conclusion 43
Terrain Creation Involved writing MATLAB scripts to test both the Simulink Model and the Experimental Platform Circle Test Straight line no elevation Straight Line with Elevation Worst Case Best Case Random Ramp 44
Presentation Outline Background Benjamin Roos Timothy De Pasion Simulink Integration Controller Development Feed Forward Experimental Platform Integration Terrain Creation GUI Creation Alexander Schmidt Kevin Block Conclusion 45
Overview Fig. 25 High Level Block Diagram 46
GUI Creation Stop Button Start Button Select or Create a Test Choose Surface Add a Payload Change Gravity Use an Ideal Vehicle Change Motor Parameters Best and Worse Case Simulink/Experimental Platform Selection 47
GUI Creation Fig. 26 GUI 48
GUI Creation: Start\Stop Button Fig. 27 Start\Stop GUI 49
GUI Creation: Create Test Fig. 28 Create Test in GUI 50
GUI Creation: Choose Surface Fig. 29 Choosing a Surface Fig. 30 Drop Down Menu 51
GUI Creation: Set Test Fig. 31 Setting a Test in the GUI 52
GUI Creation: Add a Payload, Change Gravity, Ideal Vehicle Fig. 32 Changing values in the GUI 53
GUI Creation: Change Motor Parameters Fig. 33 Changing Motor Parameters 54
GUI Creation: Choose Between Systems Fig. 34 Choose Between Systems in the GUI 55
Presentation Outline Background Benjamin Roos Timothy De Pasion Alexander Schmidt Kevin Block Conclusion 56
Presentation Outline Background Benjamin Roos Timothy De Pasion Alexander Schmidt Motor Thermals H-Bridge GUI Design Kevin Block Conclusion 57
Motor Thermals: 4 Sources of Heat Resistance in the windings Coulomb Friction Viscous Friction Dynamic Loads 58
Resistance in the Windings I 2 *R Losses Fig. 35 Top Level Resistance Power Loss Fig. 36 Bottom Level Resistance Power Loss 59
Viscous, Coulomb, and Dynamic Loads V*T Losses Fig. 37 Coulomb Friction Losses Fig. 38 Viscous Friction Losses Fig. 39 Dynamic Load Losses 60
Total Power Loss Fig. 40 Top Level Power Loss Simulink Block 61
No Load Values Fig. 41 No Load Thermal Measurement 62
Loaded Values Fig. 42 Loaded Thermal Measurement 63
Presentation Outline Background Benjamin Roos Timothy De Pasion Alexander Schmidt Motor Thermals H-Bridge GUI Design Kevin Block Conclusion 64
H-Bridge Build Fig. 43 Laboratory H-Bridge Setup 65
H-Bridge Build LMD1820 3A, 55V H-Bridge National Semiconductor, Dec. 1999. Fig. 44 H-Bridge Pinout 66
H-Bridge Thermals Total Power of H-Bridge P Total = P Q + P COND + P SW [EQ 67.1] P Q = Quiescent Power Dissipation P COND = Conductive Power Dissipation P SW = Switching Power Dissipation 67
Quiescent Power Dissipation P Q = I S * V CC [EQ 68.1] I S = Quiescent Current V CC = Supply Voltage 68
Conductive Power Dissipation P COND = 2 * I 2 RMS * R DS (ON) [EQ 69.1] I RMS = RMS Current R DS (ON) = On Resistance of the Power Switch 69
Switching Power Dissipation P SW = (E ON + E OFF ) * F [EQ 70.1] E ON = Turn On Energy E OFF = Turn Off Energy F = Switching Frequency 70
H-Bridge Total Power Using Equations 67.1 70.1 P Total = 0.6[W] + 2.7[W] + 0.3 [W] Maximum power dissipation of the H-Bridge without a heat sink is 3.0 Watts P Total = 3.6 Watts Heat Sink is Required! 71
Presentation Outline Background Benjamin Roos Timothy De Pasion Alexander Schmidt Motor Thermals H-Bridge GUI Design Kevin Block Conclusion 72
GUI Fig. 45 Motor Velocity GUI 73
GUI Fig. 46 Vehicle Position GUI 74
Presentation Outline Background Benjamin Roos Timothy De Pasion Alexander Schmidt Kevin Block Conclusion 75
Presentation Outline Background Benjamin Roos Timothy De Pasion Alexander Schmidt Kevin Block Rotary Encoder Resolution Controller Software Interrupt Timing Conclusion 76
Rotary Encoder Resolution Original Resolution: Approximately 20 pulses/ms Possible Methods on MCU: Multiple Timer/Counters External Interrupts 77
Rotary Encoder Resolution Original Resolution: Approximately 20 pulses/ms Possible Methods on MCU: Multiple Timer/Counters External Interrupts 78
Rotary Encoder Resolution Exclusive OR Gate Approximately 40 pulses/ms Cost: < $1 Hardware Quadrature Encoding Approximately 80 pulses/ms Cost: > $10 79
Presentation Outline Background Benjamin Roos Timothy De Pasion Alexander Schmidt Kevin Block Rotary Encoder Resolution Controller Software Interrupt Timing Conclusion 80
Controller Software Model Based PID Controller y n = 500 1.01 x n 0.9902 x n 1 + y(n 1) Feed-Forward Controller y n = 2170 x n 2167 x n 1 0.667 y(n 1) Anti-Windup Code 81
Controller Software 16 Motor Velocity with Disturbance = 0.137 [V] 14 Input (Red) and Output (Green) [Pulses/ms] 12 10 8 6 4 2 0 0 2 4 6 8 10 12 14 16 18 20 Time [s] Fig. 47 Experimental Platform Controller Test 82
Presentation Outline Background Benjamin Roos Timothy De Pasion Alexander Schmidt Kevin Block Rotary Encoder Resolution Controller Software Interrupt Timing Conclusion 83
Experimental Platform Fig. 48 Experimental Platform Block Diagram 84
Interrupt Timing Interrupt Designed For: Controller: 800 μs 200 μs Interrupt Period: 1 ms Fig. 49 Designed Interrupt Diagram 85
Interrupt Timing Interrupt with no I 2 C communication: Controller: 280 μs 720 μs Interrupt Period: 1 ms Fig. 50 Interrupt Diagram w/ I 2 C in Main Loop 86
Interrupt Timing Interrupt with two I 2 C commands: Controller: 620 μs 380 μs Interrupt Period: 1 ms Fig. 51 Interrupt Diagram w/ I 2 C in Interrupt 87
Interrupt Timing Interrupt with one I 2 C command: Controller: 300 μs 700 μs Interrupt Period: 1 ms Fig. 52 Interrupt Diagram w/ I 2 C Alternating I 2 C Hardware Execution Time: 300 μs I 2 C Software Execution Time: 20 μs 88
Interrupt Timing I 2 C Commands Figure: Fig. 53 Oscilloscope Image Grab of I 2 C Clock Line 89
Presentation Outline Background Benjamin Roos Timothy De Pasion Alexander Schmidt Kevin Block Conclusion 90
Conclusion Benjamin has completed: Anti Windup Controller Rate Limiting Controller Development Simulink and Experimental Platform Torque Matching in progress 91
Conclusion Timothy has completed: Simulink Integration Feed Forward Controller Terrain Creation GUI Creation 92
Conclusion Alexander has completed: Motor Thermals H-Bridge Heatsink GUI Creation 93
Conclusion Kevin has completed: Controller Code Model Based PID Controller Feed Forward Controller Anti Windup Code for Feedback Controller Doubled Resolution Interrupt Timing 94
Objectives Simulink System Integration Complete Controller Development Complete Controller Code Written Experimental Platform Integration Complete Simulink GUI Complete System Integration in Progress System Testing in Progress 95
Summary On schedule for project completion Final Step is Integration and Testing 96
Design of a Simulink-Based Control Workstation for Mobile Wheeled Vehicles with Variable-Velocity Differential Motor Drives Kevin Block, Timothy De Pasion, Benjamin Roos, Alexander Schmidt Gary Dempsey Bradley University Electrical and Computer Engineering Department March 1, 2016
Appendix Slides Benjamin Roos Timothy De Pasion Alex Schmidt 98
Vehicle Plant G P H s = 0.0001606 1.389 10 6 s 2 + 0.001315s + 0.001877 with poles at s = 1.43, 945.4 rad/s Eq. 101-1 Vehicle Plant and Encoder Gain Model in the Laplace Domain 99
Continuous Feedback Controller G c s = 19.5k s 19.5 + 1 s where k = 500 Eq. 102-1 Continuous Feedback Controller in the Laplace Domain 100
Discrete Feedback Controller G c z = k 1.01z 0.9902 z 1 where k = 500 Eq. 103-1 Discrete Feedback Controller Converted with the Tustin Method and Pre-warped at 63.8 rad/s 101
Step Tracking Specification Fig. 54 Step Response Curves 102
Parabolic Tracking Specification Fig. 55 Parabola Response Curve with a Parabola Input = 400 RPM/s^2 103
Appendix Slides Benjamin Roos Timothy De Pasion Alex Schmidt 104
Rotary Encoder Model: Conversion Fig. 56 Conversion Block for Rotary Encoder 105
Rotary Encoder Model: 1 ms reset Fig. 57 1 ms reset in Rotary Encoder 106
Rotary Encoder Model: Counter Fig. 58 Counter in Rotary Encoder 107
Rotary Encoder Model: Pulse Creation Fig. 59 Pulse Creation in Rotary Encoder 108
Rotary Encoder Model: Rounding Fig. 60 Rounding Block in Rotary Encoder 109
Appendix Slides Benjamin Roos Timothy De Pasion Alex Schmidt 110
GUI Display X-Y Vehicle Position Plot Motor Velocity Plot Current Plot Motor Acceleration Plot Vehicle Velocity Plot Vehicle Acceleration Plot Command Plot Error Signal Plot Feedback Signal Plot PWM Output Plot Feed-Forward Command Plot 111