implementation of conventional and neural controllers using...

47
Implementation of Conventional and Neural Controllers Using Position and Velocity Feedback By Christopher Spevacek & Manfred Meissner Advisor Dr. Gary Dempsey

Upload: others

Post on 08-Sep-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Implementation of Conventional andNeural Controllers Using Position

and Velocity Feedback

By

Christopher Spevacek

&

Manfred Meissner

Advisor

Dr. Gary Dempsey

Page 2: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule
Page 3: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Contents

Summary

Previous Work

Modes Of Operation

Preliminary Design Work

Preliminary Lab Work

Equipment List

Schedule

Page 4: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Summary

Design and Compare Conventional andNeural Controllers for a Small RobotArm

Position and Velocity Feedback Design

User Friendly Interface Design

Page 5: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Previous Work

Quanser Consulting– Provided Software for Use with the Robot

Arm, A/D, D/A Converters

Dr. Dempsey– Research on different Velocity Algorithms

– Neural Network Architecture

Page 6: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Modes of Operation

Default– Computer Generates the Command Signal

– User Set the Final Position of the RobotArm

Joystick– Connects to A/D Channel

– Generates Command Signal by theMovement of the Joystick

Page 7: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Preliminary Design Work

High Level Block DiagramHigh Level Block Diagram

Control Block Diagram

Software

Velocity Algorithms

Neural Networks

Page 8: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

High Level Block Diagram

Robot Arm System

Pentium based PC

Position SensorA/D

Converter

D/AConverter

Page 9: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

High Level Block Diagram

Pentium Based PC– Generates Command Signal if Joystick is

not Present

– Implementation of Controllers

– Generates Real-Time Graphs

– Display the User Interface

Page 10: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

High Level Block Diagram

Robot Arm System– Power Amplifier

– DC Motor Assembly

– Gear Trains

– Load The Robot Arm

Page 11: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Control Block Diagram

C(s)position

Gp(s)e+

+

F(s)b

H(s)Ampandfilter

Position Feedback

Gc(s)R(s)Command

+-

a c d

V(s)

To be usedlater forcontroller g

f

h

Page 12: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Input And Outputs of System

A) R(s) is the Command Signal

+CMD

-CMD

t

Velocity

| |CMD ≤ °90

VELOCITYMAX = °45 sec

Page 13: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Inputs and Outputs

C(s) is the Position of the Robot Arm– Percent Overshoot(%O.S.) = 5%

– Time To first Peak (tp) = 3s

– Magnitude of Peak in Frequency Domain(Mp) = 1.32dB

– Frequency of Peak In frequency Domain(wp)=170mHZ

Page 14: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Inputs and Outputs

– Bandwidth Closed Loop (BW) = 290mHz

– Phase Margin (PM) = 50deg

– Gain Margin (GM) = 6dB

– Steady State Error = 2deg

Output should be the same as input

Page 15: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Subsystems

F(s)– Feed-Forward Compensator

– Neural Network if Implemented

– Implemented in Software

Gc(s)– Plant Controller

– A PID-type controller

– Implemented in Software

Page 16: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Subsystems

Gp(s)– Plant or Robot Arm System

– Hardware

H(s)– Position Sensor

– Hardware

Page 17: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Subsystems

V(s)– Algorithm used for Velocity Feedback

– To Be Determined

Amp and Filter– Amplify signal

– Filter out the noise

Page 18: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Software FlowchartInitialization Setup Interrupts

Interrupt Service Routine

Main ProgramRead Keyboard

to Determine Controller

Is Joystick Present

Generate Internal Position Command

Signal

Perform PID-Controller

Display Internal/External

Signals to Monitor

Return

Pentium-based PC

Yes No

Page 19: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Subsystems

Initialization– Initializes the Interrupts to be set at 200Hz

Sampling Rate (5ms)

Main Program– Calculate the Values for the Display

– Check the Keyboard and Joystick

– If Present Read Joystick and Generate theCommand Signal

Page 20: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Subsystems

Interrupt Service Routine andPerforming of PID Controller– Send Signal form Calculated Values of

Main Program and Interrupt ServiceRoutine to the Robot Arm

– Signals also Sent to the Monitor at UserSpecified Times

Page 21: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Velocity Algorithms

Design S-Plane Lead Network useTustin Method(Bilinear Transformation)

Use Polynomial Curve Fit Algorithm toCalculate Velocity

Page 22: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Neural Network

C(s)position

Gp(s)e+

+

F(s)b

H(s)Ampandfilter

Position Feedback

Gc(s)R(s)Command

+-

a c d

V(s)

To be usedlater forcontroller g

f

h

Page 23: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Preliminary Lab Work

P Controller Design and Testing

C-Code– Filter Design using Tustin Method

– Filter Testing

– Improvement of Display

Page 24: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

P Controller Design

Gps s

=+1

1( )

K GpR C

Page 25: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Calculation Results

For 0% OS k=0.25

Ts=11.7sec Tp=Infinity

For 5%OS k=0.525

Ts=8.4sec Tp=6sec

For 25%OS k=1.534

Ts=6.78sec Tp=2.76sec

Page 26: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Circuitry Used

Page 27: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Measurement 25% OS

Ts=6.75 Tp=2.7

Page 28: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Calculation Vs. Measurement

0% Ts=11.7sec

5% Ts=8.4sec

Tp=6sec

25% Ts=6.78sec

Tp=2.76sec

BW=290mHz

fpeak=175mHz

Mp=1.32 norm.

0% Ts=12.5sec

5% Ts=7.4sec

Tp=5.75sec

25% Ts=6.75sec

Tp=2.7sec

BW=270mHz

fpeak=161.8mHz

Mp=1.354 norm.

Page 29: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

C-Code Development

Design of a digital filter @ 20Hz cutoff

Changing Real-Time Display Mode

Page 30: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Filter Design

Using Tustin Method

With T=fixed sampling time=0.005sec

Filter Transfer Function to Obtain

ST

z

z=

−+

2 1

1

G s s( )

*

=+

1

120 2π

Page 31: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Filter Output on PC Screen

Chose 1V@20Hz Input to see 3dB point

Page 32: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Changing Real Time Display

Auto Scaling on y-Axis was given

Problem: Plot off the Screen

Improvement: now it takes the lasthighest value and adjusts it only byapproximately 20% up or down

Page 33: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Equipment ListHardware & Software

500MHz IBM compatible Pentium III PC

Quansar Robot Arm System

A/D & D/A converter card

Amplifier

Borland 4.5 C-Compiler

Matlab 5.3

WinCom V2.0 Real-Time Workshop

Page 34: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

ScheduleChris=C Manfred=M Dr.Dempsey=D

12 weeks available till Presentation at the StudentExpo end of April

System Identification C&M&D 3Weeks

Menu C&M 1Week

P-Controller Design&Testing C 1Week

Investigate&Implement Neural Network

with P-Controller M&D 1Week

Page 35: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Schedule Chris=C Manfred=M Dr.Dempsey=D

Velocity Algorithm C 1Week

Two Loop Design

With Neural Networks M&D 1Week

Redesign with Rotary Encoder C&M 1Week

Feed Forward Control & Implementation

in Neural Networks C&M&D 1Week

Digital Control Analysis C&M 2Weeks

Page 36: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Additional Work

Presentation at Student Expo

miss one Lab Period

Expo Conference Report

Presentation Board

Page 37: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

The

End

Page 38: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Design Equations 1

− −= ζπ ζ12

%OS e

nw k=nw = 12ξ

Page 39: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Design Equations 2

Vo/Vi= 1kΩ /Rpot=k => R=1000/k

Transfer Function: 2nd order system

C/R=wn^2/(s*s+2*zeta*wn+wn^2)=

=k/(s*s+s+k)

Ts=<2% from final value

Page 40: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Design Equations 3

Tustin or Bilinear z-Transformation

s=ln(z)*1/T~(2/T)*(z-1)/(z+1)

Truncating Laurent Series Expansion

Page 41: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Calculation for Circuitry

Chose 1µF Capacitor for Integrator &Filter

→R=1MΩ for Integrator and Filter

Chosen 1 kΩ Resistors for Gain &Summer

→Rpot=1000/Gain

→Rpot= 4 kΩ for 0%OS

→Rpot= 1.905 kΩ for 5%OS

→Rpot=652 Ω for 25%OS

Page 42: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Final C-code Function

Output = 0.239*Input+

+0.239*Past Input+

+0.522*Past Output

Past Input & Past Output had to be setzero to get started

Page 43: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Subsystems

Keyboard– Gives the User a Choice of Which Signals

are to be Displayed and Controller type

– Command Signal Parameters

Display– Will Show all Internal and External Signals

Chosen by the User

Page 44: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Subsystems

Joystick Check– If Present Joystick Position will be Read

and Sent to the Interrupt Service Routine

– If not the PC will Generate the CommandSignal

Generate Command Signal– This Option Occurs if the Joystick is not

Present.

– PC Performs the Calculations for theCommand Signal

Page 45: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

How Measurement was Obtained

Input Square Wave Chosen at LeastDouble the Settling Time

Potentiometer was Adjusted to Get

%OS Wanted

Read Results from Scope

Frequency Domain: Swept from 1mHztill Sine Wave to get BW(3dB) and Mp

Page 46: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Measurement 0% OS

Ts=12.5sec

Page 47: Implementation of Conventional and Neural Controllers Using …cegt201.bradley.edu/projects/proj2000/prjneurl/pres1.pdf · 2000. 4. 19. · WinCom V2.0 Real-Time Workshop . Schedule

Measurement 5% OS

Ts=7.4 sec Tp=5.75sec