Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
6 views

4 Control Tutorials for MATLAB and Simulink - Cruise Control_ Simulink Modeling

Matlab hướng dẫn prj 2_4

Uploaded by

tongvocute
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

4 Control Tutorials for MATLAB and Simulink - Cruise Control_ Simulink Modeling

Matlab hướng dẫn prj 2_4

Uploaded by

tongvocute
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

4/19/2020 Control Tutorials for MATLAB and Simulink - Cruise Control: Simulink Modeling

Tips Effects Search Control Tutorials

TIPS ABOUT BASICS HARDWARE INDEX NEXT ►

INTRODUCTION CRUISE CONTROL MOTOR SPEED MOTOR POSITION SUSPENSION INVERTED PENDULUM

SYSTEM

MODELING Cruise Control: Simulink Modeling


Related Tutorial Links
ANALYSIS
Simulink Basics

Modeling w/ Simulink
CONTROL Circuit Sim Activity

PID
Related External Links
ROOT LOCUS Simulink Intro Video

FREQUENCY Simulink Modeling

Video
STATE-SPACE
Modeling Challenges
DIGITAL Video

SIMULINK

MODELING
Contents
CONTROL
Physical setup and system equations
SIMSCAPE Building the model

Open-loop response

Physical setup and system equations

ctms.engin.umich.edu/CTMS/index.php?example=CruiseControl&section=SimulinkModeling 1/9
4/19/2020 Control Tutorials for MATLAB and Simulink - Cruise Control: Simulink Modeling

The model of the cruise control system is relatively simple. If it is assumed that rolling resistance and air drag are proportional to the car's
speed, then the problem is reduced to the simple mass and damper system shown below.

Using Newton's 2nd law, the governing equation for this system becomes:

(1)

where u is the force generated between the road/tire interface and can be controlled directly. For this example, let's assume that

m = 1000 kg
b = 50 N.sec/m
u = 500 N

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 open a new model window. First, we will model the integral of acceleration.

(2)

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

ctms.engin.umich.edu/CTMS/index.php?example=CruiseControl&section=SimulinkModeling 2/9
4/19/2020 Control Tutorials for MATLAB and Simulink - Cruise Control: Simulink Modeling

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 Math Operations library) connected to the Integrator block input line and draw a line leading to the input
of the Gain block.

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.

ctms.engin.umich.edu/CTMS/index.php?example=CruiseControl&section=SimulinkModeling 3/9
4/19/2020 Control Tutorials for MATLAB and Simulink - Cruise Control: Simulink Modeling

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 Math Operations library) to the line leading to the inertia Gain block.

Change the signs of the Sum block to "+-".

Insert a Gain block below the Inertia block, select it by single-clicking on it, and select Flip Block from the Rotate & Flip menu (or
type Ctrl-I) to flip it left-to-right.

Set the block's value to "b" and rename this block to "damping".

Tap a line (hold Ctrl while drawing) off the Integrator block's output and connect it to the input of the damping Gain block.

Draw a line from the damping Gain block output to the negative input of the Sum Block.

ctms.engin.umich.edu/CTMS/index.php?example=CruiseControl&section=SimulinkModeling 4/9
4/19/2020 Control Tutorials for MATLAB and Simulink - Cruise Control: Simulink Modeling

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 library) and connect it with a line to the positive input of the Sum Block.

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

ctms.engin.umich.edu/CTMS/index.php?example=CruiseControl&section=SimulinkModeling 5/9
4/19/2020 Control Tutorials for MATLAB and Simulink - Cruise Control: Simulink Modeling

To provide an appropriate step input of 500 at time equals zero, double-click the Step block and set the Step Time to "0" and the Final

Value to "u".

ctms.engin.umich.edu/CTMS/index.php?example=CruiseControl&section=SimulinkModeling 6/9
4/19/2020 Control Tutorials for MATLAB and Simulink - Cruise Control: Simulink Modeling

You can download a model file for the complete system by right-clicking here and selecting Save link as.

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.

ctms.engin.umich.edu/CTMS/index.php?example=CruiseControl&section=SimulinkModeling 7/9
4/19/2020 Control Tutorials for MATLAB and Simulink - Cruise Control: Simulink Modeling

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

m = 1000;
b = 50;

u = 500;

ctms.engin.umich.edu/CTMS/index.php?example=CruiseControl&section=SimulinkModeling 8/9
4/19/2020 Control Tutorials for MATLAB and Simulink - Cruise Control: Simulink Modeling

Run the simulation (hit Ctrl-T or select Run from the Simulation menu). When the simulation is finished you should see the following

output.

Observing the above, we would like to improve the response of the cruise control system. The model created here will be employed for

controller design and analysis within Simulink in the Cruise Control: Simulink Controller Design page.

Published with MATLAB® 9.2

All contents licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

ctms.engin.umich.edu/CTMS/index.php?example=CruiseControl&section=SimulinkModeling 9/9

You might also like