cec 450 real-time systemsmercury.pr.erau.edu/~siewerts/cec450/documents/... · 10k ohm multi-turn...

25
August 24, 2004 Sam Siewert CEC 450 Real-Time Systems Lecture – Robotics Project Concepts

Upload: others

Post on 18-Mar-2020

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CEC 450 Real-Time Systemsmercury.pr.erau.edu/~siewerts/cec450/documents/... · 10K Ohm Multi-Turn Potentiometer, 5 Volt Reference 8 Bit Analog to Digital Converter Position 0 to 255

August 24, 2004 Sam Siewert

CEC 450 Real-Time Systems

Lecture – Robotics Project Concepts

Page 2: CEC 450 Real-Time Systemsmercury.pr.erau.edu/~siewerts/cec450/documents/... · 10K Ohm Multi-Turn Potentiometer, 5 Volt Reference 8 Bit Analog to Digital Converter Position 0 to 255

Sam Siewert 2

Basic Requirements 5 Degree of Freedom Actuation – Base, Shoulder, Elbow, Wrist, Gripper – 5 Motors, Forward and Reverse

Target Pick and Place Within Base Reachability – 3.5 to 13.5 inches from center of base – -180 deg to +180 deg around base – At least on pick target and one place target

Soft or Hard Limit Switches on all Degrees of Freedom – 2 Switches on each rotational joint – Hard limit disables motors and requires over-ride – Soft limit safes arm at any limit

Page 3: CEC 450 Real-Time Systemsmercury.pr.erau.edu/~siewerts/cec450/documents/... · 10K Ohm Multi-Turn Potentiometer, 5 Volt Reference 8 Bit Analog to Digital Converter Position 0 to 255

Sam Siewert 3

Simple Reversible Motor with Switches

DC Motor+6V +3V

Switch A

Switch B

Switch C

SW A SW B SW C MOTOR Off X Off Off Off On On Forward On Off On Reverse

Page 4: CEC 450 Real-Time Systemsmercury.pr.erau.edu/~siewerts/cec450/documents/... · 10K Ohm Multi-Turn Potentiometer, 5 Volt Reference 8 Bit Analog to Digital Converter Position 0 to 255

Sam Siewert 4

Simple Reversible Motor with 2 Relays

DC Motor+6V +3V

Relay A

NO

NC

Relay B

NO

NO = Normally OpenNC = Normally Closed

NC

RLY A RLY B MOTOR Off Off Off Off On Forward On Off Off On On Reverse

Page 5: CEC 450 Real-Time Systemsmercury.pr.erau.edu/~siewerts/cec450/documents/... · 10K Ohm Multi-Turn Potentiometer, 5 Volt Reference 8 Bit Analog to Digital Converter Position 0 to 255

Sam Siewert 5

5-DOF Arm Relay Control

Base

+6V +3V

Base Direction

Gripper On/Off

Shoulder

Elbow

Wrist

Gripper

Base On/Off

Shoulder Direction

Shoulder On/Off

Elbow Direction

Wrist On/Off

Wrist Direction

Elbow On/Off

Gripper Direction

Page 6: CEC 450 Real-Time Systemsmercury.pr.erau.edu/~siewerts/cec450/documents/... · 10K Ohm Multi-Turn Potentiometer, 5 Volt Reference 8 Bit Analog to Digital Converter Position 0 to 255

Sam Siewert 6

Arm Rotation Hard Limit Switches

DC Motor

+ 6 V + 3 V

Relay A

NO

NC

Relay B

NO

NO = Normally Open NC = Normally Closed

NC

Pushbutton Break Limit Disable Switch

Pushbutton Make Limit Over - ride Switch

Page 7: CEC 450 Real-Time Systemsmercury.pr.erau.edu/~siewerts/cec450/documents/... · 10K Ohm Multi-Turn Potentiometer, 5 Volt Reference 8 Bit Analog to Digital Converter Position 0 to 255

Sam Siewert 7

Soft Limit Switches

A to DAnalogInputs

+5V

Referenceand Ground

Limit Switch #1Limit Switch #2

Limit Switch #3

Page 8: CEC 450 Real-Time Systemsmercury.pr.erau.edu/~siewerts/cec450/documents/... · 10K Ohm Multi-Turn Potentiometer, 5 Volt Reference 8 Bit Analog to Digital Converter Position 0 to 255

Sam Siewert 8

Relay H-Bridge Motor Control

DC MotorRelay A Relay A

Relay A Relay A

+3V

A

B D

C

A B C D MOTOR 0 0 0 0 Off 0 0 1 1 Brake 0 1 0 1 Fuse Test 0 1 1 0 Reverse 1 0 0 1 Forward 1 0 1 0 Fuse Test 1 1 0 0 Brake

Page 9: CEC 450 Real-Time Systemsmercury.pr.erau.edu/~siewerts/cec450/documents/... · 10K Ohm Multi-Turn Potentiometer, 5 Volt Reference 8 Bit Analog to Digital Converter Position 0 to 255

Sam Siewert 9

MOSFET H-Bridge Motor Control

DC Motor

+3V

A C

B D

A B C D MOTOR 0 0 0 0 Off 0 0 1 1 Brake 0 1 0 1 Fuse Test 0 1 1 0 Reverse 1 0 0 1 Forward 1 0 1 0 Fuse Test 1 1 0 0 Brake

Page 10: CEC 450 Real-Time Systemsmercury.pr.erau.edu/~siewerts/cec450/documents/... · 10K Ohm Multi-Turn Potentiometer, 5 Volt Reference 8 Bit Analog to Digital Converter Position 0 to 255

Sam Siewert 10

Arm Coordinates 5 DOF, Center at Base – Degrees of Freedom – Each Joint Rotation – Base

Rotate around Z -180 to 180 deg

– Shoulder Rotate around Y 0 to -135 deg

– Elbow Rotate around Y 0 to -135 deg

– Wrist Rotate around X -180 to 180 deg

– Gripper Fully Open Fully Closed

X

Y

Z

Home Position

X

Shoulder Segment

Elbow Segment Target Search/Carry Position

Page 11: CEC 450 Real-Time Systemsmercury.pr.erau.edu/~siewerts/cec450/documents/... · 10K Ohm Multi-Turn Potentiometer, 5 Volt Reference 8 Bit Analog to Digital Converter Position 0 to 255

Sam Siewert 11

Concentric Rings of Arm Reach Ability

Innermost Ring IntermediateRing

OuttermostRing

Page 12: CEC 450 Real-Time Systemsmercury.pr.erau.edu/~siewerts/cec450/documents/... · 10K Ohm Multi-Turn Potentiometer, 5 Volt Reference 8 Bit Analog to Digital Converter Position 0 to 255

Sam Siewert 12

Arm Surface Reach Ability Concentric Rings Around the Base Innermost Ring – Compound Rotation – Shoulder -45 deg – Elbow -135 deg

Outermost Ring – Shoulder Rotation Only – Shoulder -135 deg – Elbow 0 deg

Intermediate Ring – Raise Shoulder – Lower Elbow

X

Z 135° 45°

Compound Shoulder/Elbow Rotation

X

Z 135°

Shoulder Only Rotation

Page 13: CEC 450 Real-Time Systemsmercury.pr.erau.edu/~siewerts/cec450/documents/... · 10K Ohm Multi-Turn Potentiometer, 5 Volt Reference 8 Bit Analog to Digital Converter Position 0 to 255

Sam Siewert 13

Arm Navigation – Open Loop Dead Reckon from Home to Target – From known start position (Home position)

Home Position Known By Soft Limits Base at 0 Shoulder at 0 Elbow at 0 Wrist at 0 Gripper Fully Open

– Motors on for specific time periods to translate to target – Motors on for specific time periods to translate to release target – Motors on in specific directions to Home using Limits to Stop

Canned Set of Pick Targets Canned Set of Place Targets

Page 14: CEC 450 Real-Time Systemsmercury.pr.erau.edu/~siewerts/cec450/documents/... · 10K Ohm Multi-Turn Potentiometer, 5 Volt Reference 8 Bit Analog to Digital Converter Position 0 to 255

Sam Siewert 14

Feedback Arm Navigation - Closed Loop

Computer Vision Feedback Position Encoder Feedback – Electrical (Potentiometer) – Optical (LED, Photodiode Counter) – Mechanical (Switch Counter)

Command

Error ( Command –

Measurement ) Control Function

Actuator Output System

( Plant )

Disturbance

Output

Feedback Sensor

Measurement

Page 15: CEC 450 Real-Time Systemsmercury.pr.erau.edu/~siewerts/cec450/documents/... · 10K Ohm Multi-Turn Potentiometer, 5 Volt Reference 8 Bit Analog to Digital Converter Position 0 to 255

Sam Siewert 15

Shoulder Position Encoder Feedback Relay On/Off Motor Control (Only Gain is Mechanical Gearing)

– H-Bridge Can Provide Braking – DAC Can Provide Voltage Supply Scaling

10K Ohm Multi-Turn Potentiometer, 5 Volt Reference 8 Bit Analog to Digital Converter Position 0 to 255 => 0 deg to -135 deg, Approx ½ degree knowledge Calibrate for Home Position (0 degrees) and Full Throw (-135 degrees)

– Angle = (0.52734375 x Position) +/- Offset – Make Sure Potentiometer Zero Crossing Not in Rotational Range

Translational and Rotational Inertia (Forces/Torques), Gear Friction/Slip Error Deadbands Set at +/- 1 degree to Avoid Over-Controlling Position

Shoulder Commanded

Position

Error ( Command –

Position ) Relay Command

Logic

Relay Command Robotic Arm

( Shoulder Motor ) Shoulder Rotation

Disturbance ( Stick / Slip Friction )

Potentiometer Resistance

A to D Measurement

( Scaling to Degrees )

Shoulder Position

Page 16: CEC 450 Real-Time Systemsmercury.pr.erau.edu/~siewerts/cec450/documents/... · 10K Ohm Multi-Turn Potentiometer, 5 Volt Reference 8 Bit Analog to Digital Converter Position 0 to 255

Sam Siewert 16

Analog-Digital-Analog Control Loop Digital Command and Error Computed Digital Control Function Plant Control in Analog Domain via D/A – Digital to Analog Converter – Output Actuator Hold Properties

Measurement via A/D – Accuracy (8, 12, 16 bit) for Analog to Digital Converter – Hold Properties, Sampling Rate, Delay

Digital Domain Analog Domain

Command Error

( Command – Measurement ) D / A Converter

Actuator Output System

( Plant )

Disturbance

Output

Analog Sensor

Measurement A / D Converter

Digital Computer

Control Output

Page 17: CEC 450 Real-Time Systemsmercury.pr.erau.edu/~siewerts/cec450/documents/... · 10K Ohm Multi-Turn Potentiometer, 5 Volt Reference 8 Bit Analog to Digital Converter Position 0 to 255

Sam Siewert 17

PID Controller – Transfer Function

Two Zeros and a Pole at Origin – Root Locus Stability Boundary – Negative Roots = Stable – Positive Roots = Unstable

Integral Compensator Derivative Compensator

ssKKsK

sKs

KKsG dipd

ipc

2

)(++

=++=

R(s) G(s)Kp

Ki / s

Kds

C(s)++++

-

Page 18: CEC 450 Real-Time Systemsmercury.pr.erau.edu/~siewerts/cec450/documents/... · 10K Ohm Multi-Turn Potentiometer, 5 Volt Reference 8 Bit Analog to Digital Converter Position 0 to 255

Sam Siewert 18

PID Controllers – Process Control Function

u(t) is Output from Control Function to Actuators/Plant y(t) is Measured Error Great for Single Input, Single Output Control Problems - Processes – Proportional

y(t), Error = Command - Measurement u(t), Actuator Output = (Gain x Error) + Bias Gain = Output-Change / Input-Change Bias Adjustment is Manual

– Integral Error is Integrated over Time Automates Bias Adjustment

– Derivative Delay in Sensed System Changes with Output Changes

– Servo actuation time – Motor slow down, ramp up

Change in Error over Time Includes Changes in Command over Time Too

tyKtyKtyKtu dip ∆

∆++= ∑ )()()(

Page 19: CEC 450 Real-Time Systemsmercury.pr.erau.edu/~siewerts/cec450/documents/... · 10K Ohm Multi-Turn Potentiometer, 5 Volt Reference 8 Bit Analog to Digital Converter Position 0 to 255

Sam Siewert 19

PID Digital Implementation Digital Error Gains Applied to Digital Error Proportional, Integrated, and Differentiated Outputs Summed Output Sum is Digital Control Output Embedded in Analog-Digital-Analog Feedback Control

M(z)Kp

Kd

Ki

+

++

NumericalIntegrator

NumericalDifferentiator

E(z)

Page 20: CEC 450 Real-Time Systemsmercury.pr.erau.edu/~siewerts/cec450/documents/... · 10K Ohm Multi-Turn Potentiometer, 5 Volt Reference 8 Bit Analog to Digital Converter Position 0 to 255

Sam Siewert 20

Comparison of P, PI, and PID A Well-Tuned PID has overshoot control, good settling, and decent rise time (Kp=0.1, Ki=0.4, Kd=0.05)

Comparison of P, PI, and PID Controllers (Set Point = 100)

0

20

40

60

80

100

120

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

Time Step

Ou

tpu

t PPIPID

Page 21: CEC 450 Real-Time Systemsmercury.pr.erau.edu/~siewerts/cec450/documents/... · 10K Ohm Multi-Turn Potentiometer, 5 Volt Reference 8 Bit Analog to Digital Converter Position 0 to 255

Sam Siewert 21

PID Tuning

Parameter Rise Time Overshoot Settling Time

Kp gain increase

Decreases Increases Small Change

Ki gain increase

Decreases Increases Increases

Kd gain increase

Small Change Decreases Decreases

As a function of increasing a Parameter

Page 22: CEC 450 Real-Time Systemsmercury.pr.erau.edu/~siewerts/cec450/documents/... · 10K Ohm Multi-Turn Potentiometer, 5 Volt Reference 8 Bit Analog to Digital Converter Position 0 to 255

Sam Siewert 22

State Space Control Systems Time Domain Control – Well Suited to Digital Control – System Described by Differential Equation (Dynamics) – System of First Order Differential Equations Can Be Derived

matrixforwardfeedmatrixouputvectorinputvectoroutput

matrixinputmatrixsystemtimetrwderivativevectorstate

−−=−=−=−=

+=−=−=

−−=−=+=

DCuy

DuCxyBA

xxBuAxx

,,

,...,

u +B+

dx/dt ∫ x C y

D

A

+

+

Page 23: CEC 450 Real-Time Systemsmercury.pr.erau.edu/~siewerts/cec450/documents/... · 10K Ohm Multi-Turn Potentiometer, 5 Volt Reference 8 Bit Analog to Digital Converter Position 0 to 255

Sam Siewert 23

Fixed Camera Navigation – Closed Loop

Overhead/Front/Side View camera(s) can see gripper and targets – Entire Arm Reach Ability Space in Field of View – Will Require Multiple Camera Angles for Full Reach Ability

Image processing to find gripper base XY plane location offset from target – Command base, shoulder, and elbow within reach ability space to place

gripper over target – Wrist and gripper marked with image targets (red dots)

Target objects known color and shape – Closed Loop Control Drives gripper target to target object location in XY

plane – Requires Centroid calculation for gripper target and target object

Controlled lighting Home position at limits and so gripper markers visible

Page 24: CEC 450 Real-Time Systemsmercury.pr.erau.edu/~siewerts/cec450/documents/... · 10K Ohm Multi-Turn Potentiometer, 5 Volt Reference 8 Bit Analog to Digital Converter Position 0 to 255

Sam Siewert 24

Gripper Camera – Open + Closed Loop

Start at limits home position Camera embedded in gripper Base ring search patter to find target – Open Loop – Start at outermost ring and scan 360 degrees around base – Move in one camera field of view, scan 360 degrees – When object seen, command shoulder/elbow to lower gripper to

target

Closed Loop Process to Lower Gripper to Target – Elbow and Shoulder Rotation Commanded to Keep Target in

Center of FOV – Camera Tilt May be Required for Full Reach Ability

Page 25: CEC 450 Real-Time Systemsmercury.pr.erau.edu/~siewerts/cec450/documents/... · 10K Ohm Multi-Turn Potentiometer, 5 Volt Reference 8 Bit Analog to Digital Converter Position 0 to 255

Sam Siewert 25

Building Your Own Arm Construct from Basswood and Hobby Servos – Bass or Spruce has high strength to weight ratio – Hobby Servos Move to Commanded position – Hobby Servo Uses PWM to Set and Hold Servo Position

Motors Require Timing or Feedback – Timing-based motion will have repeatability problems – Consider Feedback with Cameras or Joint Position Encoders

Position Encoders – Simple Multi-turn Potentiometer Input to ADC – Calibrate ADC to Potentiometer Rotation – Difficult to Mount and Integrate with Joint Rotation