96
By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

  • View
    220

  • Download
    0

Embed Size (px)

Citation preview

Page 1: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

By:Mark Bright

and Mike Donaldson

Advisor:Dr. Gary Dempsey

Page 2: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

Project Goal System Applications Thermal Plant Overview

Engine Side Thermal Side

Page 3: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

The goal of our Engine Control Workstation is to simulate thermal environments that are found in liquid-based cooling systems.

With this system we created several different control methods via MATLAB and Simulink working together to control both the engine and thermal transient and steady state responses.

Page 4: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

Car Application PC Application

The overall goal of this project is to protect the motor with varying loads with minimum energy usage

Page 5: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

Engine Side

Circuitry

Thermal Side

Circuitry

Page 6: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

Engine DSP Board

Thermal

DSP Board

Page 7: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

Generator

Thermistor

Flowmeter

Pump

Pittman

Motor

Cooling Blocks

Page 8: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 9: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 10: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 11: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 12: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 13: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 14: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 15: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

Pittman Motor

Tmax = 311 deg F

Thermal impedance 75.9 deg F/watt

(2.9 A)^2 * (3.91 ohm) = 36 watts

36W * (75.9 deg F/watt) = 2732 deg F

Page 16: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

Engine Control:

Minimize C-code and execution time

Learn Auto-Code generation platform of Simulink/DSP interface

Design software for PWM generation and velocity calculation from rotary encoder.

Design closed-loop controllers for velocity and acceleration control.

Page 17: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

32 bit Processor

150 MHz Clock

16 A/D Channels

12 PWM Digital I/O Channels

128K on-chip Flash Memory

9 Ports Total

3.3v Supply

Interfaced to PC by serial port

Inputs and output go through level-shifter IC (5v to 3.3v / 3.3v to 5v)

Page 18: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

User Interaction:Set RPM and

Gain

System Design Simulink Model

MATLAB GUI

Code Composer Auto Code Generated

C Code

TI 2812 DSP Board

PWM Output to Drive Motor

Page 19: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

Both encoder channels from the Pittman motor are offset from each other

Pulses are wired into the DSP board Port 8 – pins 6 and 7

2 counts can be obtained per period for each channel – 4 times as many counts

Allows for Steady State Error of ± 5 RPM

Simulink codes this as inner shaft RPM, which must be converted to outer shaft RPM – 5.9:1 gear ratio

Drag QEP Block into Simulink diagram to implement

Page 20: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

Data sent to GUI is set here

Model is used to generate Code Composer C code

P, PI, and FF Control Implemented

Page 21: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

Data sent to GUI is set here

Model is used to generate Code Composer C code

P, PI, and FF Control Implemented

Page 22: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

Data sent to GUI is set here

Model is used to generate Code Composer C code

P, PI, and FF Control Implemented

Page 23: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

Data sent to GUI is set here

Model is used to generate Code Composer C code

P, PI, and FF Control Implemented

Page 24: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

Data sent to GUI is set here

Model is used to generate Code Composer C code

P, PI, and FF Control Implemented

Page 25: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

Data sent to GUI is set here

Model is used to generate Code Composer C code

P, PI, and FF Control Implemented

Desired RPM

Actual RPM

Controller Output

PWM Duty Cycle

Page 26: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

Simulation model started where the 2008 mini project left off

Bilinear Transform converted analog controllers to digital controllers

P, PI, and FF Control Implemented

Page 27: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

Gp = ______________ (s/146+1)(s/776+1)

______________

(s/146+1)

(s/1460+1)17.1FF=Gp =

17.1 -1

Page 28: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

Simulation: 596 RPM input FF Output is 17 RPM Impulse duration was 2mS

Actual: 596 RPM input FF Output is 17 RPM As expected from

simulation

Page 29: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

100 RPM Step Input

FF Control decreases response time by 20 mS

Less overshoot

Smaller time to first peak

FF Compensation

PI Control Only

RPM vs Time (ms) plot

Page 30: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

Start, Type “guide” in MATLAB

GUI can be designed here with many components

Once designed, MATLAB creates an .m file and .fig file

MATLAB GUI Design

Page 31: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

GUI created in MATLAB and interfaced to Simulink Model

Plots Motor RPM, PWM Duty Cycle, Transient Response, and both PI and Feed Forward Controller Output

User can input desired RPM: 0 to 834 RPM

Optimal controller gains loaded at startup, but user can control both the gain and type of control

GUI updates in real time

Page 32: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

numMsgsOchan1 = r.msgcount('ochan1');

if (numMsgsOchan1)

speed = r.readmsg('ochan1', 'int32');

end

numMsgsOchan2 = r.msgcount('ochan2');

if (numMsgsOchan2)

pid = r.readmsg('ochan2', 'int32');

end

numMsgsOchan3 = r.msgcount('ochan3');

if (numMsgsOchan3)

RPM = r.readmsg('ochan3', 'int32');

end

numMsgsOchan4 = r.msgcount('ochan4');

if (numMsgsOchan4)

PI_Out = r.readmsg('ochan4', 'int32');

end

numMsgsOchan5 = r.msgcount('ochan5');

if (numMsgsOchan5)

FFOut = r.readmsg('ochan5', 'int32');

end

Page 33: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

if ((numMsgsOchan1 ~=0) && (numMsgsOchan2 ~= 0) && (numMsgsOchan3 ~= 0) && (numMsgsOchan4 ~= 0) && (numMsgsOchan5 ~= 0))

axes(handles.axes3);

plot(handles.axes3,x_axis1, RPM);

title(handles.axes3,'Measured speed of the Motor');

xlabel(handles.axes3,'t (s)');

ylabel(handles.axes3,'Speed (RPM)');

grid(handles.axes3,'on');

axis(handles.axes3,[0 5 1 850]);

axes(handles.axes4);

cycle = double(pid);

plot(handles.axes4,x_axis1, cycle);

title(handles.axes4,'Duty Cycle of the PWMWaveform');

xlabel(handles.axes4,'t (s)');

ylabel(handles.axes4,'Duty Cycle (%) ');

grid(handles.axes4,'on');

axis(handles.axes4,[0 5 1 100]);

Page 34: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

Acceleration Control

◦ Adjustable Feed Forward control with different types of input commands: combos of ramps, steps, and parabolic. Load changes can simulate hills and different road conditions.

CAN Bus Interface

◦ Use the DSP board’s CAN bus to send data between the boards. This would allow for a main GUI to control both sides of the system.

Data Logging Feature

◦ Allow for a user to tune controllers and compare results. Could implement a new EE431 / 432 homework or design project around the system.

Set Control Points for Thermal and Engine Response

◦ Set desired temperature for a change in the coolant as well as a engine RPM governor based on load conditions

Page 35: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 36: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 37: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

Variable Resistance

Anti-aliasing filter

Page 38: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

Use PWM to drive Pump/Fan

Interface from digital to analog

Average Voltage seen by the device

Page 39: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

Opto-Isolator

TIP120 choice

Design for 3A Opto-Isolator

Page 40: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

LPF to ‘DC’ the PWM

Ideal Op Amp theory

Voltage @ Input = Voltage @ Pump

Opto-Isolator

Page 41: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 42: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

Conversion of A/D Value to Temperature

Excel Trendline

Page 43: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

Conversion of A/D Value to Temperature

Excel Trendline

Page 44: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

Conversion of A/D Value to Temperature

Excel Trendline

Page 45: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

Conversion of A/D Value to Temperature

Excel Trendline

Page 46: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

Datatype conversions

Function auto-code generated

Page 47: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

Datatype conversions

Function auto-code generated

Page 48: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 49: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 50: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 51: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 52: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 53: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 54: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 55: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 56: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 57: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 58: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 59: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 60: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 61: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 62: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 63: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 64: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 65: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 66: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 67: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

Bang – Bang

Improved Bang Bang

P Control

PI Control

Page 68: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 69: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 70: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 71: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 72: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

Fan PWM %

Pum

p P

WM

%

0 10 20 30 40 50 60 70 80 90 10060

65

70

75

80

85

90

95

100

-5.5

-5

-4.5

-4

-3.5

-3

-2.5

-2

-1.5

-1

-0.5

0

Pum

p P

WM

%

Fan PWM%

Page 73: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

Supervisory Control

Further improvement by utilizing Pump and Fan cooling efficiencies

Faster PID Control

Use of more temperature sensors

Use of CAN bus

Page 74: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

Nick Schmidt◦ Case Assembly◦ Hardware Assembly

Dr. Dempsey◦ Case Assembly◦ Hardware Assembly

Page 75: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 76: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

Plant Wc is at 899 rad/sec

P Control System Wc was at 164 rad/sec

Gain = .08

Phase Margin with P control:◦ 115

Gp = __________________ (s/146+1)(s/776+1)

17.1

Page 77: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 78: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

Gp(s) =K * 1/(Tc(s)+1) * e^-(s)Td

Pump/Plant ◦ K = (-.8 degrees F / 6.4 V)◦ Tc = 20◦ Td = 6

Fan/Plant◦ K = (-9.6 degrees F / 13V)◦ Tc = 12◦ Td = 15

Thermal Transfer Functions

Page 79: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

Control Toolbox Results P-Pump

◦ Wc = .148 radians PM = 105 GM =22.1dB

P-Fan◦ Wc = ? PM = undefined GM =29.4dB

PI-Pump◦ Wc = .39 radians PM = -139 GM =16.1dB

P-Pump◦ Wc = .0966 radians PM = -48 GM =-15.92dB

Page 80: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

OCHAN’s allow for data to be outputted to:◦ GUI◦ Workspace

Page 81: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey

PWM Brush Type Servo Amplifer – Model 10A8DD

Protected for over-voltage and over-current

DC Supply Voltage: 20-80v

Peak Current: ±10A Maximum Continuous

Current: ±6A

Page 82: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 83: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 84: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 85: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 86: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 87: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 88: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 89: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 90: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 91: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 92: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 93: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 94: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 95: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey
Page 96: By: Mark Bright and Mike Donaldson Advisor: Dr. Gary Dempsey