control systems kon-c2004 mechatronics basics tapio lantela, nov 5th, 2015

41
Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

Upload: cameron-reynolds

Post on 20-Jan-2016

223 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

Control systems

KON-C2004 Mechatronics BasicsTapio Lantela, Nov 5th, 2015

Page 2: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

Lecture topics

• System modeling and response• Control systems• PID controller• Servo motors etc.

Page 3: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

Sensors

Actuators

SignalProcessing

Inputs

OutputsActuatorDrives

ControlComputer

User Interface

”Process”

Communication

Mechatronic device

Page 4: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

Example

Page 5: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

System response

Page 6: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

System

SystemInput Output

Page 7: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

Mathematical models of systems

Zero order

First order

Second order

Page 8: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

Second order system: DC motor

Electrical in time domain

Mechanical in time domain

Laplace transformation to Laplace domain

Transfer function

Page 9: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

Step response of a system

Overshoot

Rise time

Settling time

Steady state

Page 10: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

Parameters

Time constant – Represents 0-63 % rise time

Damping ratio - Damping ratio for underdamped < 1, critically damped = 1, overdamped >

1- Unstable when

Natural frequency - Frequency at which system oscillates without driving or damping force- Resonance happens when external force excites the system at natural

frequency

Page 11: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

Resonance

Page 12: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

System damping

Page 13: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

Control systems

Page 14: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

Requirements for a control system

The output of the process follows the reference with- Steady state accuracy- Transient accuracy

o Time constant, overshoot

- Stability

And the controller requires reasonable- Computational effort- Amount of knowledge of the process- Effort to tune

Page 15: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

Open loop control

Controlling the process without a knowledge of its state

Controller always stable

Do not reject disturbances- External forces- Aging of devices (change in friction) etc.- Changes in environment (temperature etc)

No sensors required

http://abrobotics.tripod.com/ControlLaws/cloverview.htm

Page 16: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

Closed loop (feedback) control

Modifying the control signal using information of the current output of the process

Negative feedback stabilises system

Positive feedback causes instability

Page 17: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

Feed forward control

Modifying the control signal according to some external parameters

http://science-hamza.blogspot.fi/2011/02/feed-forward-control-loops.html

Page 18: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

Stability

Stable system when bounded input -> bounded output

Problems are caused by- Inherently unstable systems- Delay in control loop- Very high control gains- Positive feedback

Page 19: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

Bang bang controller

Actuator at full positive or negative power

Very simple and often optimal in some ways

In some cases requires a system model for accuracy

Requires hysteresis to limit switching

Page 20: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

PID controller

Page 21: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

Back to the example

Page 22: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

PID controller

Proportional, Integral and Derivative terms

Page 23: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

PID controller (P term)

•Output proportional to error

•Large gain Kp -> fast response, overshoot, oscillation

•Small gain Kp -> slow response, large steady-state error

Page 24: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

PID controller (I term)

•Output proportional to time integral of error•Makes steady state error go to zero

•Large KI -> error decreases quickly, overshoot, oscillation

•Small KI -> error decreases slowly

Page 25: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

PID controller (D term)

•Output proportional to change rate of the error

•Kd can dampen the response

•If signal is noisy Kd may increase the interference

Page 26: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

Parameter effects

Overshoot Steady state error

Stability

KP + - -

KI + -> 0 -

KD - +/-

Page 27: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

Parameter effects

https://en.wikipedia.org/wiki/Control_system

Page 28: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

PID controller tuning

Finding the right gains- Experimenting with a real system – might be dangerous

• Apply input and observe

- Experimenting with a system model – might be tedious• Simulink model – curves – adjust gains

- Iterative optimization with a system model – requires cost function• Simulink model – Matlab optimization functions

- Analytical optimization with mathematical system model – might be difficult

• Transfer function – calculus

Page 29: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

Example: Microcontroller code for PI controller

if(PID_on){

reference = read_adc(0)/4; //Read reference from a potentiometer

error = reference-speed; //Calculate error

proportional = P*error; //Proportional part of control

integral = integral + I*error; //Integral part of control

control = proportional+integral; //Controller output

if(control<0){direction = 1;}else{direction = 0;} //Choose motor direction

}

PORTB.3 = direction; //Write to direction register

OCR1A = control; //Write to PWM register

Page 30: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

Actuator range and rate limitations

Real actuators have range and speed limitations

Actuator saturates -> modify control law

Anti-windup compensator

http://brettbeauregard.com/blog/2011/04/improving-the-beginner%E2%80%99s-pid-reset-windup/

Controller output

Actuator output

Page 31: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

Servomotors etc.

Page 32: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

Control theory areas

Model based control

Adaptive control

Optimal control

Robust control

Fuzzy control

Page 33: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

Analog vs digital controllers

Controllers implemented with digital devices do not work continuously

Analog controller can be implemented with operational amps- High frequency, integration differentiation, summing etc

Results slightly different in analog and digital controllers

Different analysis methods

Page 34: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

Control rate

In digital technology, there is no momentary speed, only average speed for some sample time• Control is not done continuously, but at regular intervals• Constant and small enough control intervals• Control frequency depends on time constant of the system• Rise time from one state to another minimum 5-10 control

loops• For a motor about every 10 ms

Page 35: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

Servomotor control system

Goal:• Motor that spins at the required speed regardless of load or

disturbances• Actuator keeps the required position regardless of load or

disturbances

Page 36: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

Analogue control system

Digital control system

Lawrence & Mauch, Real-TimeMicrocomputer System Design

Servo control systems

Page 37: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

Sensors for a servo motor

• Optical encoders• Incremental of absolute

• Resolvers & Synchros• Rotating transformers which measure position

• Tachogenerators• ”Inverse motor”, measures rotating speed

• Potentiometers• Variable voltage divider

Page 38: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

Example: RC-servo

•Built in components:• Motor• Reduction gear• Potentiometer• Control circuit• Drive circuit

Page 39: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

The control circuit of the RC servo

Output shaft

Page 40: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

Application examples

Industrial robots• E.g. ABB IRB 7600

- Payload up to 630 kg- Positioning accuracy 0.1 mm

• Machining centers– Linear motion with leadscrews– Positioning accuracy 0.005 mm

Page 41: Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015

Summary

A controller increases the performance of a system

Feedback control is used to reject disturbances

Feedback control can stabilize unstable systems- Feedback control can also destabilize stable systems

A PID controller is easy to implement- Every mechatronic engineer should understand it

Servomotor is a feedback controlled motor- Servomotor is not a motor type