Download - Final Cruise Control Ppt.

Transcript
Page 1: Final Cruise Control Ppt.

A PROJECT REPORT ON

(MATLAB IMPLEMENTATION)

SUBMITTED BY :-

JYOTI & ANJALI KASHYAP PROJECT INCHARGE:

B.TECH. III YEAR (EC) (Er. ACHAL MITTAL)

Page 2: Final Cruise Control Ppt.

ACKNOWLEDGEMENT

We pose our copious gratitude and like to thanks the entire staff of

CETPA INFOTECH PVT. LTD., LUCKNOW for their help and kind

cooperation during our entire project preparation. We are extremely

thankful to them for providing us with vital information about the topic.

We take this opportunity to pay our sincere thanks to Er. ACHAL

MITTAL, PROJECT GUIDE.

At last but not the least, we would like to thank our parents and all our peers who have been a constant source of encouragement and inspiration in every walk of life.

Page 3: Final Cruise Control Ppt.

CERTIFICATE

TO WHOMSOEVER MAY IT CONCERN

This is to certify that the work which is being successfully presented in the project report entitled “CRUISE CONTROL SYSTEM” by us during one month course on MATLAB from CETPA INFOTECH PVT. LTD. LUCKNOW .

DATED:

This is to certify that the above statement made by the candidate is correct to the best of my knowledge.

SUBMITTED BY :-

JYOTI & ANJALI KASHYAP PROJECT INCHARGE:

B.TECH. III YEAR (EC) (Er.ACHAL MITTAL)

Page 4: Final Cruise Control Ppt.

INDEX Introduction History Theory of operation Electronic Cruise Control System Modeling a Cruise Control System

Physical setup and system equations Design requirements MATLAB representation

1. Transfer Function2. State-Space

Open-loop response Closed-loop transfer function

Modeling a Cruise Control System in Simulink

Physical setup and system equations Building the model Open-loop response Extracting the Model Implementing PI control Closed-loop response

INTRODUCTION

Page 5: Final Cruise Control Ppt.

CRUISE CONTROL

Cruise control  is a system that automatically controls the speed of a motor vehicle . It is sometimes known as speed control or autocruise.The system takes over the  throttle of the car to maintain a steady speed as set by the driver.

HISTORY

The technology was invented by James Watt and Matthew Boulton in 1788 to control steam engines.Modern cruise control (also known as a speedostat) was invented in 1945 by the blind inventor and mechanical engineer  Ralph Teetor.His idea was born out of the frustration of riding in a car driven by his lawyer, who kept speeding up and slowing down as he talked. The first car with Teetor's system was the Chrysler  Imperial in 1958. This system calculated ground speed based on driveshaft rotations and used a  solenoid  to vary throttle position as needed.

THEORY OF OPERATION

Page 6: Final Cruise Control Ppt.

The cruise control may need to be turned on before use — in some designs it is always "on" but not always enabled (not very common), others have a separate "on/off" switch, while still others just have an "on" switch that must be pressed after the vehicle has been started. Most designs have buttons for "set", "resume", "accelerate", and "coast" functions. Some also have a "cancel" button. Alternatively, depressing the brake or clutch pedal will disable the system so the driver can change the speed without resistance from the system. The system is operated with controls easily within the driver's reach, usually with two or more buttons on the  steering whee l  spokes or on the edge of the hub like those on  Honda vehicles, on the turn signal  stalk like in many older  General Motors vehicles or on a dedicated stalk like those found in, particularly, Toyota and Lexus.

The driver must bring the vehicle up to speed manually and use a button to set the cruise control to the current speed. The cruise control takes its speed signal from a rotating  driveshaft,  speedometer cable ,  wheel speed sensor from the engine's RPM or from internal speed pulses produced electronically by the vehicle.

Most systems do not allow the use of the cruise control below a certain speed (normally around 25 mph). The vehicle will maintain the desired speed by pulling the throttle cable with a solenoid, a vacuum  driven  servomechanism or by using the electronic systems built into the vehicle (fully electronic) if it uses a 'drive-by-wire' system.

All cruise control systems must be capable of being turned off both explicitly and automatically, when the driver depresses the brake and often also the clutch. Cruise control often includes a memory feature to

Page 7: Final Cruise Control Ppt.

resume the set speed after braking and a coast feature to disengage the system without braking. When the cruise control is engaged, the throttle can still be used to accelerate the car, but once the pedal is released the car will then slow down until it reaches the previously set speed.

ELECTRONIC CRUISE CONTROL

Daniel Aaron Wisner invented Automotive Electronic Cruise Contro l  in 1968. His invention described in two patents filed that year (#3570622 & #3511329), with the second modifying his original design by debuting  digital memory, was the first electronic gadgetry to play a role in controlling a car and ushered in the computer-controlled era in the automobile industry.Two decades lapsed before an integrated circuit for his design was developed by Motorola Inc. as the MC14460 Auto Speed Control Processor in CMOS.

Modeling a Cruise Control System

Physical setup and system equations Design requirements MATLAB representation Open-loop response Closed-loop transfer function

Physical setup and system equations

The model of the cruise control system is relatively simple. If the inertia of the wheels is neglected, and it is assumed that friction (which is proportional to the car's speed) is what is opposing the motion of the car,

Page 8: Final Cruise Control Ppt.

then the problem is reduced to the simple mass and damper system shown below.

Using Newton's law, the modeling equations for this system become:

(1)

where u is the force from the engine. For this example, let's assume thatm = 1000kgb = 50Nsec/mu = 500N

Design requirements

The next step in modeling this system is to come up with some design criteria. When the engine gives a 500 Newton force, the car will reach a maximum velocity of 10 m/s (22 mph). An automobile should be able to accelerate up to that speed in less than 5 seconds. Since this is only a cruise control system, a 10% overshoot on the

Page 9: Final Cruise Control Ppt.

velocity will not do much damage. A 2% steady-state error is also acceptable for the same reason.

Keeping the above in mind, we have proposed the following design criteria for this problem:

Rise time < 5 secOvershoot < 10%Steady state error < 2%

MATLAB representation

1. Transfer Function

To find the transfer function of the above system, we need to take the Laplace transform of the modelingequations (1). When finding the transfer function, zero initial conditions must be assumed. Laplace transforms of the two equations are shown below:

Since our output is the velocity, let's substitute V(s) in terms of Y(s):

The transfer function of the system becomes:

Page 10: Final Cruise Control Ppt.

To solve this problem using MATLAB, copy the following commands into an new m-file:

m=1000;b=50;u=500;num=[1];den=[m b];cruise=tf(num,den);

These commands will later be used to find the open-loop response of the system to a step input. But before getting into that, let's take a look at the state-space representation.

2. State-Space

We can rewrite the first-order modeling equation (1) as the state-space model.To use MATLAB to solve this problem, create an new m-file and copy the following commands:

m = 1000;b = 50;u = 500;A = [-b/m];B = [1/m];C = [1];D = 0;cruise=ss(A,B,C,D)

Page 11: Final Cruise Control Ppt.

Open-loop response

Now let's see how the open-loop system responds to a step input. Add the following command to the end of your m-file and run it in the MATLAB command window:

step(u*cruise)

From the plot, we see that the vehicle takes more than 100 seconds to reach the steady-state speed of 10 m/s.This does not satisfy our rise time criterion of less than 5 seconds

Page 12: Final Cruise Control Ppt.

Closed-loop transfer function

To solve this problem, a unity feedback controller will be added to improve the system performance. The figure shown below is the block diagram of a typical unity feedback system.

The transfer function in the plant is the transfer function derived above {Y(s)/U(s)=1/ms+b}. The controller will to be designed to satisfy all design criteria.

Modeling a Cruise Control System in Simulink

Physical setup and system equations Building the model Open-loop response Extracting the Model Implementing PI control Closed-loop response

Physical setup and system equations The model of the cruise control system is relatively simple. If the inertia of the wheels is neglected, and it is assumed that friction (which is proportional to the car's speed) is what is opposing the

Page 13: Final Cruise Control Ppt.

motion of the car, then the problem is reduced to the simple mass and damper system shown below:

Using Newton's law, modeling equations for this system becomes:

where u is the force from the engine. For this example, let's assume thatm = 1000kgb = 50Nsec/mu = 500N

Building the Model

This system will be modeled by summing the forces acting on the mass and integrating the acceleration to give the velocity. Open Simulink and

Page 14: Final Cruise Control Ppt.

open a new model window. First, we will model the integral of acceleration.

Insert an Integrator Block (from the Linear block library) and draw lines to and from its input and output terminals.

Label the input line "vdot" and the output line "v" as shown below. To add such a label, double click in the empty space just above the line.

Since the acceleration (dv/dt) is equal to the sum of the forces divided by mass, we will divide the incoming signal by the mass.

Insert a Gain block (from the Linear block library) connected to the integrators input line and draw a line leading to the input of the gain.

Edit the gain block by double-clicking on it and change its value to "1/m".

Change the label of the Gain block to "inertia" by clicking on the word "Gain" underneath the block.

Page 15: Final Cruise Control Ppt.

Now, we will add in the forces which are represented in Equation (1). First, we will add in the damping force.

Attach a Sum block (from the Linear block library) to the line leading to the inertia gain.

Change the signs of this block to "+-". Insert a gain block below the inertia block, select it by single-clicking on

it, and select Flip from the Format menu (or type Ctrl-F) to flip it left-to-right.

Set the gain value to "b" and rename this block to "damping". Tap a line (hold Ctrl while drawing) off the integrator's output and

connect it to the input of the damping gain block. Draw a line from the damping gain output to the negative input of the

Sum Block.

Page 16: Final Cruise Control Ppt.

The second force acting on the mass is the control input, u. We will apply a step input. Insert a Step block (from the Sources block library) and connect it with a line to the positive input of the Sum Block.

To view the output velocity, insert a Scope (from the Sinks block library) connected to the output of the integrator.

To provide a appropriate step input of 500 at t=0, double-click the Step block and set the Step Time to "0" and the Final Value to "u".

Page 17: Final Cruise Control Ppt.

Open-loop response

To simulate this system, first, an appropriate simulation time must be set. Select Parameters from the Simulation menu and enter "120" in the Stop Time field. 120 seconds is long enough to view the open-loop response.

Page 18: Final Cruise Control Ppt.

The physical parameters must now be set. Run the following commands at the MATLAB prompt:

m=1000;b=50;u=500;

Run the simulation (Ctrl-t or Start on the Simulation menu). When the simulation is finished, double-click on the scope and hit its autoscale button. You should see the following output.

Page 19: Final Cruise Control Ppt.

Extracting a Linear Model into MATLAB

A linear model of the system (in state space or transfer function form) can be extracted from a Simulink model into MATLAB. This is done through the use of In and Out Connection blocks and the MATLAB function linmod.

Replace the Step Block and Scope Block with an In Connection Block and an Out Connection Block, respectively (these blocks can be found in the Connections block library). This defines the input and output of the system for the extraction process.

Page 20: Final Cruise Control Ppt.

Save your file as "ccmodel.mdl" (select Save As from the File menu). MATLAB will extract the linear model from the saved model file, not from the open model window. At the MATLAB prompt, enter the following commands:

[A,B,C,D]=linmod('ccmodel')[num,den]=ss2tf(A,B,C,D)

You should see the following output, providing both state-space and transfer function models of the system.

A =-0.0500B =1.0000e-003C =1D =0num =0 0.0010den =1.0000 0.0500

To verify the model extraction, we will generate an open-loop step response of the extracted transfer function

Page 21: Final Cruise Control Ppt.

in MATLAB. We will multiply the numerator by 500 to simulate a step input of 500N.

Enter the following command in MATLABstep(500*num,den);

You should see the following plot which is equivalent to the Scope's output.

Implementing PI Control

In the cruise control example a PI controller was designed with Kp=800 and Ki=40 to give the desired response. We will implement this in Simulink by first containing the open-loop system from earlier in this page in a Subsystem block.

Create a new model window.

Page 22: Final Cruise Control Ppt.

Drag a Subsystem block from the Connections block library into your new model window.

Double click on this block. You will see a blank window representing the contents of the subsystem (which is currently empty).

Open your previously saved model of the Cruise Control system, ccmodel.mdl.

Select Select All from the Edit menu (or Ctrl-A), and select Copy from the Edit menu (or Ctrl-C).

Select the blank subsystem window from your new model and select Paste from the Edit menu (or Ctrl-V).

You should see your original system in this new subsystem window.Close this window.

You should now see input and output terminals on the Subsystem block. Name this block "plant model".

Page 23: Final Cruise Control Ppt.

Now, we will build a PI controller around the plant model. First, we will feed back the plant output.

Draw a line extending from the plant output. Insert a Sum block and assign "+-" to it's inputs. Tap a line of the output line and draw it to the negative input of the Sum

block.

Page 24: Final Cruise Control Ppt.

The output of the Sum block will provide the error signal. From this, we will generate proportional and integral components.

Insert an integrator after the summer and connect them with a line. Insert and connect a gain block after the integrator to provide the

integral gain. Label this integrator Ki and assign it a value of Ki. Insert a new Gain block and connect it with a line tapped off the output

of the Sum block. Label this gain Kp and assign it a value of Kp.

Now we will add the proportional and integral components and apply the sum to the plant.

Insert a summer between the Ki block and the plant model and connect the outputs of the two gain blocks to the summer inputs.

Connect the summer output to the input of the plant.

Page 25: Final Cruise Control Ppt.

Finally, we will apply a step input and view the output on a scope. Attach a step block to the free input of the feedback Sum block. Attach a Scope block to the plant output. Double-click the Step block and set the Step Time to "0" and the Final

Value to "u". This allows the input magnitude to be changed outside of simulink.

In this example, we constructed a PI controller from fundamental blocks. As an alternative, we could have used a Transfer Function block (from the Linear block library) to implement this in one step, as shown below.

Page 26: Final Cruise Control Ppt.

Closed-loop response

To simulate this system, first, an appropriate simulation time must be set. Select Parameters from the Simulation menu and enter "10" in the Stop Time field. The design requirements included a rise time of less than 5 sec, so we simulate for 10 sec to view the output. The physical parameters must now be set. Run the following commands at the MATLAB prompt:m=1000;b=50;u=10;Kp=800;Ki=40;Run the simulation (Ctrl-t or Start on the Simulation menu). When the simulation is finished, double-click on the scope and hit its autoscale button.