modeling and analysis of signal estimation for stepper ... · stepper motor control dan simon...

36
Modeling and Analysis of Signal Estimation for Stepper Motor Control Dan Simon Cleveland State University October 8, 2003

Upload: others

Post on 21-Mar-2020

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Modeling and Analysis of Signal Estimation for Stepper ... · Stepper Motor Control Dan Simon Cleveland State University October 8, 2003. Outline ... Simplorer ↔Simulink. Simplorer

Modeling and Analysis of Signal Estimation for

Stepper Motor Control

Dan SimonCleveland State University

October 8, 2003

Page 2: Modeling and Analysis of Signal Estimation for Stepper ... · Stepper Motor Control Dan Simon Cleveland State University October 8, 2003. Outline ... Simplorer ↔Simulink. Simplorer

Outline

• Problem statement• Simplorer and Matlab• Optimal signal estimation• Postprocessing• Simulation results• Conclusion

Page 3: Modeling and Analysis of Signal Estimation for Stepper ... · Stepper Motor Control Dan Simon Cleveland State University October 8, 2003. Outline ... Simplorer ↔Simulink. Simplorer

Problem statement

• Speed control for PM DC motor• Aerospace applications

– Flywheel energy storage– Flight control trim surfaces– Hydraulics– Fans– Thrust vector control– Fuel pumps

Page 4: Modeling and Analysis of Signal Estimation for Stepper ... · Stepper Motor Control Dan Simon Cleveland State University October 8, 2003. Outline ... Simplorer ↔Simulink. Simplorer

Problem statement

DC Machine Permanent Excitation

JTJkILkLRILVI

L /////

−=−−=

ωω

I = armature currentV = armature voltageL = inductanceR = resistancek = motor constant

ω = rotor speedθ = rotor angleJ = moment of inertiaTL = load torque

Page 5: Modeling and Analysis of Signal Estimation for Stepper ... · Stepper Motor Control Dan Simon Cleveland State University October 8, 2003. Outline ... Simplorer ↔Simulink. Simplorer

State assignment:• x1 = I• x2 = ω• x3 = θ• x4 = TL / JMeasurements: • y = current (and possibly position)

Problem statement

Page 6: Modeling and Analysis of Signal Estimation for Stepper ... · Stepper Motor Control Dan Simon Cleveland State University October 8, 2003. Outline ... Simplorer ↔Simulink. Simplorer

Problem statement

Estimate velocity x2

noise01000001

y

noise

000/1

00000010100/

00//

+

=

+

+

−−

=

x

V

L

xJk

LkLR

x

Page 7: Modeling and Analysis of Signal Estimation for Stepper ... · Stepper Motor Control Dan Simon Cleveland State University October 8, 2003. Outline ... Simplorer ↔Simulink. Simplorer

Simplorer and Matlab

• Simplorer– Circuit element models– Electric machine models– Data analysis tools– Interfaces with Matlab /

Simulink

Page 8: Modeling and Analysis of Signal Estimation for Stepper ... · Stepper Motor Control Dan Simon Cleveland State University October 8, 2003. Outline ... Simplorer ↔Simulink. Simplorer

Simplorer and Matlab

• Matlab– Powerful math and matrix

capabilities• Co-Simulation

– Link Simplorer and Matlab– Plot and analyze data in

either environment

Page 9: Modeling and Analysis of Signal Estimation for Stepper ... · Stepper Motor Control Dan Simon Cleveland State University October 8, 2003. Outline ... Simplorer ↔Simulink. Simplorer

Simplorer and Matlab

• Use the SiM2SiM tool inAdd Ons / interfaces6

• Begin the simulation in Simulink

Page 10: Modeling and Analysis of Signal Estimation for Stepper ... · Stepper Motor Control Dan Simon Cleveland State University October 8, 2003. Outline ... Simplorer ↔Simulink. Simplorer

Simplorer and MatlabDefine Simplorer inputs and outputs in the property dialog of the SiM2SiM componentSimplorer ↔ Simulink

Page 11: Modeling and Analysis of Signal Estimation for Stepper ... · Stepper Motor Control Dan Simon Cleveland State University October 8, 2003. Outline ... Simplorer ↔Simulink. Simplorer

Simplorer and Matlab

• Use the S-function property dialog in Matlab to link Simplorer / Matlab signals

Page 12: Modeling and Analysis of Signal Estimation for Stepper ... · Stepper Motor Control Dan Simon Cleveland State University October 8, 2003. Outline ... Simplorer ↔Simulink. Simplorer

Simplorer and Matlab

• Begin the simulation in Matlab• Couple Simplorer’s and Matlab’s strengths

– Simplorer: power electronics, electromechanics, data analysis, state diagrams

– Matlab: matrix algebra, toolboxes• Data analysis / viewing can be done in

either Simplorer or Matlab

Page 13: Modeling and Analysis of Signal Estimation for Stepper ... · Stepper Motor Control Dan Simon Cleveland State University October 8, 2003. Outline ... Simplorer ↔Simulink. Simplorer

Optimal signal estimation

Given a linear system:

DvCxywBuBAxx wu

+=++=

x = statey = measurementu = control inputw, v = noise

Find the best estimate for the state x

Page 14: Modeling and Analysis of Signal Estimation for Stepper ... · Stepper Motor Control Dan Simon Cleveland State University October 8, 2003. Outline ... Simplorer ↔Simulink. Simplorer

Optimal signal estimation

Suppose w ~ N(0, Q) and v ~ N(0, R).The Kalman filter solves the problem

{ }

)ˆ(ˆˆ

)ˆ()ˆ(min

11

xCyKxAx

DRDPCK

KCPQBBPAAPP

dtxxxxE

TT

Tww

T

T

−+=

=

−++=

−−

−−−

Page 15: Modeling and Analysis of Signal Estimation for Stepper ... · Stepper Motor Control Dan Simon Cleveland State University October 8, 2003. Outline ... Simplorer ↔Simulink. Simplorer

Optimal signal estimationThe H∞ filter solves the problem

θ1

)0(ˆ)0(

ˆ222

2

1110

<++−

∫ ∫∫

−−− dtvdtwxx

dtxx

RQP

S

This is a game theory approach.Nature tries to maximize the estimation error.The engineer tries to minimize the error.

DvCxywBuBAxx wu

+=++=

Page 16: Modeling and Analysis of Signal Estimation for Stepper ... · Stepper Motor Control Dan Simon Cleveland State University October 8, 2003. Outline ... Simplorer ↔Simulink. Simplorer

Optimal signal estimation

Rewrite the previous equation:

J

J

dtvwdtxxxx

xvwx

RQSP

)0(,,ˆ

2222

maxmin

0

01ˆ)0(ˆ)0(1111

0

<

<+−−+−− ∫∫ −−− θθ

Game theory: nature tries to maximize J and the engineer tries to minimize J

Page 17: Modeling and Analysis of Signal Estimation for Stepper ... · Stepper Motor Control Dan Simon Cleveland State University October 8, 2003. Outline ... Simplorer ↔Simulink. Simplorer

Optimal signal estimation

The H∞ filter is given as follows:

)ˆ(ˆˆ

11

xCyKxAx

DRDPCK

PSPKCPQBBPAAPPTT

Tww

T

−+=

=

+−++=−−−

θ

Note this is identical to the Kalman filter except for an extra term in the Riccati equation.

Page 18: Modeling and Analysis of Signal Estimation for Stepper ... · Stepper Motor Control Dan Simon Cleveland State University October 8, 2003. Outline ... Simplorer ↔Simulink. Simplorer

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 robustnessPSPKCPQBBPAAPP T

wwT θ+−++=

Page 19: Modeling and Analysis of Signal Estimation for Stepper ... · Stepper Motor Control Dan Simon Cleveland State University October 8, 2003. Outline ... Simplorer ↔Simulink. Simplorer

• Steady state:

Optimal signal estimation

)ˆ(ˆˆ

011

xCyKxAx

DRDPCK

PSPKCPQBBPAAPP

TT

Tww

T

−+=

==

+−++=

−−−

θ

• This is an Algebraic Riccati Equation• Real time computational savings

Jacopo Riccati1676-1754

Page 20: Modeling and Analysis of Signal Estimation for Stepper ... · Stepper Motor Control Dan Simon Cleveland State University October 8, 2003. Outline ... Simplorer ↔Simulink. Simplorer

Postprocessing

Transfer Matlab data to Simplorer for plotting and analysis

Page 21: Modeling and Analysis of Signal Estimation for Stepper ... · Stepper Motor Control Dan Simon Cleveland State University October 8, 2003. Outline ... Simplorer ↔Simulink. Simplorer

Postprocessing

• Start the Matlab postprocessor interface before starting the co-simulation

• After running the co-simulation, the Day postprocessor can exchange data with Matlab

Page 22: Modeling and Analysis of Signal Estimation for Stepper ... · Stepper Motor Control Dan Simon Cleveland State University October 8, 2003. Outline ... Simplorer ↔Simulink. Simplorer

Postprocessing

Drag data between Day and Matlab

Matlab commands

Matlab output

Matlab variables

Page 23: Modeling and Analysis of Signal Estimation for Stepper ... · Stepper Motor Control Dan Simon Cleveland State University October 8, 2003. Outline ... Simplorer ↔Simulink. Simplorer

Postprocessing

• Day cannot handle arrays with more than two dimensions – use Matlab’s “squeeze” command

• Make sure Matlab data is not longer than Simplorer’s time array

Page 24: Modeling and Analysis of Signal Estimation for Stepper ... · Stepper Motor Control Dan Simon Cleveland State University October 8, 2003. Outline ... Simplorer ↔Simulink. Simplorer

Postprocessing

Simplorerdata

Matlabdata

Page 25: Modeling and Analysis of Signal Estimation for Stepper ... · Stepper Motor Control Dan Simon Cleveland State University October 8, 2003. Outline ... Simplorer ↔Simulink. Simplorer

Postprocessing

AnalysisCharacteristicsto view statistical information

Select the desiredoutput variable

Export to table

Page 26: Modeling and Analysis of Signal Estimation for Stepper ... · Stepper Motor Control Dan Simon Cleveland State University October 8, 2003. Outline ... Simplorer ↔Simulink. Simplorer

Simulation results

motor parameters

measurements

control input

Ouput from Matlab

Page 27: Modeling and Analysis of Signal Estimation for Stepper ... · Stepper Motor Control Dan Simon Cleveland State University October 8, 2003. Outline ... Simplorer ↔Simulink. Simplorer

Simulation results

equationsˆandimplement xP

motor

PI Controller

Page 28: Modeling and Analysis of Signal Estimation for Stepper ... · Stepper Motor Control Dan Simon Cleveland State University October 8, 2003. Outline ... Simplorer ↔Simulink. Simplorer

Simulation parameters:• 1.2 ohms, 9.5 mH, 0.544 Vs, 0.004 kg⋅m2

• Initial speed = 0cmd speed = 1000 RPM

• External load torque changes from 0 to 0.1

• Measurement errors0.1 A, 0.1 rad (1 σ)

Simulation results

Page 29: Modeling and Analysis of Signal Estimation for Stepper ... · Stepper Motor Control Dan Simon Cleveland State University October 8, 2003. Outline ... Simplorer ↔Simulink. Simplorer

Simulation results

Page 30: Modeling and Analysis of Signal Estimation for Stepper ... · Stepper Motor Control Dan Simon Cleveland State University October 8, 2003. Outline ... Simplorer ↔Simulink. Simplorer

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

Page 31: Modeling and Analysis of Signal Estimation for Stepper ... · Stepper Motor Control Dan Simon Cleveland State University October 8, 2003. Outline ... Simplorer ↔Simulink. Simplorer

Simulation results

Page 32: Modeling and Analysis of Signal Estimation for Stepper ... · Stepper Motor Control Dan Simon Cleveland State University October 8, 2003. Outline ... Simplorer ↔Simulink. Simplorer

Simulation results

Page 33: Modeling and Analysis of Signal Estimation for Stepper ... · Stepper Motor Control Dan Simon Cleveland State University October 8, 2003. Outline ... Simplorer ↔Simulink. Simplorer

Simulation results

0.0580.035L = 2 L

938941k = 2 k0.0820.078J = 2 J

0.1200.122R = 2 R828834k = k / 20.0600.060J = 0.6 J0.0560.032L = L / 20.1060.102R = R / 20.0570.033NominalH∞ filterKalman filter

RMS Estimation Errors (RPM)current and position measurements

Page 34: Modeling and Analysis of Signal Estimation for Stepper ... · Stepper Motor Control Dan Simon Cleveland State University October 8, 2003. Outline ... Simplorer ↔Simulink. Simplorer

Simulation resultsNow suppose we measure winding current but not rotor position. Can we still get a good estimate of motor velocity?

[ ] sigma) one amps, (0.1 noise0001y

noise

000/1

00000010100/

00//

+=

+

+

−−

=

x

V

L

xJk

LkLR

x

Page 35: Modeling and Analysis of Signal Estimation for Stepper ... · Stepper Motor Control Dan Simon Cleveland State University October 8, 2003. Outline ... Simplorer ↔Simulink. Simplorer

Simulation results

0.0380.036L = 2 L

959959k = 2 k0.0810.081J = 2 J

0.1540.154R = 2 R939941k = k / 20.0600.060J = 0.6 J0.0360.034L = L / 20.1020.102R = R / 20.0360.034NominalH∞ filterKalman filter

RMS Estimation Errors (RPM)current measurement only

Page 36: Modeling and Analysis of Signal Estimation for Stepper ... · Stepper Motor Control Dan Simon Cleveland State University October 8, 2003. Outline ... Simplorer ↔Simulink. Simplorer

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