dspace ds1103 control workstation tutorial and dc motor speed control by: annemarie thomas advisor:...
TRANSCRIPT
dSPACE DS1103 dSPACE DS1103 Control Workstation Control Workstation
Tutorial Tutorial and and
DC Motor Speed DC Motor Speed Control Control
By: Annemarie ThomasBy: Annemarie Thomas
Advisor: Dr. Winfred AnakwaAdvisor: Dr. Winfred Anakwa
May 5, 2009 May 5, 2009
OutlineOutline
GoalsGoals Project Description/RequirementsProject Description/Requirements
Block Diagram, Functional Description, Block Diagram, Functional Description, RequirementsRequirements
EquipmentEquipment ImplementationImplementation Progress SummaryProgress Summary ReferencesReferences
GoalsGoals
Decrease the learning curve for the use of Decrease the learning curve for the use of the dSPACE DS1103 Workstation by the dSPACE DS1103 Workstation by future students by:future students by:
Writing a Tutorial for use of the new Writing a Tutorial for use of the new DS1103 Workstation.DS1103 Workstation.
Designing a controller to control the Designing a controller to control the speed of a DC motor.speed of a DC motor.
Implementing the controller design using Implementing the controller design using the DS1103 Workstation. the DS1103 Workstation.
Suggested DS1103 UsesSuggested DS1103 Uses
Motor ControlMotor Control RoboticsRobotics AutomotiveAutomotive Magnetic Suspension SystemsMagnetic Suspension Systems
Project DescriptionProject Description
Block DiagramBlock Diagram
DS1103
Motor System
ControlDesk(Desired Speed
Input)
Load Applied to Motor Shaft
By Brake
Optical Encoder
CLP1103 Connector
Panel
Description/Description/Requirements IRequirements I
ControlDesk software:ControlDesk software: Installed on PC.Installed on PC. Downloading, Monitoring, Changing Downloading, Monitoring, Changing
(Speed) Inputs.(Speed) Inputs. Controller:Controller:
OneOne or more designs. or more designs. Simulink and RTI blocks.Simulink and RTI blocks. PWM Output.PWM Output. Optical Encoder Input.Optical Encoder Input.
Description/Description/Requirements IIRequirements II
Motor System:Motor System: PWM Signal sent through Control Panel PWM Signal sent through Control Panel
and Additional Hardware before entering and Additional Hardware before entering motor.motor.
Optical Encoder:Optical Encoder: Optical Encoder Input directly to Optical Encoder Input directly to
Incremental Encoder Input of Control Incremental Encoder Input of Control Panel.Panel.
CLP1103 LED/Connector Panel:CLP1103 LED/Connector Panel: Connect Inputs/Outputs between DS1103 Connect Inputs/Outputs between DS1103
Board and Hardware.Board and Hardware.
Controller RequirementsController Requirements
DC motor speed controller DC motor speed controller designed/simulated using designed/simulated using Simulink and Simulink and dSPACE blocksets, Matlab-to-DSP dSPACE blocksets, Matlab-to-DSP interface libraries, the Real-Time interface libraries, the Real-Time Interface to Simulink, and Real-Time Interface to Simulink, and Real-Time Workshop.Workshop.
OvershootOvershoot less than or equal to less than or equal to 5%.5%. Rise timeRise time less than or equal to less than or equal to 110 ms. 110 ms. Minimize Steady-state Error.Minimize Steady-state Error.
Equipment: WorkstationEquipment: Workstation $14,000 dSPACE DS1103 system $14,000 dSPACE DS1103 system
consisting of:consisting of: DS1103 Board.DS1103 Board. Expansion Box.Expansion Box. CLP1103 PPC Connector and LED Panel.CLP1103 PPC Connector and LED Panel. ControlDesk Version 3.2.2/Other dSPACE ControlDesk Version 3.2.2/Other dSPACE
provided Software Applications. provided Software Applications. PC dedicated to the workstation PC dedicated to the workstation
containing other software applications containing other software applications required (Matlab/Simulink Version required (Matlab/Simulink Version R2008a and libraries). R2008a and libraries).
DS1103 WorkstationDS1103 Workstation
Equipment: OtherEquipment: Other Pittman GM9236C534-R2 Pittman GM9236C534-R2
DC Motor.DC Motor. Magtrol HB-420 Brake.Magtrol HB-420 Brake. TIP120 Transistor.TIP120 Transistor. IN4004 Diode.IN4004 Diode. SN7407 Hex Inverters.SN7407 Hex Inverters. Other electronic Other electronic
components, power supplies, components, power supplies, and measurement devices.and measurement devices.
ImplementationImplementation
DS1103
Motor System
ControlDesk(Desired Speed
Input)
Load Applied to Motor Shaft
By Brake
Optical Encoder
CLP1103 Connector
Panel
Block DiagramBlock Diagram
ControlDeControlDesksk
Simulink ModelSimulink Model
Connector PanelConnector Panel
DS1103
Motor System
ControlDesk(Desired Speed
Input)
Load Applied to Motor Shaft
By Brake
Optical Encoder
CLP1103 Connector
Panel
PWM Output to MotorPWM Output to Motor Incremental Encoder InputIncremental Encoder Input
PWM Output IPWM Output I
pulses_ms_to_Hz
1000
Terminator 1
Terminator
RTI Data
RPM_to_Hz
50 .2996
RPM _in
0
Kz
.010417
K
5871 .7
Hz_to_pulses_ms
.001
Hz_to_RPM
.019881
Hz_DutyCycle
.00003
Ground
Gc
z +1.932751 z+0.9327512
z -1.39989 z+0.3998942
DS1103SL _DSP_PWM
PWM Channel 1
PWM Channel 2
PWM Channel 3
PWM Channel 4
DS1103 ENC_SETUP
ENCODERMASTER SETUP
DS1103 ENC_POS_C1
Enc position
Enc delta position
0_to_1
DutyCycle
pulses_ms_out
RPM_in pulses_ms_inHz
Hz RPM_out
Kz_out TF_outGain_outSum Duty
PWM Output
PWM Output IIPWM Output II
To MotorSystem(PWM Ch. 1)
Incremental Encoder Incremental Encoder Input IInput I
pulses_ms_to_Hz
1000
Terminator 1
Terminator
RTI Data
RPM_to_Hz
50 .2996
RPM _in
0
Kz
.010417
K
5871 .7
Hz_to_pulses_ms
.001
Hz_to_RPM
.019881
Hz_DutyCycle
.00003
Ground
Gc
z +1.932751 z+0.9327512
z -1.39989 z+0.3998942
DS1103SL_DSP_PWM
PWM Channel 1
PWM Channel 2
PWM Channel 3
PWM Channel 4
DS1103 ENC_SETUP
ENCODERMASTER SETUP
DS1103 ENC_POS_C1
Enc position
Enc delta position
0_to_1
DutyCycle
pulses_ms_out
RPM_in pulses_ms_inHz
Hz RPM_out
Kz_out TF_outGain_outSum Duty
Encoder Input
Incremental Encoder Incremental Encoder Input IIInput II
From Encoder
Motor System & BrakeMotor System & Brake
DS1103
Motor System
ControlDesk(Desired Speed
Input)
Load Applied to Motor Shaft
By Brake
Optical Encoder
CLP1103 Connector
Panel
Motor SystemMotor System
Hex Inverters (Buffer), NPN Darlington Transistor, and DiodeHex Inverters (Buffer), NPN Darlington Transistor, and Diode
-
+
Unit Step (238.57 RPM) Unit Step (238.57 RPM) InputInput
Ch 3: Motor CurrentCh 3: Motor Current Ch 4: Diode CurrentCh 4: Diode Current
Ch 1: Supply VoltageCh 1: Supply Voltage Ch 2: Voltage at Ch 2: Voltage at
CollectorCollector MATH: Motor VoltageMATH: Motor Voltage
Ch 1: PWMCh 1: PWM Ch 2: EncoderCh 2: Encoder
Motor ModelMotor Model
See “Current Motor Model” reference on Reference II slide.See “Current Motor Model” reference on Reference II slide.
Simulink Model
Transfer Function (Torque components Transfer Function (Torque components ignored):ignored):
178.1776
154.14
4699.19
78.177654.14
502852ssss
Motor Model ResponseMotor Model Response
Phase Margin = Phase Margin = 84°.84°.
ωωcc = 279 rad/s = 279 rad/s
-100
-50
0
50
Mag
nitu
de (
dB)
10-1
100
101
102
103
104
105
-180
-135
-90
-45
0
Pha
se (
deg)
Bode DiagramGm = Inf dB (at Inf rad/sec) , Pm = 84 deg (at 279 rad/sec)
Frequency (rad/sec)
ωc
BrakeBrake
Systems Stops at approximately:Systems Stops at approximately: 0.375 Nm -OR- 50 OzIn0.375 Nm -OR- 50 OzIn
Speed Input/Output ISpeed Input/Output I
DS1103
Motor System
ControlDesk(Desired Speed
Input)
Load Applied to Motor Shaft
By Brake
Optical Encoder
CLP1103 Connector
Panel
Speed Input/Output IISpeed Input/Output II
pulses_ms_to_Hz
1000
Terminator 1
Terminator
RTI Data
RPM_to_Hz
50 .2996
RPM _in
0
Kz
.010417
K
5871 .7
Hz_to_pulses_ms
.001
Hz_to_RPM
.019881
Hz_DutyCycle
.00003
Ground
Gc
z +1.932751 z+0.9327512
z -1.39989 z+0.3998942
DS1103SL_DSP_PWM
PWM Channel 1
PWM Channel 2
PWM Channel 3
PWM Channel 4
DS1103 ENC_SETUP
ENCODERMASTER SETUP
DS1103 ENC_POS_C1
Enc position
Enc delta position
0_to_1
DutyCycle
pulses_ms_out
RPM_in pulses_ms_inHz
Hz RPM_out
Kz_out TF_outGain_outSum Duty
pulses_ms_to_Hz
1000
Terminator 1
Terminator
RTI Data
RPM_to_Hz
50 .2996
RPM _in
0
Kz
.010417
K
5871 .7
Hz_to_pulses_ms
.001
Hz_to_RPM
.019881
Hz_DutyCycle
.00003
Ground
Gc
z +1.932751 z+0.9327512
z -1.39989 z+0.3998942
DS1103SL_DSP_PWM
PWM Channel 1
PWM Channel 2
PWM Channel 3
PWM Channel 4
DS1103 ENC_SETUP
ENCODERMASTER SETUP
DS1103 ENC_POS_C1
Enc position
Enc delta position
0_to_1
DutyCycle
pulses_ms_out
RPM_in pulses_ms_inHz
Hz RPM_out
Kz_out TF_outGain_outSum Duty
Controller IController I
DS1103
Motor System
ControlDesk(Desired Speed
Input)
Load Applied to Motor Shaft
By Brake
Optical Encoder
CLP1103 Connector
Panel
Controller IIController II
Controller IIIController III
Controller VController V
OvershootOvershoot less than or equal to less than or equal to 5%. 5%.
Rise timeRise time less than or equal to less than or equal to 110 110 ms. ms.
Minimize Steady-state error.Minimize Steady-state error.
Controller VIController VI Analog Controller designed and pre-warping and bilinear Analog Controller designed and pre-warping and bilinear
methods used to convert to a Digital Controller.methods used to convert to a Digital Controller. 12kHz Sampling Frequency12kHz Sampling Frequency
931.1
9976.01)482282.0(0631.72
6.857
8.28
)000040278.0(
)482282.0(0631.72
zz
zz
ss
s
931.0931.1
9976.00024.0)482282(.0631.72
2
2
zz
zz
Additional Gain adjustments have been made in MATLAB calculations and Simulink Models.
-150
-100
-50
0
50
Mag
nitu
de (
dB)
100
101
102
103
104
105
-270
-225
-180
-135
-90
Pha
se (
deg)
Bode DiagramGm = 24.2 dB (at 1.22e+003 rad/sec) , Pm = 69.5 deg (at 157 rad/sec)
Frequency (rad/sec)
MATLAB: MATLAB: Motor Model and Motor Model and
ControllerController Actual:Actual:
Phase Margin = 69.5º.Phase Margin = 69.5º. ωωcc = 157 rad/s. = 157 rad/s.
Designed for:Designed for: Phase Margin = Phase Margin =
69.01º.69.01º.
(5 % O.S.)(5 % O.S.) ωωcc = 157.08 rad/s. = 157.08 rad/s.
(20 ms Rise Time)(20 ms Rise Time)ωc
MATLAB: Step ResponseMATLAB: Step Response
Overshoot = 6%Overshoot = 6% Rise Time = 8.33 msRise Time = 8.33 ms
0 200 400 600 800 1000 1200 1400 1600 1800 20000
0.2
0.4
0.6
0.8
1
1.2
1.4
System: sysTime (sec): 165Amplitude: 1
System: sysTime (sec): 249Amplitude: 1.06
System: sysTime (sec): 125Amplitude: 0.901
System: sysTime (sec): 25Amplitude: 0.104
Step Response
Samples (sec)
Am
plitu
de
Simulink: Model ISimulink: Model I
MATLAB controller with added Gain of 7 BlockMATLAB controller with added Gain of 7 Block
Simulink: Model IISimulink: Model II
Simulink: Step ResponseSimulink: Step Response
238.57 RPM = 1 pulse_in238.57 RPM = 1 pulse_in Overshoot = 5%Overshoot = 5% Rise Time = 110 msRise Time = 110 ms
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10
0.2
0.4
0.6
0.8
1
1.2
1.4
X: 0.2237Y: 1.05X: 0.1608
Y: 1.001
X: 0.1242Y: 0.9009
X: 0.01342Y: 0.1003
System Response ISystem Response I
Actual System: ControlDeskActual System: ControlDesk
(Possible Time Delay, Rise (Possible Time Delay, Rise Time < 108 ms)Time < 108 ms)
Simulink SimulationSimulink Simulation
(200 RPM Input, 2.14 second Step Time)(200 RPM Input, 2.14 second Step Time)
0 0.5 1 1.5 2 2.5 3 3.5 40
50
100
150
200
250
0 0.5 1 1.5 2 2.5 3 3.5 40
50
100
150
200
250
X: 2.141Y: 0
X: 2.422Y: 0
X: 3.424Y: 178.9
X: 3.636Y: 238.6
X: 2.53Y: 200
System Response IISystem Response II
Simulink/Actual SystemSimulink/Actual System
(RPM Output Only, Rise Time (RPM Output Only, Rise Time appears similar)appears similar)
Actual: Frequency-to-Voltage Converter Actual: Frequency-to-Voltage Converter
(No Visible Overshoot)(No Visible Overshoot)
0 0.5 1 1.5 2 2.5 3 3.5 40
50
100
150
200
250
Project Status: TimelineProject Status: TimelineWeek Goal Task Completed
11 January 27 Write tutorial introduction January 22
22 February 3 Verify motor parameters Not Complete
33 February 10
Simulate motor model in MATLAB February 10
Design/Simulate controller in MATLAB March 10
Design/Simulate controller in Simulink April 9
4 - 54 - 5 February 24 Make required adjustments to model and download to DS1103 March 12
66 March 3 Design/Build/Test hardware for motor subsystem February 12
77 March 10 Design/Build/Test hardware for optical encoder system February 17
8 - 108 - 10 March 31Make required adjustments to controller model to work with motor
and hardware and download to DS1103March 12
11 - 1311 - 13 April 21 Improve controller or Design/Build/Test additional controllers April 23
1414 April 28 Work on presentation/final report/tutorial In Progress
1515 May 5 Presentation May 5
1616 May 11 Final Report Due In Progress
Project StatusProject Status
A Controller has been designed and A Controller has been designed and implemented using the DS1103 Board.implemented using the DS1103 Board.
The Controller functions correctly but The Controller functions correctly but may not meet the rise time specification.may not meet the rise time specification.
The tutorial is still being put together The tutorial is still being put together but will be completed.but will be completed.
The motor/brake model was The motor/brake model was verified/developed in a previous project.verified/developed in a previous project.
References IReferences I
Guides/Manuals:Guides/Manuals: ControlDesk Experiment Guide For ControlDesk ControlDesk Experiment Guide For ControlDesk
3.23.2, Germany: dSPACE GmbH, 2008, Release 6.1., Germany: dSPACE GmbH, 2008, Release 6.1. dSPACE System First Work Steps For DS1103, dSPACE System First Work Steps For DS1103,
DS1104, DS1005, DS1006, and Micro Auto BoxDS1104, DS1005, DS1006, and Micro Auto Box, , Germany: dSPACE GmbH, 2007, Release 6.0.Germany: dSPACE GmbH, 2007, Release 6.0.
DS1103 PPC Controller Board Hardware DS1103 PPC Controller Board Hardware Installation and ConfigurationInstallation and Configuration, Germany: dSPACE , Germany: dSPACE GmbH, 2007, Release 6.0. GmbH, 2007, Release 6.0.
Real-Time Interface (RTI and RTI-MP) Real-Time Interface (RTI and RTI-MP) Implementation GuideImplementation Guide, Germany: dSPACE GmbH, , Germany: dSPACE GmbH, 2008, Release 6.1.2008, Release 6.1.
References IIReferences II
dSPACE Product Descriptions:dSPACE Product Descriptions: ““DS1103 PPC Controller Board”, Germany: DS1103 PPC Controller Board”, Germany:
dSPACE, July 2008.dSPACE, July 2008. ““Connector and LED Panels,” Connector and LED Panels,” Catalog 2008Catalog 2008, ,
Germany: dSPACE GmbH, 2008, p. 302.Germany: dSPACE GmbH, 2008, p. 302.
Current Motor Model:Current Motor Model: Sabbisetti, Amulya Sabbisetti. "Discrete Sabbisetti, Amulya Sabbisetti. "Discrete
Time Gain Scheduled Adaptive Control of Time Gain Scheduled Adaptive Control of DC Motor Speed", Masters Project Report, DC Motor Speed", Masters Project Report, Bradley University ECE Department, Bradley University ECE Department, December 2008. December 2008.
AcknowledgmentsAcknowledgments
Mr. Nick Schmidt:Mr. Nick Schmidt: Motor/Brake System ConstructionMotor/Brake System Construction
Mr. Mattus: Mr. Mattus: Initial Setup of DS1103 Workstation Initial Setup of DS1103 Workstation Construction of Slave I/O and Encoder Construction of Slave I/O and Encoder
ConnectorsConnectors
Larry Kendrick of Caterpillar: Larry Kendrick of Caterpillar: Funds for purchase of DS1103 system.Funds for purchase of DS1103 system.