Modeling and Analysis of Signal Estimation for Stepper Motor Control
Dan Simon Cleveland State University October 8, 2003
Outline
Problem statement Simplorer and Matlab Optimal signal estimation Postprocessing Simulation results Conclusion
Problem statement
Speed control for PM DC motor Aerospace applications Flywheel energy storage Flight control trim surfaces Hydraulics Fans Thrust vector control Fuel pumps
Problem statement
DC Machine Permanent Excitation
& I = V / L RI / L k / L & = kI / J TL / J
I = armature current V = armature voltage L = inductance R = resistance k = motor constant = rotor speed = rotor angle J = moment of inertia TL = load torque
Problem statement
State assignment: x1 = I x2 = x3 = x4 = TL / J Measurements: y = current (and possibly position)
Problem statement
R / L k / L k/J 0 & x= 0 1 0 0 0 1 / L 0 0 1 x+ V + noise 0 0 0 0 0 0 0
1 0 0 0 y= x + noise 0 0 1 0
Estimate velocity x2
Simplorer and Matlab
Simplorer
Circuit element models Electric machine models Data analysis tools Interfaces with Matlab / Simulink
Simplorer and Matlab
Matlab
Powerful math and matrix capabilities
Co-Simulation
Link Simplorer and Matlab Plot and analyze data in either environment
Simplorer and Matlab
Use the SiM2SiM tool in Add Ons / interfaces6 Begin the simulation in Simulink
Simplorer and Matlab
Define Simplorer inputs and outputs in the property dialog of the SiM2SiM component Simplorer ? Simulink
Simplorer and Matlab
Use the S-function property dialog in Matlab to link Simplorer / Matlab signals
Simplorer and Matlab
Begin the simulation in Matlab Couple Simplorers and Matlabs strengths
Simplorer: power electronics, electromechanics, data analysis, state diagrams Matlab: matrix algebra, toolboxes
Data analysis / viewing can be done in either Simplorer or Matlab
Optimal signal estimation
& Given a linear system: x = Ax + Bu u + Bw w y = Cx + Dv
x = state y = measurement u = control input w, v = noise Find the best estimate for the state x
Optimal signal estimation
Suppose w ~ N(0, Q) and v ~ N(0, R). The Kalman filter solves the problem
min E
{ ( x x) ( x x) dt}
T
T & P = AP + PAT + BwQBw KCP
K = PC T D T R 1 D 1 & x = Ax + K ( y Cx)
Optimal signal estimation
The H filter solves the problem
& x = Ax + Bu u + Bw w y = Cx + Dv
x ( 0) x ( 0)
2
x x S dt
2
P01
+ w Q 1 dt +
2
1 < 2 v R 1 dt
This is a game theory approach. Nature tries to maximize the estimation error. The engineer tries to minimize the error.
Optimal signal estimation
Rewrite the previous equation:
1 x(0) x(0) J <0
2 P01
1 2 S dt w Q 1 + v xx
2
2 R 1
dt < 0
Game theory: nature tries to maximize J and the engineer tries to minimize J
min x max w,v , x ( 0 ) J
Optimal signal estimation
The H filter is given as follows:
&= AP + PAT + B QBT KCP + PSP P w w K = PC T D T R 1 D 1 & x = Ax + K ( y Cx )
Note this is identical to the Kalman filter except for an extra term in the Riccati equation.
Optimal signal estimation
The Kalman filter is a least-mean-squares estimator The H filter is a worst-case estimator The Kalman filter is often made more robust by artificially increasing P The H filter shows exactly how to increase P in order to add robustness & P = AP + PAT + B QBT KCP + PSP
w w
Optimal signal estimation
Steady state: T & P = AP + PAT + BwQBw KCP + PSP
=0 K = PC D R D & x = Ax + K ( y Cx )
T T 1 1
Jacopo Riccati 1676-1754
This is an Algebraic Riccati Equation Real time computational savings
Postprocessing
Transfer Matlab data to Simplorer for plotting and analysis
Postprocessing
Start the Matlab postprocessor interface before starting the co-simulation After running the co-simulation, the Day postprocessor can exchange data with Matlab
Postprocessing
Drag data between Day and Matlab
Matlab variables
Matlab output
Matlab commands
Postprocessing
Day cannot handle arrays with more than two dimensions use Matlabs squeeze command Make sure Matlab data is not longer than Simplorers time array
Postprocessing
Simplorer data
Matlab data
Postprocessing
Analysis Characteristics to view statistical information
Select the desired output variable Export to table
Simulation results
motor parameters
control input measurements
Ouput from Matlab
Simulation results
motor
& & implement P and x equations
PI Controller
Simulation results
Simulation parameters: 1.2 ohms, 9.5 mH, 0.544 Vs, 0.004 kgm2 Initial speed = 0 cmd speed = 1000 RPM External load torque changes from 0 to 0.1 Measurement errors 0.1 A, 0.1 rad (1 )
Simulation results
Simulation results
Steady state parameters: Initial speed = 1000 commanded speed = 1000 RPM External load torque = 0 Measurement error = 0.1 A, 0.1 rad (1 )
Simulation results
Simulation results
Simulation results
RMS Estimation Errors (RPM) current and position measurements
Kalman filter Nominal R=R/2 L=L/2 J = 0.6 J k=k/2 R=2R L=2L J=2J k=2k 0.033 0.102 0.032 0.060 834 0.122 0.035 0.078 941 H filter 0.057 0.106 0.056 0.060 828 0.120 0.058 0.082 938
Simulation results
Now suppose we measure winding current but not rotor position. Can we still get a good estimate of motor velocity?
R / L k / L k/J 0 & x= 0 1 0 0 0 1 / L 0 0 1 x+ V + noise 0 0 0 0 0 0 0
y = [1 0 0 0] x + noise (0.1 amps, one sigma)
Simulation results
RMS Estimation Errors (RPM) current measurement only
Kalman filter Nominal R=R/2 L=L/2 J = 0.6 J k=k/2 R=2R L=2L J=2J k=2k 0.034 0.102 0.034 0.060 941 0.154 0.036 0.081 959 H filter 0.036 0.102 0.036 0.060 939 0.154 0.038 0.081 959
Conclusion
Motor state estimation is required for motor control Kalman filtering and H filtering can be used for motor state estimation Steady state filtering saves time Simplorer / Matlab co-simulation Estimate motor parameters R, L, J, k