internal model control for dc motor using dsp platform by: marcus fair advisor: dr. dempsey
Post on 21-Dec-2015
225 views
TRANSCRIPT
![Page 1: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/1.jpg)
Internal Model Control for
DC Motor Using DSP Platform
By: Marcus FairAdvisor: Dr. Dempsey
![Page 2: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/2.jpg)
Outline
Problem description
Objectives
Functional Specs Sub-system Overview
Software
Design
![Page 3: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/3.jpg)
Summary
Design, build, and test IMC (Internal Model Control) system to control a DC motor32-bit TMS320F2812 digital signal processor (DSP) Design for IMC controller built in Simulink Input to system uses graphical user interface (GUI) built in Matlab
![Page 4: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/4.jpg)
Preliminary Work
DC Motor block diagrams from Senior Mini-projectAlso based on DC Motor Speed Control DemoM-files to run softwareSpeed Measurement block in Simulink
![Page 5: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/5.jpg)
Common Problems in Control Systems
Load Changes-Load shaft
Plant Changes-Armature Resistor, Armature Inductor, Rotor Inertia, etc
Power Supply Changes
![Page 6: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/6.jpg)
Objectives
Build DSP/motor hardware interface Design and build (GUI)Design closed-loop controllersCompare conventional controller results with the IMC method
![Page 7: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/7.jpg)
Functional Requirements and Performance Specifications
Closed-loop operation: Determine optimum gains for controllers Rise time: 20 ms or lessSettling time: 100ms or lessOvershoot: < or = 5%Steady state error: + or – 5 RPM
![Page 8: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/8.jpg)
Equipment List
GM9236C534-R2 Pittman DC motorEzdsp F2812 BoardLMD18200 H-bridge3 - SN74LVC4245A voltage shifter6-Pin DIP Opto-isolator2N2222A BJT2 - DiodesAgilent 30V power supply and HP 5V power supplyTektronix Oscilloscope
![Page 9: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/9.jpg)
Overall Block Diagram
![Page 10: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/10.jpg)
Overall Block Diagram
![Page 11: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/11.jpg)
Dsp board technical specs
Generation TMS320F281x
CPU 1 C28x
Peak MMACS 150
Frequency(MHz) 150
RAM 36 KB
OTP ROM 2 KB
Flash 256 KB
EMIF 1 16-Bit
PWM 16-Ch
CAP/QEP 6/2
ADC 1 16-Ch 12-Bit
ADC Conversion Time 80 ns
McBSP 1
UART 2 SCI
SPI 1
CAN 1
Timers 3 32-Bit GP,1 WD
GPIO 56
Core Supply (Volts) 1.9 V
IO Supply (Volts) 3.3 V
![Page 12: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/12.jpg)
Inputs and Outputs
![Page 13: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/13.jpg)
H-bridgeDelivers up to 3A continuous output
Operates at supply voltages up to 55V
Low RDS(ON) typically 0.3W per switch
TTL and CMOS compatible inputs
No “shoot-through” current
Thermal warning flag output at 145°C
Thermal shutdown (outputs off) at 170°C
Internal clamp diodes
Shorted load protection
Internal charge pump with external bootstrap capability
Internal clamp diodes
Shorter load protection
Internal charge pump with external bootstrap capability
![Page 14: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/14.jpg)
Pittman DC Motor
Part # GM9236C534-R2
Gear ratio 5:9:1
No-load at 30V
834 RPM, current 100 ma
Part #Part # GM9236C534-R2GM9236C534-R2
Gear ratioGear ratio 5:9:15:9:1
No-load at 30VNo-load at 30V
834 RPM, current 100 ma
834 RPM, current 100 ma
Input Voltage 5V
Resolution 512 ppr (before gear reduction
Input VoltageInput Voltage 5V5V
ResolutionResolution 512 ppr (before gear reduction512 ppr (before gear reduction
Motor Specs
Encoder Specs
![Page 15: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/15.jpg)
Pittman Motor Block Diagram
kv
0.0582
kt
0.0582
To Workspace1
VelocityTo Workspace
t
Step Scope
ME Side
1
0.00000706 s+0.00000354
EE side
1
0.00424 s+3.91
Clock
![Page 16: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/16.jpg)
Root Locus of Plant
![Page 17: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/17.jpg)
Bode Plot for Plant
![Page 18: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/18.jpg)
Software
Matlab -Simulink
-main m-files-Gui m-files
Code Composer Studio 2.0
-Auto-code generation
-Communication with Dsp board
![Page 19: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/19.jpg)
Software flowchart
![Page 20: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/20.jpg)
Software flowchart
![Page 21: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/21.jpg)
Design Work
Matlab GUI
-Gui m-file
Controller Design Iterations-Proportional Controller
-Feed-forward Controller
-IMC controller
![Page 22: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/22.jpg)
GUI
![Page 23: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/23.jpg)
Proportional Controller
----------> DC MOTOR ------------>&
OPTICAL ENCODER
Speed Correction
Reference
FeedbackSetSpeed
Target Speed
MeasureSpeed
Speed in RPM
F2812 eZdsp
Build/Reload& Run
![Page 24: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/24.jpg)
Proportional Controller
Subsystem
Take Samples
Gain
90
Data TypeConversion
Convert
C28 x PWM
C281 x
PWM
W1
Feedback
2
Reference
1
![Page 25: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/25.jpg)
Other Block diagrams
Out 1
1
Terminator
Subsystem
Take Samples
Speed Measurement
theta
dir
freq
RPMSpeed
DMC
Shaft Encoder Resolution
43 .3
Generate Theta
In1
In2
Out1
Direction
1
Data TypeConversion
ConvertC28 xQEP1
C281 x
QEP
cnt
Target Speed
1
From RTDX
From RTDXmfichan 1
Data Type Conversion 1
doubleref
![Page 26: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/26.jpg)
Proportional Controller
Unknown
.0001
Transfer Fcn
1937362
s +922 s+1132962
To Workspace
simout
Step
Sampling
0.001
Rotary Encoder
81 .5
RPM conversion
29 .29
Quad Gain
4
Output
H-bridge
6
Gain
Gain
90
Feedback signal
ErrorCommand signal
Clock
![Page 27: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/27.jpg)
Proportional ControllerSimulink Results
![Page 28: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/28.jpg)
Proportional ControllerActual Results
![Page 29: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/29.jpg)
Proportional ControllerActual Results
![Page 30: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/30.jpg)
Feed-forward Controller
Why Feed-forward Controller?Faster response to command changes than single-loop controllersLess overshoot: More accurate than single-loop controllersBetter system for Dc Motor control
![Page 31: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/31.jpg)
Feed-forward Controller
----------> DC MOTOR ------------>&
OPTICAL ENCODER
Speed Correction
Feedforward
Reference
FeedbackSet
Speed
Target Speed
Measure Speed
Speed in RPMFeedforward
0.001149 z -0.0015 z+0.00043782
z +1.889 z+0.8922
F2812 eZdsp
Build/Reload& Run
![Page 32: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/32.jpg)
Feed-forward Equations
C/R = (Gc*Gp + Gp) / (1 + Gp)Desired C/R = 1.0So Gc = 1/Gp to get desired controllerGain K calculated based on DC gain of plant
![Page 33: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/33.jpg)
Feed-forward Controller
----------> DC MOTOR ------------>&
OPTICAL ENCODER
Speed Correction
Feedforward
Reference
FeedbackSet
Speed
Target Speed
Measure Speed
Speed in RPMFeedforward
0.001149 z -0.0015 z+0.00043782
z +1.889 z+0.8922
F2812 eZdsp
Build/Reload& Run
![Page 34: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/34.jpg)
Feed-forward Controller
Subsystem1
Take Samples
Gain
90
Data TypeConversion 1
Convert
C28x PWM
C281 x
PWM
W1
Feedback
3
Reference
2
Feedforward
1
![Page 35: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/35.jpg)
Feed-forward ControllerSimulink Results
![Page 36: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/36.jpg)
Feed-forward ControllerActual Results
![Page 37: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/37.jpg)
Feed-forward ControllerActual Results
![Page 38: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/38.jpg)
Internal Model Controller
IMC uses a plant model for disturbance rejectionMore ideal control systemFaster and more robust system
![Page 39: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/39.jpg)
Internal Model Controller
![Page 40: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/40.jpg)
IMC Equations
C/R = (Gc*Gp)/(1 + Gc*Gp - Gc*Gp’)Desired C/R = 1.0So Gc = 1/Gp’ = 1/Gp to get desired controllerGain K calculated based on DC gain of plant
![Page 41: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/41.jpg)
Internal Model Controller
----------> DC MOTOR ------------>&
OPTICAL ENCODER
Speed Correction
Reference
FeedbackIMC
SetSpeed
Target Speed
Measure Speed
Speed in RPM
IMC
0.3252 z +0.6504 z+0.32522
z -1.305 z+0.38092
F2812 eZdsp
Compensation Gain
57 .29124
Build/Reload& Run
![Page 42: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/42.jpg)
Internal Model Controller
IMC 1
Subsystem1
Take Samples
Gain
42 .3737
Data TypeConversion 1
Convert
Controller
0.07355 z -0.09597 z+0.028022
z +1.111z+0.30862
C28x PWM
C281 x
PWM
W1
Feedback
2
Reference
1
![Page 43: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/43.jpg)
Internal Model ControllerSimulink Results
![Page 44: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/44.jpg)
IMC ControllerActual Results
Hardware didn’t support algebraic loopsUnable to Run IMC from processor
![Page 45: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/45.jpg)
Conclusion
Overall Hardware fully functionalFunctional parts of GUI work correctly/ extra features never implementedAll Controllers work in SimulationOnly proportional and feed-forward run off hardware
![Page 46: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/46.jpg)
Questions?
![Page 47: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/47.jpg)
Feed-Forward Equations
C = Gp*(R*Gc + E)E = R - CC = Gc*Gp*R + Gp*R – C*GpC + C*Gp = Gc*Gp*R + Gp*RC = R*(Gc*Gp + GP) / (1 + GP)C/R = (Gc*Gp + Gp) / (1 + Gp)
![Page 48: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/48.jpg)
IMC EQUATIONS
C = E*Gc*GpE = R – (E*Gc*Gp – E*Gc*Gp’)E + E*Gc*Gp - E*Gc*Gp’ = R E = R / (1 + Gc*Gp - Gc*Gp’) C = (R*Gc*Gp) / (1 + Gc*Gp - Gc*Gp’) C/R = (Gc*Gp) / (1 + Gc*Gp - Gc*Gp’)
![Page 49: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/49.jpg)
Spring Semester Schedule
Week Goals
1-7 Build and test single-loop controller, Design Gui layout
8 Build and test feed-forward controller
9-10 Implement IMC with linear model
11 Final testing, final Gui design
12-13 Final documentation
![Page 50: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/50.jpg)
Pinout
![Page 51: Internal Model Control for DC Motor Using DSP Platform By: Marcus Fair Advisor: Dr. Dempsey](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649d625503460f94a44d5b/html5/thumbnails/51.jpg)
Pinout