modeling and control - publish.illinois.edu

24
Modeling and Control 12 Feb

Upload: others

Post on 04-Apr-2022

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Modeling and Control - publish.illinois.edu

Modeling and Control12 Feb

Page 2: Modeling and Control - publish.illinois.edu

DARPA Robotics Challenge

β€’ 4 points taskβ€’ Robot drives the vehicle through the

course (1)β€’ Robot gets out of the vehicle and

travels dismounted out of the end zone (2)

β€’ Bonus point (1)

Page 3: Modeling and Control - publish.illinois.edu
Page 4: Modeling and Control - publish.illinois.edu

Control?

The process of causing a system variable to conform to some desired value

Page 5: Modeling and Control - publish.illinois.edu

Example: Cruise Control

AutoBody

Speedometer

Engine??Actualspeed

Controlvariable

Throttle

Measuredspeed

Controller

Desiredspeed

Page 6: Modeling and Control - publish.illinois.edu

What do we want to control?

What can we use?

-> Car position and orientation

-> Steering wheel and pedal(s)

Page 7: Modeling and Control - publish.illinois.edu

GEM system

Lane detection

Pedestrian detect. &

localization

GPS / localization

Camera

Pedestrian intent (PIE)

Decision making(DM)

Steering, throttle,

control (LCM)

Online monitoring

(OMM)

Vehicle model

Steering speed

odometryVehicle bus

Fusion: vehicle, pedestrian,

lanes localization

Sensor Perception Decision Control

Page 8: Modeling and Control - publish.illinois.edu

Dynamical system models

Physical plantDubin’s car model

𝑑𝛿

𝑑𝑑= 𝑣𝛿

π‘‘πœ“

𝑑𝑑=

𝑣

𝑙tan 𝛿

αˆΆπ‘£ = π‘Ž

𝑑𝑠π‘₯

𝑑𝑑= 𝑣 cos πœ“

𝑑𝑠𝑦

𝑑𝑑= 𝑣 sin(πœ“)

Steering angle

Heading angle

Speed

Horizontal position

𝑑π‘₯

𝑑𝑑= 𝑓 π‘₯, 𝑒

π‘₯ = [𝑣, 𝑠π‘₯ , 𝑠𝑦, 𝛿, πœ“]

𝑒 = [π‘Ž, 𝑣𝛿]

State variables

Control inputs

Nonlinear dynamics

Vertical positionπ‘₯ 𝑑 + 1 = 𝑓 π‘₯ 𝑑 , 𝑒[𝑑]

System dynamics

Generally, nonlinear ODEs do not have closed form solutions!

Page 9: Modeling and Control - publish.illinois.edu

Nonlinear hybrid dynamics

9

merge left

cruise

merge right

speed up

close to front car

slow down

speeding

Decision and control software Physical plant

𝑑π‘₯

𝑑𝑑= 𝑓 π‘₯, 𝑒

π‘₯ = [𝑣, 𝑠π‘₯ , 𝑠𝑦, 𝛿, πœ“]

𝑒 = [π‘Ž, 𝑣𝛿]

State variables

Control inputs

π‘₯ 𝑑 + 1 = 𝑓 π‘₯ 𝑑 , 𝑒[𝑑]

System dynamics

Page 10: Modeling and Control - publish.illinois.edu

Hybrid system model

Nonlinear hybrid dynamics

Physical plant

𝑑π‘₯

𝑑𝑑= π‘“π‘šπ‘œπ‘‘π‘’ π‘₯, 𝑒

merge left𝑑π‘₯

𝑑𝑑= 𝑓𝑙𝑒𝑓𝑑(π‘₯, 𝑒)

cruise𝑑π‘₯

𝑑𝑑= π‘“π‘π‘Ÿπ‘ (π‘₯, 𝑒)

merge right𝑑π‘₯

𝑑𝑑= π‘“π‘Ÿπ‘–π‘”β„Žπ‘‘(π‘₯, 𝑒)

speed up𝑑π‘₯

𝑑𝑑= 𝑓𝑒𝑝(π‘₯, 𝑒)

slow down𝑑π‘₯

𝑑𝑑= π‘“π‘‘π‘œπ‘€π‘›(π‘₯, 𝑒)

Decision and control software

Interaction between computation and physics can lead to unexpected behaviors

Page 11: Modeling and Control - publish.illinois.edu

Simplified view of a plant and a controller

Physical plant

𝑑π‘₯

𝑑𝑑= 𝑓 π‘₯, 𝑒, 𝑑

Controller

𝑒 = 𝑔 π‘₯, 𝑑

𝑑π‘₯

𝑑𝑑= 𝑓 π‘₯, 𝑔 π‘₯ , 𝑑

ሢπ‘₯ = 𝑓 π‘₯, 𝑔 π‘₯ , 𝑑

Page 12: Modeling and Control - publish.illinois.edu

Model?

A set of mathematical relationships among the system variables

Page 13: Modeling and Control - publish.illinois.edu

Dynamical Systems Model

Describe behavior in terms of instantaneous laws𝑑π‘₯ 𝑑

𝑑𝑑= 𝑓(π‘₯ 𝑑 , 𝑒 𝑑 , 𝑑)

𝑑 ∈ ℝ, π‘₯ 𝑑 ∈ ℝ𝑛, 𝑒 𝑑 ∈ β„π‘š

𝑓:ℝ𝑛 Γ— β„π‘š Γ— ℝ β†’ ℝ𝑛dynamic function

Page 14: Modeling and Control - publish.illinois.edu

Example: Pendulum

Pendulum equation

π‘₯1 = πœƒ π‘₯2 = αˆΆπœƒ

π‘₯2 = ሢπ‘₯1

ሢπ‘₯2 = βˆ’π‘”

𝑙sin π‘₯1 βˆ’

π‘˜

π‘šπ‘₯2

ሢπ‘₯2ሢπ‘₯1

= βˆ’

𝑔

𝑙sin π‘₯1 βˆ’

π‘˜

π‘šπ‘₯2

π‘₯2

π‘˜: friction coefficient

𝑙

πœƒ

π‘š

What is described?

-> Center of mass movement relative to the origin

Page 15: Modeling and Control - publish.illinois.edu

Coordinate system

β€’ Configuration (pose) of robot can be described by position and orientation.

Car pose = π‘₯π‘¦πœƒ

X

YEnd effector pose =

π‘₯π‘¦π‘§πœƒπ‘₯πœƒπ‘¦πœƒπ‘§

Page 16: Modeling and Control - publish.illinois.edu

Translation along the X-Axis and Y-Axis

X

NVN

VO

O

Y

ሜPXY + ሜVNO =PX + VN

PY + VO

ሜPXY =PxPY

ሜVNO = VN

VO

ሜVXY =

Page 17: Modeling and Control - publish.illinois.edu

β€’ Rotation matrix

𝑅 πœƒ =π‘π‘œπ‘ πœƒ βˆ’π‘ π‘–π‘›πœƒπ‘ π‘–π‘›πœƒ π‘π‘œπ‘ πœƒ

β€’ An orthogonal (orthonormal) matrixβ€’ Each column is a unit length vectorβ€’ Each column is orthogonal to all other columns

β€’ The inverse is the same as the transpose𝑅(ΞΈ)βˆ’1 = 𝑅(ΞΈ)𝑇

β€’ The determinant is 1β€’ Special Orthogonal group of dimension 2

𝑅(ΞΈ) ∈ 𝑆𝑂{2}

Rotation (Z-Axis)

X

Y

V

VX

VY

ሜVXY = VX

VYሜVNO = VN

VO

= Angle of rotation between the XY and NO coordinate axis

ሜVXY = VX

VY=

cosΞΈ βˆ’sinΞΈsinΞΈ cosΞΈ

VN

VO

Page 18: Modeling and Control - publish.illinois.edu

Transformation

X1

Y1

VXY

X0

Y0

VNO

P

VXY = VX

VY=

PxPy

+cosΞΈ βˆ’sinΞΈsinΞΈ cosΞΈ

VN

VO

(VN,VO)

Translation along P followed by rotation by

Page 19: Modeling and Control - publish.illinois.edu

TurtleSim

β€’ Turtle simulator

β€’ simple way to learn the basics of ROS

β€’ a ROS package, part of the ROS installation

β€’ Explore the nodes, topics, messages, and services ( roscore, rosnode, and rostopic commands)

Page 20: Modeling and Control - publish.illinois.edu

Is ROS important?

Page 21: Modeling and Control - publish.illinois.edu

Locomotion of Wheeled System

Differential Drive Model Rear Wheel Model

Page 22: Modeling and Control - publish.illinois.edu

Differential Drive Model

X1

Y1

X0

Y0

(π‘₯, 𝑦)

w

R l

π‘£π‘Ÿ

𝑣𝑙

Instantaneous Center of Curvature= [π‘₯ βˆ’ 𝑅 𝑠𝑖𝑛 πœƒ , 𝑦 + 𝑅 π‘π‘œπ‘  πœƒ] = [𝐼𝐢𝐢π‘₯ , 𝐼𝐢𝐢𝑦]

πœ”(𝑅 + 𝑙/2) = π‘£π‘Ÿπœ”(𝑅 βˆ’ 𝑙/2) = 𝑣𝑙

𝑅 =𝑙

2

(π‘£π‘Ÿ + 𝑣𝑙 )

(π‘£π‘Ÿ βˆ’ 𝑣𝑙 )

πœ” =π‘£π‘Ÿ βˆ’ 𝑣𝑙

𝑙

Page 23: Modeling and Control - publish.illinois.edu

Rear Wheel Model (Dubin’s model)

X1

Y1

X0

Y0

𝛿

𝑙

(π‘₯, 𝑦)

ሢπ‘₯ = 𝑣 π‘π‘œπ‘ πœƒ

αˆΆπ‘¦ = 𝑣 π‘ π‘–π‘›πœƒ

αˆΆπœƒ =𝑣

π‘™π‘‘π‘Žπ‘›π›Ώ

Car (real wheel) pose = π‘₯π‘¦πœƒ

Car length = 𝑙

Car (front wheel) steering angle = Ξ΄

Car speed = 𝑣

Page 24: Modeling and Control - publish.illinois.edu

Rear Wheel Model (Dubin’s model)

X1

Y1

X0

Y0

𝛿

𝑙

(π‘₯, 𝑦)

ሢπ‘₯ = 𝑣 π‘π‘œπ‘ πœƒ

αˆΆπ‘¦ = 𝑣 π‘ π‘–π‘›πœƒ

αˆΆπœƒ =𝑣

π‘™π‘‘π‘Žπ‘›π›Ώ

Car (real wheel) pose = π‘₯π‘¦πœƒ

Car length = 𝑙

Car (front wheel) steering angle = Ξ΄

Car speed = 𝑣

R

π‘…π‘‘πœƒ = π‘‘π‘π‘Ÿ

π‘…π‘‘πœƒ

𝑑𝑑=π‘‘π‘π‘Ÿπ‘‘π‘‘

π‘‘π‘Žπ‘›π›Ώ =𝑙

𝑅

𝛿

= 𝑣

𝑅 =𝑙

π‘‘π‘Žπ‘›π›Ώ