chapter 7 control - cs.cmu.edu

83
Chapter 7 Control Part 2 7.2 State Space Control Mobile Robotics - Prof Alonzo Kelly, CMU RI 1

Upload: others

Post on 16-Oct-2021

16 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Chapter 7 Control - cs.cmu.edu

Chapter 7 Control

Part 2 7.2 State Space Control

Mobile Robotics - Prof Alonzo Kelly, CMU RI 1

Page 2: Chapter 7 Control - cs.cmu.edu

Outline • 7.2 State Space Control

– 7.2.1 Introduction – 7.2.2 State Space Feedback Control – 7.2.3 Example: Robot Trajectory Following – 7.2.4 Perception Based Control – 7.2.5 Steering Trajectory Generation – Summary

Mobile Robotics - Prof Alonzo Kelly, CMU RI 2

Page 3: Chapter 7 Control - cs.cmu.edu

Outline • 7.2 State Space Control

– 7.2.1 Introduction – 7.2.2 State Space Feedback Control – 7.2.3 Example: Robot Trajectory Following – 7.2.4 Perception Based Control – 7.2.5 Steering Trajectory Generation – Summary

Mobile Robotics - Prof Alonzo Kelly, CMU RI 7

Page 4: Chapter 7 Control - cs.cmu.edu

7.2 State Space Control

• Looks deeper at system behavior by exposing the states

• Tries to control the entire state vector

Mobile Robotics - Prof Alonzo Kelly, CMU RI 8

u yuGxFx +=

x

uMxHy +=x

Page 5: Chapter 7 Control - cs.cmu.edu

7.2.1 Introduction (State Space Model)

• Recall the linear TI case:

• x is n X 1 • u is r X 1 • y is m X 1

Mobile Robotics - Prof Alonzo Kelly, CMU RI 9

Page 6: Chapter 7 Control - cs.cmu.edu

7.2.1.1 Controllability • Completely controllable if there is a u(t) that

drives the system: – From any x(t1) – To any x(t2) – In finite time Dt = t2-t1.

• Totally controllable if Dt can be made as small as desired.

• Some use the word reachability for this concept.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 10

Page 7: Chapter 7 Control - cs.cmu.edu

7.2.1.1 Controllability (Controllability Condition)

• Totally controllable iff this n X nm matrix:

• … is of full rank. • If F(t) and G(t) depend on time, Q can only

lose rank at isolated points in time.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 11

Page 8: Chapter 7 Control - cs.cmu.edu

7.2.1.2 Observability • Completely observable if x(t1) is fully

determined by knowledge of – u(t) and – y(t) – on an interval [t1, t2] where t2 > t1 : – In finite time ∆t = t2-t1.

• Totally observable if ∆t = t2-t1 can be made as small as desired.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 12

Page 9: Chapter 7 Control - cs.cmu.edu

7.2.1.2 Observability (Observability Condition)

• Totally observable iff this mn X n matrix:

• … is of full rank. • If F(t) and G(t) depend on time, P can only

lose rank at isolated points in time.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 13

Page 10: Chapter 7 Control - cs.cmu.edu

Outline • 7.2 State Space Control

– 7.2.1 Introduction – 7.2.2 State Space Feedback Control – 7.2.3 Example: Robot Trajectory Following – 7.2.4 Perception Based Control – 7.2.5 Steering Trajectory Generation – Summary

Mobile Robotics - Prof Alonzo Kelly, CMU RI 14

Page 11: Chapter 7 Control - cs.cmu.edu

Feedback Control in State Space • Two options: state and output feedback. • Only the second seems relevant (since only y

is accessible by definition) • However:

– Full state feedback is theoretically relevant – Sometimes you can measure all states – Often, you can reconstruct the states.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 15

Page 12: Chapter 7 Control - cs.cmu.edu

7.2.2.1 State Feedback

Mobile Robotics - Prof Alonzo Kelly, CMU RI 16

∫ dtu

dux y

G

F

H+

+

M

+

K

v +

- W+

Page 13: Chapter 7 Control - cs.cmu.edu

7.2.2.1 State Feedback • Upon substitution, • the new linear system is:

• Can show: – Controllability is unaltered if

W is full rank – Observability can be altered

or even lost (i.e if H=MK). Mobile Robotics - Prof Alonzo Kelly, CMU RI 17

∫ dtu

dux y

G

F

H+ +

M

+

K

v+

- W +

Page 14: Chapter 7 Control - cs.cmu.edu

7.2.2.2 Eigenvalue Assignment • Equivalent to pole placement. • Consider time invariant case. Stability

depends on eigenvalues of new dynamics matrix F-GK:

• If original system is controllable, these e-values can be placed arbitrarily by suitable choice of the gain matrix K.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 18

Page 15: Chapter 7 Control - cs.cmu.edu

7.2.2.3 Output Feedback

Mobile Robotics - Prof Alonzo Kelly, CMU RI 19

∫ dtu

dux y

G

F

H+

+

M

+

K

v +

- W+

Page 16: Chapter 7 Control - cs.cmu.edu

7.2.2.3 Output Feedback • Upon substitution, • the new linear system is:

• Can show: – Controllability is unaltered if W and [Ir + KM]-1

are of full rank – Observability is preserved.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 20

∫ dtu

dux y

G

F

H+ +

M

+

K

v+

- W +

Page 17: Chapter 7 Control - cs.cmu.edu

7.2.2.4 Eigenvalue Assignment • If original system …

– is completely controllable –and H is full rank

• m of these e-values can be placed arbitrarily by suitable choice of the gain matrix K.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 21

Page 18: Chapter 7 Control - cs.cmu.edu

7.2.2.5 Observers • Clearly, output feedback is inferior.

• Can we:

– reconstruct the state from the measurements? – Use the reconstructed state as state feedback.

• Surprisingly, yes.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 22

Page 19: Chapter 7 Control - cs.cmu.edu

7.2.2.5 Observers

• Almost every mobile robot looks like this. • The observer is the state estimation system.

– Hence, the Kalman filter.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 23

u y

uMxHyuGxFx

+=+=

K

v +

- W

)ˆ(ˆˆ yyKuGxFx oo −++=x

uMxHy oo += ˆˆ

Page 20: Chapter 7 Control - cs.cmu.edu

7.2.2.5 Observers • The predicted output is:

• The observer dynamics have one extra input – the

output prediction error:

• Subtract this from real system dynamics (assuming matrices match)

Mobile Robotics - Prof Alonzo Kelly, CMU RI 24

y Hox Mou+=

tdd x Fox Gou Ko y y–( )+ += Ko is TBD

tdd x x–( ) F x x–( ) Ko y y–( )–=

Same form as a controller!

Page 21: Chapter 7 Control - cs.cmu.edu

7.2.2.5 Observers • If the error dynamics are controllable, we

can drive the state estimate to agree with the state in an arbitrarily short period of time. – Assuming measurements and matrices are

known perfectly.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 25

tdd x x–( ) F x x–( ) Ko y y–( )–=

Same form as a controller!

Page 22: Chapter 7 Control - cs.cmu.edu

7.2.2.6 Control of Nonlinear Systems • All mobile robots are nonlinear

–Because the sensors and actuators are on the robot.

• So…. Why study all this linear system stuff?

Mobile Robotics - Prof Alonzo Kelly, CMU RI 26

Page 23: Chapter 7 Control - cs.cmu.edu

7.2.2.6 Control of Nonlinear Systems • All mobile robots are nonlinear

–Because the sensors and actuators are on the robot.

• So…. Why study all this linear system stuff? –Control the linearized (error) dynamics.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 27

Page 24: Chapter 7 Control - cs.cmu.edu

7.2.2.6 Control of Nonlinear Systems (Two DOF Design)

• Aka Feedforward with feedback trim…. – Feed forward the reference trajectory open

loop control. – Use feedback to reject disturbances etc.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 28

Nonlinear System

Linearized Error Dynamics

Page 25: Chapter 7 Control - cs.cmu.edu

Outline • 7.2 State Space Control

– 7.2.1 Introduction – 7.2.2 State Space Feedback Control – 7.2.3 Example: Robot Trajectory Following – 7.2.4 Perception Based Control – 7.2.5 Steering Trajectory Generation – Summary

Mobile Robotics - Prof Alonzo Kelly, CMU RI 29

Page 26: Chapter 7 Control - cs.cmu.edu

7.2.3.1 Representing Trajectories • Assume velocity is fwd

along body x only • States: • Inputs: • Nonlinear state space

model in terms of time.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 32

But notice speed V can be factored out.

n

s

δθ

δn

Page 27: Chapter 7 Control - cs.cmu.edu

7.2.3.1 Representing Trajectories • This means we can rewrite

the dynamics in terms of distance

• Nonlinear state space model in terms of distance.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 33

Division by V is only a problem if you insist on a curvature for every time.

n s

δθ

δn

Page 28: Chapter 7 Control - cs.cmu.edu

7.2.3.2 Robot Trajectory Following • States: • Inputs: • Nonlinear state space model:

• Suppose a trajectory generator has produced a reference:

• Assume full state feedback.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 34

n s

δθ

δn

Page 29: Chapter 7 Control - cs.cmu.edu

7.2.3.2.1 Linearization and Controllability • Linearized Dynamics:

• Convert coordinates to path tangent frame.

• Of the form:

Mobile Robotics - Prof Alonzo Kelly, CMU RI 35

Very Simple System Linear

Time Invariant for constant V

n s

δθ

δn

Page 30: Chapter 7 Control - cs.cmu.edu

7.2.3.2.1 Linearization and Controllability • Controllable?

Mobile Robotics - Prof Alonzo Kelly, CMU RI 36

n s

δθ

δn

Page 31: Chapter 7 Control - cs.cmu.edu

7.2.3.2.1 Linearization and Controllability • Controllable?

Mobile Robotics - Prof Alonzo Kelly, CMU RI 37

n s

δθ

δn

Page 32: Chapter 7 Control - cs.cmu.edu

7.2.3.2.2 State Feedback Control Law • State Feedback

• We know speed can

control s and steering can control n and θ so:

Mobile Robotics - Prof Alonzo Kelly, CMU RI 38

n s

δθ

δn

Page 33: Chapter 7 Control - cs.cmu.edu

7.2.3.2.2 State Feedback Control Law (Total Control Law)

Mobile Robotics - Prof Alonzo Kelly, CMU RI 39

Feedforward (path curvature and speed)

Feedback P and PD controllers

Page 34: Chapter 7 Control - cs.cmu.edu

7.2.3.2.3 Behavior (Open Loop Servo Execution)

• While simple in principle, open loop execution does not reject disturbances.

• Even a single initial error can grow forever if not compensated.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 40

κd s( ) κ smeasured( )=

Page 35: Chapter 7 Control - cs.cmu.edu

7.2.3.2.3 Behavior (Distance Based Open Loop Control)

• Ignore speed by converting to distance as the independent variable.

• Recall, this implies a particular path through space because:

Mobile Robotics - Prof Alonzo Kelly, CMU RI 41

θ s( ) θ0 κ sd0

s

∫+=

x s( ) θ s( )[ ]cos sd0

s

∫=

y s( ) θ s( )[ ]sin sd0

s

∫=

𝜓𝜓 𝜓𝜓

Page 36: Chapter 7 Control - cs.cmu.edu

7.2.3.2.3 Behavior (Heading Error Compensation)

• Passes original command directly to output. • Bends the response path to be parallel to the

desired. • BUT: Does not move paths together.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 42

κ d s( ) κ smeasured( ) ∆κ+=

Pass original command to output

Plus a correction 𝛿𝛿𝜓𝜓

∆𝜅𝜅 = ∆𝜓𝜓/L

Page 37: Chapter 7 Control - cs.cmu.edu

7.2.3.2.3 Behavior (Full Pose Error Compensation)

• Passes original command directly to output. • ∆x is coordinate of closest point in body coords. • Also adds two corrective amounts intended to

remove present error.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 43

∆κ 2∆x L2⁄=

𝛿𝛿𝜓𝜓

∆𝜅𝜅 = ∆𝜓𝜓/L

Page 38: Chapter 7 Control - cs.cmu.edu

7.2.3.2.4 Eigenvalue Placement • New closed loop

dynamics matrix: • Characteristic poly:

Mobile Robotics - Prof Alonzo Kelly, CMU RI 44

Any coefficients are possible so….. Any roots are possible.

n s

δθ

δn

Page 39: Chapter 7 Control - cs.cmu.edu

7.2.3.2.5 Gains • Both curvature gains can be related to a

characteristic length.

• Then removes heading error after moving a distance L.

• And removes crosstrack error after travelling a distance L.

• Also is the time constant of speed error response.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 45

Page 40: Chapter 7 Control - cs.cmu.edu

Outline • 7.2 State Space Control

– 7.2.1 Introduction – 7.2.2 State Space Feedback Control – 7.2.3 Example: Robot Trajectory Following – 7.2.4 Perception Based Control – 7.2.5 Steering Trajectory Generation – Summary

Mobile Robotics - Prof Alonzo Kelly, CMU RI 46

Page 41: Chapter 7 Control - cs.cmu.edu

7.2.4 Perception Based Control (Visual Servoing)

• Observed feature residuals can be generated by: – Perceived errors in pose estimates in a region of

overlap (registration) or ... – Real errors in pose itself in a positioning task.

• In the latter case, it is natural to close a servo loop and drive the system to move to reduce the error. This is visual servoing.

• Must maintain feature correspondences during motion: – Embedded feature tracking problem.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 47

Page 42: Chapter 7 Control - cs.cmu.edu

7.2.4 Perception Based Control (Visual Servoing : Architecture : Errors)

• Image-based control forms errors in image space. – Servoing done in image space

• Position-based control forms errors from object poses: – Poses derived from image features – Servoing done in pose space.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 48

Page 43: Chapter 7 Control - cs.cmu.edu

7.2.4 Perception Based Control (Visual Servoing : Architecture : Camera Position)

• Camera may be moving or stationary. • Required motions are reversed with respect to

each other.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 49

Page 44: Chapter 7 Control - cs.cmu.edu

7.2.4.1 Error Coordinates (Image Based Visual Servoing)

• Problem: drive the system (usually with a camera attached) to turn the present image into the desired image.

• An excellent way to drive up to something with a poor pose estimate.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 50

-

+ r

yControl System

Perception

y

?

Present Image Reference Image

Base Sensor Base Sensor

z

Page 45: Chapter 7 Control - cs.cmu.edu

51

BASE TOOL

Mobile Robotics - Prof Alonzo Kelly, CMU RI

Page 46: Chapter 7 Control - cs.cmu.edu

Pose Determination

-

+

7.2.4.1 Error Coordinates (Image Based Visual Servoing)

• Explicitly calculate the pose of the object relative to the camera.

• Compute the error in the pose.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 52

ry

Control System

Perception

y

Trajectory Generation

z

Page 47: Chapter 7 Control - cs.cmu.edu

7.2.4.2 Visual Servoing (Image Formation Model)

• Observations / measurements z depend on the pose r of the camera w.r.t. the object.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 53

z h ρ t( )( )=

Page 48: Chapter 7 Control - cs.cmu.edu

7.2.4.2 Visual Servoing (Image Formation Model)

• k adequate features in z with which to control the m dof of the system.

• Usually: • A goal image space configuration zr:

• Regulate the error: zr - z :

• Typically track features at near video rate.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 54

k m≥ m 6≤

Page 49: Chapter 7 Control - cs.cmu.edu

7.2.4.4 Controller Design (Basic Controller)

• Observable features z depend in a predictable way on the camera projection model h(_) and the pose of the target object wrt the camera:

• z could also be interpreted simply as the pose relative to the target in a position-based approach.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 55

ρ t( )

z h ρ t( )( )=

Page 50: Chapter 7 Control - cs.cmu.edu

7.2.4.4 Controller Design (Basic Controller)

• Taking the time derivative:

• Also, by definition:

• We might solve this with the LPI:

• If ∆z is the feature error, then:

Mobile Robotics - Prof Alonzo Kelly, CMU RI 56

z h ρ t( )( )=

ρ∂∂h

tddρ

Lfv t( )= =

Jacobian Lf is called the interaction matrix.

∆z Lf∆ρ=

∆ρ Lf+∆z=

Eqn A

Pose error that explains the feature error to first order.

Page 51: Chapter 7 Control - cs.cmu.edu

7.2.4.4 Controller Design (Basic Controller)

• Divide by a small Dt to get:

• Suppose we would like the feature rate to be consistent with nulling the error in t (1/l) seconds.

• Substituting above:

Mobile Robotics - Prof Alonzo Kelly, CMU RI 57

Pose velocity Feature error rate

A VISUAL SERVO !

Page 52: Chapter 7 Control - cs.cmu.edu

7.2.4.4 Controller Design (Basic Controller)

• This is a proportional controller with gain:

• Drives observed feature errors exponentially to zero.

• Substituting the control into the dynamics gives the closed loop error dynamics:

Mobile Robotics - Prof Alonzo Kelly, CMU RI 58

Kp λ 1 τ⁄= =

Eqn A

Page 53: Chapter 7 Control - cs.cmu.edu

7.2.4.4 Controller Design (Behavior)

• Case 1: perfect behavior

• Case 2: error decreases

• Case 3: error increases

• Ideally: – Lf is not singular anywhere. – There are no non-optimum local minima.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 59

LfLf+ I=

LfLf+ 0>

LfLf+ 0<

Page 54: Chapter 7 Control - cs.cmu.edu

Videos

Mobile Robotics - Prof Alonzo Kelly, CMU RI 60

Moment Visual Servoing Face Visual Servoing

Page 55: Chapter 7 Control - cs.cmu.edu

Outline • 7.2 State Space Control

– 7.2.1 Introduction – 7.2.2 State Space Feedback Control – 7.2.3 Example: Robot Trajectory Following – 7.2.4 Perception Based Control – 7.2.5 Steering Trajectory Generation – Summary

Mobile Robotics - Prof Alonzo Kelly, CMU RI 61

Page 56: Chapter 7 Control - cs.cmu.edu

7.2.5 Steering Trajectory Generation (Trajectory Generation)

• Trajectory generation is necessary for any kind of precision control of mobile robots.

• The problem occurs in various forms: – “Steering” (curvature generation) problem. – “Smooth stopping” (velocity profile) problem. – Both at once

• Sometimes in terms of linear and angular velocity.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 62

Page 57: Chapter 7 Control - cs.cmu.edu

7.2.5 Steering Trajectory Generation (Definitions)

• Let a trajectory be a specification of an entire motion. – Could be explicitly in terms of state:

– Could be implicitly in terms of inputs:

– Need both for 2 dof control

• Both can be visualized as the trajectory followed by the tip of a vector over time. Mobile Robotics - Prof Alonzo Kelly, CMU RI 63

x t( ) t0 t tf< <( ){ }

u t( ) t0 t tf< <( ){ }

Page 58: Chapter 7 Control - cs.cmu.edu

7.2.5 Steering Trajectory Generation (Motivation)

• Load cannot be approached sideways. • Visualize driving backward from goal. • Maneuver must initially turn away from the

pallet. • Underactuation causes this.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 64

Pallet

Forktruck

F1

F2

P

Page 59: Chapter 7 Control - cs.cmu.edu

7.2.5 Steering Trajectory Generation (Motivation : Precision Control)

• Precision control is necessary: – when goals states

must be achieved precisely

– when paths must be followed precisely.

• That happens in cluttered environments, for example.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 65

The robot must not only follow the intended curves but it must come to a stop neither too early (which would make achieving the next goal impossible) nor too late (which will cause a collision).

Must stop precisely here.

Page 60: Chapter 7 Control - cs.cmu.edu

7.2.5 Steering Trajectory Generation (Motivation : Reduced Following Error)

• Trajectory generation can compensate for the predictable causes of following error.

• Using trajectory generation, you can decide what to ask for, in order to get what you want.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 66

Command Response

The nonideal response to a dis- continuous curvature control can be visualized in either input space or state space.

Page 61: Chapter 7 Control - cs.cmu.edu

7.2.5 Steering Trajectory Generation (Motivation : Corrective Trajectories)

• Control layers above the coordinated control layer…. – Have easier jobs to do

with a trajectory generator to talk to.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 67

The best recovery trajectory is one which reacquires the path at the correct heading and curvature.

Page 62: Chapter 7 Control - cs.cmu.edu

7.2.5.1 Problem Specification • Dynamics:

• Physical constraints:

– Turn radius bounded from below – Curvature is bounded by mechanisms and terrain

friction.

• Boundary conditions:

Mobile Robotics - Prof Alonzo Kelly, CMU RI 68

u t( ) umax t( )≤ u· t( ) u·max t( )≤

x t0( ) x0=

x tf( ) xf=

Page 63: Chapter 7 Control - cs.cmu.edu

7.2.5.1 Problem Specification (Constraint : Dynamics)

• For a system:

• Problem: determine an entire control function u(t) which generates some desired state trajectory x(t).

• It’s the problem of inverting a differential equation.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 69

1–f

Page 64: Chapter 7 Control - cs.cmu.edu

7.2.5.2 Formulation as a Rootfinding Problem (Existence)

• Every u(t) generates some x(t)...

• However, many arbitrary x(t)’s represent infeasible motions. – Mathematical reasons – underactuation – Physics reasons - friction – Power related reasons - horsepower

Mobile Robotics - Prof Alonzo Kelly, CMU RI 70

x t( ) x 0( ) f x u t, ,( ) td0t∫+=

Page 65: Chapter 7 Control - cs.cmu.edu

7.2.5.2 Formulation as a Rootfinding Problem (Parameterization)

• Function space of all u(t) is too large to search. • Parameterize inputs: • Easy to see by Taylor series that p spans all

possible u(t) – Pick any uk(t) you like. – Write its Taylor series – Coefficients pk approximate uk (t) arbitrarily well. – But uk (t) was arbitrary too so pk spans everything!

Mobile Robotics - Prof Alonzo Kelly, CMU RI 71

u t( ) u p t,( )→

Page 66: Chapter 7 Control - cs.cmu.edu

7.2.5.2 Formulation as a Rootfinding Problem (Parameterization)

• Now p determines u(t) which determines x(t), so dynamics become:

• The boundary conditions become:

• This is conventionally written as:

Mobile Robotics - Prof Alonzo Kelly, CMU RI 72

Integrals are suppressed notationally – but they are still there.

x· t( ) f x p t,( ) u p t,( ) t,,[ ] f p t,( )= =

g p t0 tf, ,( ) x t0( ) f p t,( ) tdt0

tf

∫+ xb= =

c p t0 tf, ,( ) h p t0 tf, ,( ) xb– 0= =

Page 67: Chapter 7 Control - cs.cmu.edu

7.2.5.2 Formulation as a Rootfinding Problem (Parameterization)

• Wait a minute!:

• That is a rootfinding problem! • Conclusion:

– the problem of inverting a nonlinear vector differential equation

– can be converted to a rootfinding problem – using parameterization.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 73

c p t0 tf, ,( ) 0=

Page 68: Chapter 7 Control - cs.cmu.edu

7.2.5.3 Steering Trajectory Generation • Switch to steering problem and ignore

velocity. • Often it is convenient to change the

independent variable from time to distance.

• Let the initial distance s0 be zero and absorb the final distance into the parameter vector, thus:

Mobile Robotics - Prof Alonzo Kelly, CMU RI 74

q pT sf,[ ]T

=p became longer but t0 and tf have been eliminated.

Page 69: Chapter 7 Control - cs.cmu.edu

7.2.5.3 Steering Trajectory Generation (Degrees of Freedom)

• If u(p,sf) has n parameters, these can be used to satisfy n constraints.

• For example, an arc trajectory really has two parameters – radius and length.

• Imagine the circles moving outward until they hit the point.

• Its not too hard to find the radius and distance which hit the point.

• Terminal heading and curvature are beyond your control.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 75

Page 70: Chapter 7 Control - cs.cmu.edu

7.2.5.3 Steering Trajectory Generation (Clothoids)

• Another historically popular curve is the clothoid. It’s a linear curvature polynomial:

• This has 3 degrees of freedom but its still not enough for some problems.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 76

κ s( ) a bs+=

Page 71: Chapter 7 Control - cs.cmu.edu

7.2.5.3 Steering Trajectory Generation (Polynomial Spirals)

• We can without loss of generality consider the initial pose to be at the origin.

• If initial and final curvature matter, that leaves FIVE constraints:

• A curve with 5 dof is a cubic spiral:

Mobile Robotics - Prof Alonzo Kelly, CMU RI 77

x sf( ) xf=y s f( ) yf=θ s f( ) θf=

κ 0( ) κ0=

κ s f( ) κf=

κ s( ) a bs cs 2 ds 3+ + += The parameter sf must be distinguished from the variable s. The 5th parameter sf does not appear.

Page 72: Chapter 7 Control - cs.cmu.edu

7.2.5.3 Steering Trajectory Generation (Polynomial Spirals)

• All cases mentioned so far are special cases of polynomials.

• This form of representation has several advantages: – Compact, just store

coefficients – General, any function can

be approximated. – Heading can be

computed in closed form.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 78

A Cubic Polynomial Spiral

Page 73: Chapter 7 Control - cs.cmu.edu

7.2.5.3 Steering Trajectory Generation (Polynomial Spirals)

• These curves can achieve any terminal posture.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 79

Page 74: Chapter 7 Control - cs.cmu.edu

Video

Mobile Robotics - Prof Alonzo Kelly, CMU RI 80

Page 75: Chapter 7 Control - cs.cmu.edu

7.2.5.4 Numerical Formulation (Terminal Posture Acquisition)

• There are 5 constraints:

• The initial curvature constraint is trivial to satisfy:

• Denote the remaining 4 parameters by:

Mobile Robotics - Prof Alonzo Kelly, CMU RI 81

κ0 x, f yf θf κf, , ,( )

a κ0=

q b c d s f

T=

Page 76: Chapter 7 Control - cs.cmu.edu

7.2.5.4 Numerical Formulation (Terminal Posture Acquisition)

• Now there are 4 complicated constraints on the 4 parameters:

Mobile Robotics - Prof Alonzo Kelly, CMU RI 82

κ q( ) κ0 bsf csf2

dsf3

+ + + κf= =

θ q( ) κ 0sfb2--- sf

2 c3--- sf

3 d4--- sf

4+ + + θf= =

x q( ) κ 0s b2---s2 c

3--- s3 d

4--- s4+ + +cos sd

0

sf

∫ xf= =

y q( ) κ 0s b2--- s2 c

3--- s3 d

4---s4+ + +sin sd

0

sf

∫ yf= =

Page 77: Chapter 7 Control - cs.cmu.edu

7.2.5.4 Numerical Formulation (Linearization)

• Despite the integrals, these are just 4 nonlinear equations of the form:

• Solve with a rootfinding technique like Newton’s method:

Mobile Robotics - Prof Alonzo Kelly, CMU RI 83

c q( ) g q( ) xb– 0= =

∆q cq1– c q( )– cq– 1– g q( ) xb–[ ]= =

Page 78: Chapter 7 Control - cs.cmu.edu

Demo • CuboidDemonstrator1.exe

Mobile Robotics - Prof Alonzo Kelly, CMU RI 84

Right click and open hyperink

Page 79: Chapter 7 Control - cs.cmu.edu

Video

Mobile Robotics - Prof Alonzo Kelly, CMU RI 85

Page 80: Chapter 7 Control - cs.cmu.edu

Video

Mobile Robotics - Prof Alonzo Kelly, CMU RI 86

Page 81: Chapter 7 Control - cs.cmu.edu

Outline • 7.2 State Space Control

– 7.2.1 Introduction – 7.2.2 State Space Feedback Control – 7.2.3 Example: Robot Trajectory Following – 7.2.4 Perception Based Control – 7.2.4 Steering Trajectory Generation – Summary

Mobile Robotics - Prof Alonzo Kelly, CMU RI 87

Page 82: Chapter 7 Control - cs.cmu.edu

Summary • State Space control is more powerful than

classical. – Theorems provide conditions for arbitrary

controllability.

• Observer theory reveals duality of controls and estimation.

• 2 dof control is a good way to follow trajectories. • Parameterization is a good way to generate them

for open loop control. • Linearization is effective for nonlinear control.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 88

Page 83: Chapter 7 Control - cs.cmu.edu

Summary • Visual servoing implements a closed loop using

vision as the feedback sensor. • A basic version tries to drive an image into

coincidence with some reference image by: – forming errors in image space. – deriving corrective velocity commands from the

errors.

Mobile Robotics - Prof Alonzo Kelly, CMU RI 89