Mir Imran - D3 Engineering

Download Report

Transcript Mir Imran - D3 Engineering

D3 Engineering
Simplifying Digital Motion
Control System Design,
Using TI Tools
For a copy of the presentation given at the TI Rochester
NY Tech Day Please visit:
www.d3engineering.com
The presentation is listed in the “news and events”
section under the “About” Tab
Jerome Barczykowski
D3 Engineering
[email protected]
www.d3engineering.com
Agenda
•
Digital Control System Design Overview
– Digital Closed Loop Control
– Required Hardware and peripherals
•
28xx DSPs for Digital Control Applications
– Useful features of 28xx for digital motion control
– Integrated Peripherals
– System Design Benefits
•
TI Libraries
–
–
–
–
•
Mathworks, Simulink® C2000 Blockset
–
–
–
–
–
•
TI Peripheral Libraries and examples
TI DMC Libraries
IQ Math Libraries
D3 DMC Systems and Libraries
Modular Design with Simulink®
Plant Simulation and validation
IQmath and Filter Design Simulation (Demo)
Automatic code generation
Real time Feedback and Analysis (RTDX)
Digital Motion Control Demos
Digital Control System
d p (t )
r (nT )
+
+
eˆ(nT )
D(z)
u (nT )
D/A
yˆ (nT )
A/D
Sensor
d s (t )
• Why digital?
•
Digital Design Consideration
–
–
–
–
–
Sampling
Quantization
Processing Power
ADC, DAC
Filtering
u (t )
G(z)
y (t )
Hardware and Peripherals
• Analog to Digital
Converter
• PWM, inverter control
• Communications
• Feed Back Acquisition
• Signal Processing
28xx for DMC
• 32 Bit Processing
• 60-150 MHz Clock
rate
• 64 bit capability to
eliminate
Quantization
• Plentifully RAM and
Flash memory for
code and parameter
storage
Peripherals for DMC
•
•
•
•
12-bit integrated ADC
10-16 PWM channels
High Resolution PWMs
Wide array of
communication interfaces
• High Speed Capture
Modules for feedback
devices
• Plenty of IO for various
control logic
System Design Benefits
• Integrated peripherals
reduces BOM count
• High Clock Rate Allows
for advanced control
algorithms
• Extensive processing
power allows for
implementation of
hardware filters in
software
• Precision data acquisition
peripherals increase final
design quality
Pre-Written Libraries and Examples;
Accelerate Development
TI DMC Libraries
• All blocks in system can be
found in TI’s DMC library
• Some Blocks are available
in both C and Assembly
• Some blocks are available
in both floating and IQ
format
• Most Blocks are also
available in the TI
Mathworks C2000 Block set
that will be covered later in
the presentation
IQ Math Library
Near Floating Point Precision with Fixed Point
Performance
• TI provided IQ math Library is just one tool available to
TI customers.
• Library is available in both Mathworks and as a C library.
• TI, its customers and 3rd Parties like D3 have worked
together to optimize available tools and algorithms like
the IQ math Library.
More info available at www.ti.com/iqmath
D3 DMC and System Libraries
Control Logic
(State Table)
Profile
Generator
Direct
Current PID
Vd
Velocity
PID
Vq
Inverse
Park
Transform
3 Phase
BLDC
Motor
Space
Vector PWM
Generator
Quadrature
Current PID
AD
Voltage
Supervisory
Velocity
Vd
Park
Transform
Vq
Id
Iq
Current
Phase A
Clark
Transform
Current
Phase B
Rotor Position
PWM
Velocity
Calculator
from
Estimated
Position
Rotor
Position
Estimator
Vds
Vqs
Voltage
Phase Voltage
Reconstruction
AD
Motor Bus
Voltage
Modular Design With Simulink®
Mathworks and TI Tools
Plant Simulation and Validation
•
•
•
•
•
Observer Tracking filter
Performance adjusted by changing Alpha and Beta
Possible application as a resolver angle filter
Can be related to basic 2nd order Transfer function (TF)
Alpha and Beta can be expressed in terms of a Damping Coefficient
and a Natural Frequency
A
Alpha
1
Input
B
1
Derivative of Output
Beta
Unit Delay1
1
z
Unit Delay
1
z
2
Output
Filter Simulation Example
Application Simulation
Determining Filter Coefficients
•
Equation 1 gives the filter transfer
function in 2nd order format (filter
angle output)/(filter angle input)
•
The denominator corresponds to
Equation 2
•
Relating equation 1 to a generic
equation for a 2nd order TF (EQ 3) the
coefficients can be solved for (EQ 4)
•
Because system will be discrete the
sampling time must also be accounted
for in the filter
•
The filter in the previous slide was
adjusted to remove divisions for
processing reasons. The coefficients
were then expressed in alpha and beta
(EQ 5)
Application Simulation
Filter implemented in Simulink® using IQ Math
2
damping
damping_coefficient
3
natural _freq
natural_frequency
4
sampling _per
sampling_period
alpha
beta
Subsystem
IQmath
Y
IQN
IQ16_Convert _1
A
A
IQmath
1
Y
B
z
IQNmpy
Unit Delay
IQmath
Y
IQNtoF
IQN to Float
A
1
Output
IQN x IQN 2
1
Input
IQmath
Y
IQN
IQ16_Convert _3
A
A
IQmath
1
IQmath
Y
A
IQN
IQ16_Convert _2
Y
B
z
IQNmpy
Unit Delay 1
IQN x IQN 3
IQmath
Y
2
IQNtoF
Derivative of Output
IQN to Float 1
A
Application Simulation
Simulate Filter With Varying IQ values
Application Simulation
Verification of “Q” Selection
All simulations were performed with a “Q” value of 24
Filter is stable for all necessary damping coefficients
Application Simulation
Simulation Verification on DSP
Application Simulation
Using Simulink® and Matlab®
0.04
0.035
0.03
0.02
0.015
0.01
0.005
X: 0.06
Y: 0
0
-0.005
0
0.01
0.02
0.03
0.04
0.05
0.06
0.07
0.08
0.09
0.1
0.035
0.04
0.045
0.05
0.035
0.04
0.045
0.05
Step Response
Amplitude
1.5
1
0.5
0
0
0.005
0.01
0.015
0.02
0.025
0.03
Time (sec)
Step Response
Amplitude
400
200
0
-200
0
0.005
0.01
0.015
0.02
0.025
0.03
Time (sec)
Phase (deg)
Magnitude (dB)
Bode Diagram
50
0
-50
180
0
-180
0
10
1
10
2
10
3
10
4
10
Frequency (rad/sec)
Magnitude (dB)
Bode Diagram
Phase (deg)
• An additional single pole LPF
was added to the Observer
filter
• Its easier to do a bode
response by coding a Matlab®
“M-File”
• You can verify the filters are
the same by running a step
response in both Simulink®
and in Matlab® code
• The bode response of the plant
can be checked to ensure
proper system frequency
response
0.025
50
0
-50
360
0
-360
0
10
1
10
2
10
Frequency (rad/sec)
3
10
4
10
Automatic Code Generation
Closed Loop Control With Simulink®
• Allows for graphical interface
• System is more easily
configurable
• Simulink® Uses specific
embedded blocks to access
target registers.
• The library contains both
peripheral blocks and direct
memory access blocks.
• Eases Documentation
• Code that is generated and
compiled will always follow
specific guidelines.
RTDX Hardware in the loop
• After generation and during
code execution the Real Time
Data Exchange can be used to
obtain system data.
• The RTDX blocks provide a
way to capture system data for
graphical purposes
• The blocks can be used in a
GUI interface to watch
parameters in real time or the
data can be stored in MATLAB®
for post runtime analysis.
To RTDX
sine_ochan
Out1
Rate Transition
Sine Values
motor_driver
time
Clock
To Workspace
F2812 eZdsp
Conclusion and Demos
• Key 28x System Features for DMC were overviewed
• TI and D3 Libraries and tools were looked at to speed
system development
• The first example demonstrated the use of MATLAB®
and TI tools for an observer tracking filter. Adequate
quantization of filter response was shown through
simulation. Simulation response was validated with the
response of the DSP implementation.
• Matlab was then used to verify a modification of the filter
• Finally the developed system was directly transferred to
the DSP and used to validate the simulated model.
D3 Engineering
Simplifying Digital Motion
Control System Design,
Using TI Tools
For a copy of the presentation given at the TI Rochester
NY Tech Day Please visit:
www.d3engineering.com
The presentation is listed in the “news and events”
section under the “About” Tab
Jerome Barczykowski
Credits:
D3 Engineering
[email protected]
www.d3engineering.com
Some Diagrams were taken from
presentations written by Texas
Instruments Employees and were
available in the public domain.