Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted...

38
Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment http://www.eas.asu.edu/~aar/research/mosart Jose I. Hernandez Richard P. Metzger Jr. Chen-I Lim Armando A. Rodriguez Ack : White House , NSF, WAESO/CIMD, Boeing, Intel, Microsoft, CADSI, Knowledge Revolution, MathWorks, Lego, Xilinx, Honeywell, National Instruments, Integrated Systems, ASU CIEE. ASEE Pacific Southwest Meeting `99 Saturday, March 20 th 1999 Harrah’s Hotel Las Vegas, Nevada

Transcript of Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted...

Page 1: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible

Inverted Pendulum Environment

http://www.eas.asu.edu/~aar/research/mosart

Jose I. Hernandez Richard P. Metzger Jr. Chen-I Lim Armando A. Rodriguez

Ack : White House , NSF, WAESO/CIMD, Boeing, Intel, Microsoft, CADSI, Knowledge Revolution, MathWorks, Lego, Xilinx, Honeywell, National Instruments, Integrated Systems, ASU CIEE.

ASEE Pacific Southwest Meeting `99

Saturday, March 20th 1999

Harrah’s Hotel

Las Vegas, Nevada

Page 2: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

Motivation

Flexible Inverted Pendulum (FIP) System Dynamics: Model & Control Laws

Description of Interactive MoSART FIP Environment

Utility of Environment

Summary and Future Directions

OutlineOutline

Page 3: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

Advanced visualization tools are needed for system analysis and design.

Research/education can be enhanced with interactive multimedia environments.

PC platforms now offer substantial computing power for engineering design.

Motivation

Page 4: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

New Technologies• Affordable High Performance Computing• Hi-fidelity Simulation Capability

– Simulink / MATLAB, etc…– Visual C++

• PC Animation Creation / Manipulation Technologies– 3D Modeling Software (e.g. 3D Studio, RPM D3D toolbox,

etc.)– Microsoft DirectX (provides: 3D-animation, sound, video,

user-input, etc.)

• Object Oriented Programming (OOP) Framework– ActiveX / OLE

New Technologies

Page 5: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

• Accelerated-time simulation• Alter model/controller:

– structure– parameters (on-the-fly)

• Advanced visualization:– real-time graphics– visual indicators/aids– 3D animation models

• Direct user input via joystick, mouse, etc.• Integration with MATLAB and Simulink

Cartpend.exefxdbasepend.exe

RotaryPend.exe

Key Environment Features

Page 6: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

System-specific interactive MoSART

environments

High performance: Windows/ C++

Advanced visualization tools: Direct-3D

Extensible: integration with MATLAB

User friendly

Contributions of Work

Page 7: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

1

2

l

m

b

f

x

k t

1

2

h

c

in

1

c

l

m

b

d

l

c

1

m2

2b

Flexible Inverted Pendulum (FIP) System

Page 8: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

Controls and OutputsControls and Outputs

xp

(N) ForceInput inf

Inputs, up Outputs, yp

x = Cart Position (m)

1= Link 1 Angle (rad)

ppp

ppppp

xCy

uBxAx

Page 9: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

States, xpStates, xp

/sec)locity(radangular ve 2Link :6

(rad/sec)locity angular ve 1Link :5

(m/sec)ity Cart veloc x:4

(rad) angle 2Link :3

(rad) angle 1Link :2

(m)position Cart x :1

2

1

2

1

Page 10: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

FIP Linear Model

Page 11: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

FIP Linear Model

Page 12: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

Unstable pole

Plant Analysis

Page 13: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

Classical

Pole Placement

LQG/LTR

H (1)

H (2)

Control Laws

Page 14: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

Pentium PC

Windows ’95/’98/NT

System Requirements: Pentium PC running Windows 95/NT. 32 MB RAM. Direct-3D 3.0.

Recommended: Pentium II 266 w/ MMX running Windows NT 4.0. 64 MB RAM. Direct-3D 3.0.

Visual C++/ MFC

Direct-3D v3.0MATLAB Engine

v5.0

About the Program

Page 15: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

Communication Module (COM)

ProgramUser Interface

(PUI)

Simulation Module

(SIM)

Graphical Animation Module

(GAM)

Help/InstructModule(HIM)

Physical System Simulink MATLAB InternetOther

Applications

Interactive Environment Application

ActiveX

Interactive MoSART Environment Modules

Page 16: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

(PUI)User Friendly Windows ’95/NT Interface

•Menus•Multiple windows•Program control toolbars

Interactive System Diagram

•Block diagram representation of system•Point-and-click access

Program User Interface

Page 17: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

(SIM)Numerical Simulation

On-the-Fly Parameter Editing

•Fast compiled C++: >3000 Hz / 266MHz PII•Better than real-time simulation

•Plant models•Controller parameters•Reference Commands, Disturbances, Noise, etc.•Integration methods: Euler, Runge-Kutta 4, etc.

Extensibility

Simulation Module

Page 18: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

(GAM)3D Animation

•Direct-3D•Texture-mapped, light-shaded polygons•Wireframe copters from previous simulations

•Real-Time Variable Display Window•2D Animation Window: pitch indicator•Real-time multiple-graph plotting

Visualization Tools & Indicators(SMAC)

Extensibility

Graphical Animation Module

Page 19: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

(HIM)On-line Help

•Instructions on using the environment•Program reference

HTML / PDF Documents

•Model documentation/ references•Interactive tutorials

Help-Instruct Module

Page 20: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

Cart Position<m> 0.3450 Link 1 Angle<rad> -0.2390 Link 1 Angle <rad> 0.3654 Cart Velocity<m/sec> 0.6288Link 1 Angular Vel.<rad/sec> 0.0234Link 1 Angular Vel. <rad/sec> 3.8054

Toolbar and Menu

Initial ConditionsMenu

3-D AnimationWindow

System Block Diagram

Variables WindowReal Time Plots

Simulation Parameters

MoSART Flexible Inverted Pendulum (FIP) Environment

Page 21: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

Plant modal analysis

Plant flexibility analysis

H Controller design

Comparison of controllers

Utility of the Environment

Page 22: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

Toppling Unstable Mode

Flexible Mode

Link Damping Mode

Modal Analysis

Page 23: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

Visual animation of The Flexible Mode

Selecting To Work Open-Loop, No Controller,No Input

Plotting Cart Position and Link 1 and Link 2 Angles

VariableValues

Cart Position<m> 0.3450 Link 1 Angle<rad> -0.2390 Link 1 Angle <rad> 0.3654 Cart Velocity<m/sec> 0.6288Link 1 Angular Vel.<rad/sec> 0.0234Link 1 Angular Vel. <rad/sec> 3.8054

Visualization of Flexible Mode

Page 24: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

M

xfin

m

l1

2

l

m

b

f x

kt

1

2

h

c

in

1

c

l

m

bd

l

c

1

m2

2b

Rigid Inverted Pendulum Flexible Inverted Pendulum

2

21

lll

mM

mmm

h

c

2

1

1

122

0

0

0

b

k

b

b

m

mmm

t

c

Plant Rigidity Analysis

Page 25: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

As b2 Increases, Flexible Mode Damping Increases

As kt Increases, Natural Bending Frequency Increases

Rigidity Analysis: Pole Locations Varying b2 and kt

Page 26: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

fin M

x

m

l

( )1m

M

g

ls=0,0,

(N) ForceInput inf

Inputs, upOutputs, yp

= Link Angle (rad)x = Cart Position (m)

States, xp

= Link angle (rad)d = Link angular velocity (rad/sec)x = Cart position (m)dx = Cart speed (m/sec)

Rigidity Analysis: Rigid Inverted Pendulum Linear Model

Page 27: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

Fle

xibl

e In

vert

ed

Pen

dulu

m P

lant

High Frequency Peak Due to the Imaginary Poles

Rig

id I

nve

rte

d P

endu

lum

Pla

nt

Low Frequency Poles of Both Systems Are the Same

Rigidity Analysis: Transfer function comparison: Rigid vs Flexible Pendulums

Page 28: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

r e udi do

K P

n

y

Controller Plant

• Design K based on model Po s.t. nominal CLS exhibits:

– Stability

– Good Command Following

– Good Disturbance Rejection

– Good Noise Attenuation

– Robust Performance

H Controller design

Page 29: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

w1 w2

H Controller Design

Page 30: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

Small Overshoot

No Steady State Error

Small Oscillations 1

2

Fast Response

SensitivitySensitivity

Complementary SensitivitySmall Control Force

Good Low FrequencyCommand Following

H Design

Page 31: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

Classical

LQG/LTR

Pole Placement

H (design 1)

H (design 2)

Command Following (Cart Position)for a Unit Step Input

Controller Comparison

Page 32: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

Sensitivity Transfer Functions (S)Complementary Sensitivity Transfer Functions (T)

Control Force

Command Following (Link 1 Angle)for a Unit Step Input

Controller Comparison

Page 33: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

kt

Varying kt a Little Would Result in an Unstable Closed Loop System, for the H Controller

kt

Controller Comparison: Robustness to Flexibility Uncertainty. Varying kt

Page 34: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

b2

When Using H (2) Controller, b2 Can Be Increased 3000% From Its Nominal Value Before Getting The System Unstable

b2

b2

Controller Comparison: Robustness to Flexibility Uncertainty. Varying b2

Page 35: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

Closing the Loop and Selecting the LQG/LTR Controller

Selecting a Unit Step Command Input to The System

The MoSART FIP Environment PlotsAgree With The MATLAB Plots

Simulation of Closed-Loop System Response for a Step Command Input (LQG/LTR Controller)

Page 36: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

Controller Comparison

Page 37: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

• Versatile system-specific interactive MoSART environments

• Windows / C++ / Direct-X / MATLAB

• User friendly: accessible & intuitive

• User can alter model structures & parameters (on-the-fly)

• Highly extensible: ability to incorporate new simulation/animation models

Summary

Page 38: Interactive Modeling, Simulation, Animation, and Real-Time Control (MoSART) Flexible Inverted Pendulum Environment aar/research/mosart.

Future Directions

… development of Facility

http://www.eas.asu.edu/~aar/research/mosart/Presentations/

VISIT:

-More visual indicators

-Advanced SIM and GAM (e.g. TLHS)

-Expanded HIM: web support, multimedia

-Develop Model Documentation Feature

-Enhanced integration with MATLAB / SIMULINK

LABVIEW / Excel….all are ActiveX Compatible

-Integrated design & analysis environment

-Develop Additional Environments