ecse 4460 control systems design - rpi

46
ECSE 4460 Control Systems Design Instructor: Professor John T. Wen TA: Rafael Quintanilla http://www.cat.rpi.edu/~wen/ECSE446S06/ Modeling of Dynamical Systems

Upload: others

Post on 01-May-2022

12 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ECSE 4460 Control Systems Design - RPI

ECSE 4460 Control Systems Design

Instructor: Professor John T. Wen

TA: Rafael Quintanilla

http://www.cat.rpi.edu/~wen/ECSE446S06/

Modeling of Dynamical Systems

Page 2: ECSE 4460 Control Systems Design - RPI

Some Comments on Design Memo• Generally well written.• References: Only include the ones that you cite in the

report. Use standard format.• Include figures to illustrate concept.• Include broader application and motivation.• Using flow chart to illustrate approach is a good idea – but

explain it!• For project proposal, include additional considerations:

• Economic: does it make economic sense?• Environmental: is it environmentally friendly? • Sustainability: what is its maintenance requirement and life time?• Manufacturability: how is its manufacturing and calibration requirement

(one of a kind or mass produced) • Ethical: any intellectual property or privacy issue? • Health and safety: is the operation safe or affect others’ health? • Social and political: does it require regulatory approval? how does it

impact society?

Page 3: ECSE 4460 Control Systems Design - RPI

Steps in Control Design

• Specification: speed, load, tracking accuracy, noise rejection, robustness, cost

• Dynamic model: physics-based, friction, backlash, saturation.

• Model identification: use physical data to calibrate and validate model.

• Controller design: use model to design controller to meet specification (simulation should include sampling, quantization, saturation, noise) and size components (adjust specification if necessary). Apply control to physical system. Iterate control design and/or model.

Page 4: ECSE 4460 Control Systems Design - RPI

Specification• Speed: How fast does the load move (e.g., target

tracking, writing, laser show)? Use inverse kinematics to calculate the maximum joint velocities.

• Load: What is the maximum load (force/torque)? Use inverse kinematics to calculate maximum joint torque.

• Tracking accuracy: How closely does the load needs to follow a desired trajectory (e.g., a target or prescribed pattern)?

• Steady state error: How much position error can be tolerated?

• Noise rejection: How much sensor noise is expected (max, mean, std dev)?

• Robustness: How much modeling error can be tolerated?

• Cost: What is the total expected cost?

Page 5: ECSE 4460 Control Systems Design - RPI

Mathematical Modeling

Analytical (mathematical) description of behavior of physical systems.

Applications:• Understanding physical phenomena (material

properties: why does addition of nanoparticleschange polymer mechanical, electrical, and optical properties?)

• Algorithm design (planning and control, e.g., robots)• Simulation (virtual reality, games, movies, etc.)

Page 6: ECSE 4460 Control Systems Design - RPI

Physics-based Modeling Mechanical Systems

Statics: FBD, force/moment balance Dynamics:– Newton-Euler – Energy based approach (Lagrange-Euler)

Electrical SystemsKirchoff’s Laws

Thermal SystemsHeat Equation

mx F= Jθ τ=

L T V

d L L Qdt q q

= −

⎛ ⎞∂ ∂− =⎜ ⎟∂ ∂⎝ ⎠

ii

ii

F 0

=

=

Page 7: ECSE 4460 Control Systems Design - RPI

Empirical Modeling Use physical measurements to fit to a

model • Physics based model (e.g., friction)• Neural network• Fuzzy functions• Orthogonal function expansion

i

N

ni auxfauxfx ),,(),,,(

1σσ ∑

=

==

Constant parameters a and σ are identified using input/output data

Page 8: ECSE 4460 Control Systems Design - RPI

Model Identification

Use physical measurements to estimate the constant parameters in a physics based model.

This course: • Physics based model for model structure • Use identified model for control design

Page 9: ECSE 4460 Control Systems Design - RPI

Pan-Tilt Mechanism

θ1

θ2

Page 10: ECSE 4460 Control Systems Design - RPI

Joint Parameters

• Motor inertia, Jm

• Motor friction (viscous Bmv Coulomb Bmc)• Gear ratio, N• Load inertia, JL

• Link friction (viscous BLv Coulomb BLc)• Overall mass, m• Location of center of gravity

Page 11: ECSE 4460 Control Systems Design - RPI

Model for a Single Joint

2( ) ( ) ( )sgn( )sin

L m L Lv mv L Lc mc L

m c L L

J N J B NB B NBN mg

θ θ θτ θ τ

+ + + + +

= + −

θL

mg lc

τL

This term is zero for the pan joint

Applied motor torque

Load torque

Page 12: ECSE 4460 Control Systems Design - RPI

Pan and Tilt Model

As a simplification, model pan and tilt as decoupled joints (tilt stage contributes to the pan dynamics in terms inertia, but assume a worst-case constant tilt angle).

Model parameters depend on choice of motors, transmissions (gear ratios), and load.

Page 13: ECSE 4460 Control Systems Design - RPI

Pan and Tilt Model (Cont.)

Motor parameters and transmission selections may be found from manufacturer’s datasheets and catalogs.

Ignore friction (or use identified values from past reports; eventually they will be identified experimentally).

Inertia: use Solidworks or estimate based your proposed project

Page 14: ECSE 4460 Control Systems Design - RPI

Modeling of Mechanical Systems

Let’s consider a single degree-of-freedom (DOF) mechanism:

motorlink

r2 r1

θl

θmgear ratio: N = r2 / r1

Page 15: ECSE 4460 Control Systems Design - RPI

Free Body Diagram

motor

link

r2

r1

θl

fc fc

mg lc

1motor: m m m m m cI B r fθ θ τ+ = −

2link: sinc cI B r f mgθ θ θ+ = +

Remove fc and use 1 2 (or )m mr r Nθ θ θ θ= =

2( ) ( ) sinm m m cI N I B NB N mgθ θ τ θ+ + + = +

we obtain:

θm

, I Bθ θ 2 cr f

sincmg θ

, m m m mI Bθ θmτ

1 cr f

Page 16: ECSE 4460 Control Systems Design - RPI

Another Approach: Lagrangian

First write down the kinetic and potential energies:

2 2 22 ( )2 2 2

m m mI N I IIK θ θθ += + = coscP mg θ=

Form the Lagrangian: L = K – P

Apply the Lagrangian equation of motion:

extd L Ldt

τθ θ

⎛ ⎞∂ ∂− =⎜ ⎟∂ ∂⎝ ⎠

For our case:

2( ) sin frictionm c ext mI N I mg Nθ θ τ τ+ − = = −

Page 17: ECSE 4460 Control Systems Design - RPI

More General Multibody Systems

More general expression of kinetic and potential energies

1

12

i

TNi i i i i

i i i i i i

M

I m pK

v m p m I vω ω

=

×⎡ ⎤ ⎡ ⎤ ⎡ ⎤= ⎢ ⎥ ⎢ ⎥ ⎢ ⎥− ×⎣ ⎦ ⎣ ⎦ ⎣ ⎦∑

1 121

0( ) , 0 , ...

1

NT

oi i oi o ii

P p z m g z p p p p=

⎡ ⎤⎢ ⎥= = = + + +⎢ ⎥⎢ ⎥⎣ ⎦

2( )c Ti i i i i iI I m p p p I= − − (Parallel axis theorem)

CMipi-1,i

pi

hi-1hi

Oi-1 Oi

θi-1

θi

Page 18: ECSE 4460 Control Systems Design - RPI

More General Multibody Systems

Form the Lagrangian: L = K – P

Apply the Lagrangian equation of motion: extd L Ldt

τθ θ∂ ∂⎛ ⎞ − =⎜ ⎟∂ ∂⎝ ⎠

General equation of motion:

( ) ( ) ( , ) ( )M B C Gθ θ θ θ θ θ θ τ+ + + =

[ ]1 ... 0...0 i ki i i k

i k ki

hJ J

v h pω

θ ξ ξ ξ⎡ ⎤ ⎡ ⎤

= = =⎢ ⎥ ⎢ ⎥×⎣ ⎦ ⎣ ⎦

1

12

NT T

i i ii

K J M Jθ θ=

⎛ ⎞= ⎜ ⎟⎝ ⎠∑

Page 19: ECSE 4460 Control Systems Design - RPI

For This CourseThe code to generate the general equation of motion is posted: pantilt.m, you just have to run it in MATLAB to obtain the expressions for M, C, G.

To use pantilt.m, first put the mechanism in the zero-configuration (all angles are zero). Choose a coordinate frame.Represent pi-1,i , pi , hi in this coordinate frame. Then run pantilt.m.

For simulation, you need substitute in the parameters m1, m2, I1

c, I2c, p1, p2.

Page 20: ECSE 4460 Control Systems Design - RPI

Pan-Tilt Platform

The pan-tilt platform is like a 2-link robot (O1 and O2 coincide).

With motors and gears attached

O2O1

h1=[0,0,1]T

h2=[0,1,0]T

p12=[0,0,0]T

Page 21: ECSE 4460 Control Systems Design - RPI

First Link (Pan)

p1=[ lca1, lca2, lca3-l1]T

Page 22: ECSE 4460 Control Systems Design - RPI

Second Link (Tilt)

p2=[ lcb1, lcb2, lcb3]T

Page 23: ECSE 4460 Control Systems Design - RPI

Your DesignBut you haven’t chosen the motors and gears yet!

So you get the parameters for the skeleton only, and you can form the composite inertia and center-of-mass location with different motors/gears combinations.

Page 24: ECSE 4460 Control Systems Design - RPI

Skeletal Pan

p1=[ 0,0.0125m, -0.0981m, 0.0590m]T

Page 25: ECSE 4460 Control Systems Design - RPI

Skeletal Tilt

p2=[ 0, 0.003m,0]T

0.003m

Page 26: ECSE 4460 Control Systems Design - RPI

Choice of Motors / Gears

You will use the design resource page http://www.cat.rpi.edu/~potsaid/csd/Resources.html to find different choices of motors and gears. Manufacturers will provide the dimension and mass, but not the location of center of mass and inertia. Take a guess of where the center of mass is (e.g., roughly the geometric center), and approximate motors and gears as cylinders with uniform density. Then you have (a guess) of the CM location and inertia which you can use in your design iteration.

Page 27: ECSE 4460 Control Systems Design - RPI

, cb bI m

Combining Two Bodies

, ca aI m

ap

bp

CM of combined bodies

cp

, cc cI m

( ) /c a b

c a a b b c

m m mp m p m p m

= +

= +

( )( )

( ) ( )

2

2

( ),

( ),

Ta a a ac ac ac ac c ac

Tb b b bc bc bc bc c bc

c a bc c

I I m p I p p p p p

I I m p I p p p p p

I I I

= + − = −

= + − = −

= +

This is given in a MATLAB program compositebodies.m(which requires masscenter.m and parallelaxis.m)

Page 28: ECSE 4460 Control Systems Design - RPI

Adding Motors / Gears to Skeleton

For your design, you need to

• obtain m from the manufacturer’s datasheet

• calculate Ic and location of CM based on some simplifying assumptions and the geometry of the part

• determine p based on where you will mount the part

Page 29: ECSE 4460 Control Systems Design - RPI

An Example of Putting Things TogetherConsider the tilt axis with pulley, hub, and payload added.

Page 30: ECSE 4460 Control Systems Design - RPI

Putting Things Together (Cont.)

32768 Kg/m (density of Aluminum)ρ =

0.0381m (diameter of hub)0.0630m (diameter of pulley)

0.0095m (diameter of hole)0.0095m (thickness of hub)0.0095m (thickness of pulley)

0.0190m (thickness of hole)

hub

pulley

hole

hub

pulley

hole

dd

dt

t

td

=

=

=

==

=

1 2 3, , 0.0762m, 0.0381m, 0.0095m (dimension of payload)d d =

First gather part data:

Page 31: ECSE 4460 Control Systems Design - RPI

Putting Things Together (Cont.)

Mass and inertia may then be found (hole has negative mass).2( / 2)m d tρπ=

22

2

22

3 0 012 2

0 02 2

0 0 312 2

c

m d t

m dI

m d t

⎡ ⎤⎛ ⎞⎛ ⎞ +⎢ ⎥⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠⎢ ⎥⎝ ⎠⎢ ⎥

⎛ ⎞⎢ ⎥= ⎜ ⎟⎢ ⎥⎝ ⎠⎢ ⎥⎢ ⎥⎛ ⎞⎛ ⎞ +⎜ ⎟⎢ ⎥⎜ ⎟⎜ ⎟⎝ ⎠⎢ ⎥⎝ ⎠⎣ ⎦

For a cylinder along the y axis

( )

( )

( )

2 22 3

2 21 3

2 21 2

0 012

0 012

0 012

c

m d d

mI d d

m d d

⎡ ⎤+⎢ ⎥⎢ ⎥⎢ ⎥= +⎢ ⎥⎢ ⎥⎢ ⎥+⎢ ⎥⎣ ⎦

For a cube

Page 32: ECSE 4460 Control Systems Design - RPI

Putting Things Together (Cont.)

Determine where you are going to put these components, thus pin down p for each part.

Repeatedly apply the composite body formula to find the overall m, Ic, p

The MATLAB code for the tilt axis example is on-line in bodyb.m, you need to modify it for the pan axis.

Once you obtain m, Ic, p for both pan and tilt axes, you can substitute the values into the equation of motion. Now you are ready to do simulation!

Page 33: ECSE 4460 Control Systems Design - RPI

Overall Dimension

link with better pictures:http://www.cat.rpi.edu/~potsaid/csd/lect2_modeling/lecture2_modeling.html

Page 34: ECSE 4460 Control Systems Design - RPI

Motor, Amplifier, Encoder

Page 35: ECSE 4460 Control Systems Design - RPI

Complete Motor Model with Gear• Motor dynamics: (voltage ei to motor torque τm,

Nm = motor internal gear ratio)

• Ignoring electrical dynamics (note back emfcontributes a damping term)

m m t

m e m i

N K idiL Ri N K edt

τ

θ

=

+ + =

( )2

/i e m

m t m t em i m

i e K N R

N K N K KeR R

θ

τ θ

= −

= −

Page 36: ECSE 4460 Control Systems Design - RPI

Motor Datasheet

Page 37: ECSE 4460 Control Systems Design - RPI

Relating Model to Datasheet

• For the constant input voltage (ei=24V), we have the steady state condition:

( )( )

/i e m m

m tm m t i e m m

i e K N R

N KN K i e K NR

θ

τ θ

= −

= = −

NL

NL

P

No load speed: set =0, solve

No load current: solve for based on

Peak torque: set 0, solve for Peak current: /

im

e m

m m

i

eK N

i

i e R

τ θ

θ

θ τ

=

=

=

dθm/dt vs. τm is a straight line with

negative slope, i vs. τm is a straight line with positive slope

Page 38: ECSE 4460 Control Systems Design - RPI

Torque/Speed Curve

Page 39: ECSE 4460 Control Systems Design - RPI

What does this mean?

High speed generates large back EMF, reducing the supplied voltage, and the maximum current and torque:

max max

24V

max max

/e m

m t

i e K N R

N K i

θ

τ

⎛ ⎞= −⎜ ⎟⎜ ⎟⎝ ⎠=

To see if your motor can support your simulation result, plot speed vs. torque and make sure it’s not too much beyond the motor speed-torque curve.

Page 40: ECSE 4460 Control Systems Design - RPI

Amplifier

• Output of controller is a voltage between –10V and +10V. We need to use a current amplifier to convert this voltage to a corresponding current, and finally the driving torque.

• Linear amplifier: output current is proportional to the input voltage

• PWM amplifier: output current is switched between max/min voltages at high frequency (typically 20KHz) and duty cycle is proportional to the input voltage (50% duty cycle <-> 0 V).

Page 41: ECSE 4460 Control Systems Design - RPI

Amplifier

Page 42: ECSE 4460 Control Systems Design - RPI

Current Feedback Loop

sgn( )m m m mv m m mc m m t a LJ N B N B N K K Vθ θ θ τ+ + = −

• With current feedback, i is the effective input

amplifier gain

D/A output

• However i=KaV is still subject to saturation due to max amp current and max supplied voltage and back EMF.

• Without current feedback, we have larger damping due to back emf:

2( / ) sgn( ) /m m m mv m t e m m mc m m t i LJ N B N K K R N B N K e Rθ θ θ τ+ + + = −

Page 43: ECSE 4460 Control Systems Design - RPI

Sensors• encoder: consisting of a code wheel (wheel with slits)

and a pair of LED/photo-detector (A/B channels). Sometimes, encoders provide differential outputs also (A+/A-, B+/B-) to remove noise effect.

Encoder counter counts each voltage transition, so with up/down edges of A/B channels, there is an effective multiplier of 4 (quadrature decoding). So a 1000 line encoder has a resolution of 2π / 4000.

• potentiometer: variable resistor (need to specify range of rotation, e.g., # of turns)

Page 44: ECSE 4460 Control Systems Design - RPI

Quantization• D/A and A/D represent analog signal in terms of word

with finite length, this conversion is called quantization. For a 12-bit word representation of +/-10V, the resolution is 10/212=2mV. This will affect the smoothness of your control and measured signals and should be taken account in your detailed simulation.

• Quantization in encoder: encoder measurements are frequently used in velocity estimation through finite differencing. If the speed is so low that position change over 1 sampling period is less than the quantization error, the estimated velocity is zero! For 1ms sampling rate 15RPM = zero speed!

2 / 4096 rad/sec = 15RPM.001t

θ πΔ=

Δ

Page 45: ECSE 4460 Control Systems Design - RPI

On-line

• Article on encoder.

• Motor/Amp/Encoder datasheets for the pan-tilt built by Ben.

• Description of Motor selection/sizing from Pittman.

Page 46: ECSE 4460 Control Systems Design - RPI

Next WeekReal time programming using LabView

(Rafael will give the lecture).

Tomorrow at 6pmMeet in CII 8208 to get experiment and

discuss progress: team 1: 6:00team 2: 6:30team 3: 7:00 team 4: 7:30team 5: 8:00