File Exchange

## Animation of a Quarter-Car Automotive Suspension

version 1.0.0.1 (90.7 KB) by James Allison

### James Allison (view profile)

A standard linear quarter-car model is simulated and then animated.

Updated 14 Mar 2019

This model was developed for use in teaching modeling, simulation, and optimization in graduate engineering courses. The simulation is particularly useful for demonstrating different simulation designs that are optimized for different applications (e.g., maximum handling capability, maximum comfort, etc.). The model is based on the electric vehicle case study found in this dissertation:

http://deepblue.lib.umich.edu/handle/2027.42/58449

This code was used in the creation of this corresponding video, used for teaching:

Note: this submission does not include code for the multi-objective optimization highlighted in the youtube video.

### Cite As

James Allison (2019). Animation of a Quarter-Car Automotive Suspension (https://www.mathworks.com/matlabcentral/fileexchange/35478-animation-of-a-quarter-car-automotive-suspension), MATLAB Central File Exchange. Retrieved .

James Allison

### James Allison (view profile)

I use this example for assignments in some courses, so I have not made the optimization part of the code public. If you would like to see a simple example of multi-objective optimization, I would recommend:

https://www.mathworks.com/matlabcentral/fileexchange/64787-demonstration-of-two-multi-objective-optimization-strategies

For a more detailed treatment of suspension design optimization, please refer to:

https://www.mathworks.com/matlabcentral/fileexchange/40504-co-design-of-an-active-automotive-suspension-using-dt

The code in the following HCS design optimization example may be useful for learning how to use fmincon for design optimization problems:

https://www.mathworks.com/matlabcentral/fileexchange/64651-design-optimization-of-a-helical-compression-spring?s_tid=prof_contriblnk

SANDEEP KUMAR

### SANDEEP KUMAR (view profile)

Sir,
I have one more doubt.
From where can I get the the Optimization file (opt_qcar.m) which is shown in your video
Thanks

James Allison

### James Allison (view profile)

I checked the zip file from MLC FX, and it does contain the mat file with the data. I suspect that something is filtering out this mat file when you attempt to download it or open it.

SANDEEP KUMAR

### SANDEEP KUMAR (view profile)

sir,
Hello Mr, James Allison sir,
i am facing the same problem, it seems some thing missing in this part of the program,
Unable to read file IRI_737b: No such file or directory.

Error in Untitled5 (line 43)

plz can u halp me in details sir..

little

Mike Duke

### Mike Duke (view profile)

Change the fresh in the

Akshay Pimpalkar

Tibor Kicsid

### Tibor Kicsid (view profile)

I have the same problem as ben and BS CE. The error code is:
??? Error: File: plotsusp.m Line: 42 Column: 3
Expression or statement is incorrect--possibly unbalanced (, {, or [.

Error in ==> sim_qcar at 79

Any idea how to solve the problem?

Thank you

Lucas Almeida

### Lucas Almeida (view profile)

What the unit of the z1 amd z2 vector(suspension travel)? The unit, according to the code appears to be in centimeters.

James Allison

### James Allison (view profile)

Sankar: You could change the road profile data by replacing the .mat file with one you generate, as long as the units, spatial resolution, and variable names are identical.

James Allison

### James Allison (view profile)

Lucas: If I remember correctly, the unit is meters. The profile was generated using filtered noise, as described in Section 8.3.3 of: http://systemdesign.illinois.edu/publications/All08b.pdf

Lucas Cavalcante

### Lucas Cavalcante (view profile)

What is the unit of the pavement profile? And by what method did you get the profile? Thank you

BS CE

### BS CE (view profile)

Mr. Allison, I have found following while running the function as in video....

??? Error: File: plotsusp.m Line: 42 Column: 3
Expression or statement is incorrect--possibly unbalanced (, {, or [.

Error in ==> sim_qcar at 79

Sankar Narayanan

### Sankar Narayanan (view profile)

Hi.. Is there any way to change the road profile data..

Henry Piz

James Allison

### James Allison (view profile)

Amritam:

I would first point you to the following journal paper:
http://systemdesign.illinois.edu/publications/All14b.pdf

and then my dissertation:
http://systemdesign.illinois.edu/publications/All08b.pdf
(chapter on EV design)

Both discuss these metrics. If I remember correctly my dissertation cites at least one reference that compares the simple metrics I use in these models to much more sophisticated metrics (e.g., frequency-based constraints for comfort). The reference then concludes that the simple integral of acceleration metric is very accurate even though it is not very complex. There should be other references that address both rattle space and handling.

Regarding multi-objective optimization, I would suggest the following review article:

AMRITAM DAS

### AMRITAM DAS (view profile)

Hi, Prof.James Allison. You have mentioned that you can't upload the optimization code. But can you at least provide a document or slides which explain the theory behind defining maximum handling capability, maximum comfort and design a multi-objective optimization problem. I am doing my thesis on similar topic. I believe it will be of great help.

James Allison

### James Allison (view profile)

Thank you Patrick for pointing out a fix for newer versions of MATLAB.

Patrick Bright

### Patrick Bright (view profile)

Works on R2015b if you change 'refresh' to 'drawnow'

James Allison

### James Allison (view profile)

I've not tested this code on more recent versions of MATLAB. The animation worked well with R2011b, but perhaps the animation no longer works with more recent releases of MATLAB.

Xaris

### Xaris (view profile)

I can only see the plots and the picture of the suspension. I can't see the kinematic vision

Changhong Wang

James Allison

### James Allison (view profile)

Naveen: IRI_737b is a .mat file included with this submission. You need to make sure it is on your path to run this code.

NAVEEN KUMAR

### NAVEEN KUMAR (view profile)

Hello Mr, James Allison sir,
it seems some thing missing in this part of the program,
Unable to read file IRI_737b: No such file or directory.

Error in Untitled5 (line 43)

plz can u halp me sir..

ben

### ben (view profile)

Hello Mr, James Allison

it seems some thing missing in this part of the program, [~, ....

xend = curr_x + fw;
xpstart = xstart-curr_x;

can you help please? because i cant run it .. it gives me this error

??? Error: File: plotsusp.m Line: 42 Column: 3
Expression or statement is incorrect--possibly unbalanced (, {, or [.

James Allison

### James Allison (view profile)

Saman: Thank you for your interest in the optimization code. I decided not to distribute it because I use it in optimization classes that I teach. You might be interested in this submission:

http://www.mathworks.com/matlabcentral/fileexchange/40504

It includes the optimization code, but is a more complex example.

To answer your other question, f1 is an interface function between qcar (the simulation) and fmincon.

James Allison

### James Allison (view profile)

Saman: Thank you for your *interest* in the optimization code. ...

saman abdanan

Hi James

James Allison

### James Allison (view profile)

Alexandru: Perhaps there is another function 'ss' on your path that is superseding the built-in ss function:

http://www.mathworks.com/help/control/ref/ss.html

You can use the 'which' command to find out if this is the issue.

Another possibility is the ss is part of the control system toolbox. If you don't have that toolbox, then ss will not work.

Alexandru

### Alexandru (view profile)

Hello,

I am interested in your app. But I have problems when running it. I get this error:
Undefined function 'ss' for input arguments of type 'double'.

Error in sim_qcar (line 48)
qcar = ss(Aqcar,Bqcar,Cqcar,Dqcar);

What am I missing?
Thank you!
Alex

James Allison

### James Allison (view profile)

umf is a multiplication factor that allows quick exploration of road profiles with different levels of roughness. It should be set to 1 for the output to correspond to the road profile in the .mat file.

Nice catch Louis. Yes, dt should be changed to dt2 on line 62.

Louis

### Louis (view profile)

1. I think umf should be set to 1 (or removed)
2. on line 62 the division by dt should be changed to a division by dt2

These two details made the script output inaccurate results; the script otherwise gives consistent results.

Chegireddy Venkateswara Reddy

nice demo

Mayur

### Mayur (view profile)

James,

Thanks for this model. I am trying to understand what umf = 3 is, and why you have used it. Could you please explain.

Thanks,
Mayur

Olexander Zhytenko

### Olexander Zhytenko (view profile)

very nice !!!

 14 Mar 2019 1.0.0.1 Updated description
##### MATLAB Release Compatibility
Created with R2011b
Compatible with any release
##### Platform Compatibility
Windows macOS Linux