Matlab suspension modeling

Here are our CFD links and discussions about aerodynamics, suspension, driver safety and tyres. Please stick to F1 on this forum.
jihedley
jihedley
0
Joined: 22 Mar 2014, 19:20

Re: Matlab suspension modeling

Post

Yes but its the wrong way to model it. Instead of changing the mass of the wheel (which is unrealistic), you need to add a vertical force to the body which is the load transfer. A force and a mass are not the same thing.
So would I base the roll model on different equations? Because for the original model I based it upon these equations:
m_1 (x.._1)=-k_1 (x_1-x_2)-b_1 ((x._1) -(x._2))
m_2 (x.._2)=k_1 (x_1-x_2)+b_1 ((x._1) -(x._2))-k_2 (x_2-u)-b_2 ((x._2)-u.)

Not sure if you'll be able to make sense of those.
I'd use a lookup table for the spring force which becomes very stiff at the point where it coil binds.
Thanks, I don't know how to use lookup tables, but I'll investigate them and see what I can do.
I'm only experienced with the basics of simulink so I dont have much knowledge in the use of components and matlab commands which is obviously causing me problems.

User avatar
Tim.Wright
330
Joined: 13 Feb 2009, 06:29

Re: Matlab suspension modeling

Post

The load transfer is an extra force that needs to be added to the force balance equations.

For roll you should be at least considering two of those systems together but with M1 being common to both. Though It's hard to give any more advice if I dont know what exactly you are trying to analyse. Are you doing dynamic simulations? static? what are you trying to achieve?
Not the engineer at Force India

User avatar
Tim.Wright
330
Joined: 13 Feb 2009, 06:29

Re: Matlab suspension modeling

Post

P.S. why are you bothering about coil binding? Its a situation that shouldn't occur anyway.
Not the engineer at Force India

jihedley
jihedley
0
Joined: 22 Mar 2014, 19:20

Re: Matlab suspension modeling

Post

Ah ok, I understand that. So I need to insert it into those equations and use 2 sets of the equations (basically 2 models, a model for each wheel) and then link them by the mass of the car body and I'm assuming the centre of gravity position?

I'm trying to do a dynamic simulation to see how much the car body displaces on the outside wheels when going around a constant radius. Its sort of a simulation of a corner on a racing circuit. So it would simulate the suspension displacement at the entry, mid, and exit of the corner.

And I'm simulating coil binding because I've developed a variable rate spring (by adding an extra spring and a mass in between the two springs) and in a variable rate spring, its designed so that when it reaches a limit, the soft section coil binds and the spring effectively becomes a harder spring because of the harder section of spring. I'm not sure if I explained that well or not.

User avatar
Tim.Wright
330
Joined: 13 Feb 2009, 06:29

Re: Matlab suspension modeling

Post

Fair enough. Then yes you will need the body mass (with CG location and roll inertia) which is then connected by the 2 seperate wheel systems.

In that case the basic model you mentioned before will not do what you want without the necessary mods (like adding a common body mass).

My advice would be to model the system yourself from scratch from first principles since its quite a simple system. Draw your system out by hand, define the degrees of freedom and then do a free body diagram of each body. This will probably result in 4 equations like you showed before. Only after that are you in a position to start modelling in simulink.

You know a simple system like this is assuming the roll centres are on the ground? Is this valid for what you want to do?
Not the engineer at Force India

jihedley
jihedley
0
Joined: 22 Mar 2014, 19:20

Re: Matlab suspension modeling

Post

Ah ok that makes sense. I'll give that a go and see if I can get anything out of it.

I've tried to add a lookup table for the variable rate model and I'm struggling to populate the table. It keeps coming up with this
The size of dimension 1 of the table data must equal the size of the corresponding breakpoint data.
error. Do you have any idea what I'm doing wrong?
I'm putting these values for the table data and breakpoint data:
[0.02 0.066]
[31125 41500 51875]

Jersey Tom
Jersey Tom
166
Joined: 29 May 2006, 20:49
Location: Huntersville, NC

Re: Matlab suspension modeling

Post

jihedley wrote:Ah ok that makes sense. I'll give that a go and see if I can get anything out of it.

I've tried to add a lookup table for the variable rate model and I'm struggling to populate the table. It keeps coming up with this
The size of dimension 1 of the table data must equal the size of the corresponding breakpoint data.
error. Do you have any idea what I'm doing wrong?
I'm putting these values for the table data and breakpoint data:
[0.02 0.066]
[31125 41500 51875]
As the error implies.. dimension 1 (0.02, 0.066) only has two entries. Dimension 2 (21125, 41500, 51875) has three entries. Need to be same number in both.
Grip is a four letter word. All opinions are my own and not those of current or previous employers.

jihedley
jihedley
0
Joined: 22 Mar 2014, 19:20

Re: Matlab suspension modeling

Post

Ah yes, that was a stupid mistake to make.
However, I've changed it and it still isnt working. I've now got these values
Table Data: [31125 31125 31125 31125 990000 990000]
Breakpoints: [0.066 0.050 0.040 0.030 0.020 0.010]
and its giving me this error message:
Values of BreakpointsForDimension1 in 'initialsteptest/1-D Lookup Table' must be monotonically increasing. The problem occurs at the number 6 breakpoint. Please change the breakpoint data or use the fixedpoint tools such as Auto Scaling or Fixed-Point Advisor to determine a different parameter dialog type

Blanchimont
Blanchimont
214
Joined: 09 Nov 2012, 23:47

Re: Matlab suspension modeling

Post

The message says: "breakpoints must be monotonically increasing"

Your breakpoints decrease from 0.066 to 0.01. Try to change the order and set 0.01 as the first breakpoint.
Dear FIA, if you read this, please pm me for a redesign of the Technical Regulations to avoid finger nose shapes for 2016! :-)

jihedley
jihedley
0
Joined: 22 Mar 2014, 19:20

Re: Matlab suspension modeling

Post

Blanchimont wrote:The message says: "breakpoints must be monotonically increasing"

Your breakpoints decrease from 0.066 to 0.01. Try to change the order and set 0.01 as the first breakpoint.
This did the trick. Thanks Blanchimont.

TigerF1
TigerF1
0
Joined: 24 Mar 2014, 01:39

Re: Matlab suspension modeling

Post

Hey my first post - loving watching this discussion unfold! - Haven't done Matlab in years!

IF you haven't seen this James Allen piece on tyre load modelling I think you'll like it! Let us know when you work that one out!

http://www.jamesallenonf1.com/2014/03/s ... nder-load/

Cheers all! Rana
*edit - link added :shock:
Last edited by TigerF1 on 24 Mar 2014, 03:26, edited 1 time in total.

User avatar
SiLo
138
Joined: 25 Jul 2010, 19:09

Re: Matlab suspension modeling

Post

I'll just leave my irrelevant comment here:

I HATE MATLAB.

-Physics Graduate.
Felipe Baby!

Jersey Tom
Jersey Tom
166
Joined: 29 May 2006, 20:49
Location: Huntersville, NC

Re: Matlab suspension modeling

Post

SiLo wrote:I'll just leave my irrelevant comment here:

I HATE MATLAB.

-Physics Graduate.
I have to ask - why? Or what do you prefer? In my experience there aren't many better choices for the non-programmer engineer or scientist, especially if you want to just jump in and do something quick and easy.

Memory is managed for you, you don't have to declare types, you don't need to manually compile stuff before you run it, variables can just "hang out" in the workspace as you build your script or program up, arrays will automatically re-dimension themselves as you add data to them (though admittedly this is bad practice for performance), operating on an entire array is easy without having to write loops all over the place, the help documentation is outstanding, errors are descriptive, all the libraries [toolboxes] are incredibly practical for engineering / science work, and there's a large community of users in the technical fields. Not to mention Simulink makes for pretty easy systems modeling.

There are certainly some downsides.. not super fast, editor isn't anywhere as great as Visual Studio with its Intellisense (though really you have to have more strongly or static typed language for that),GUI's aren't particularly rich, and it's not cheap.

If (assuming you don't have a broad computer science and/or programming background) you want to experience hell.. try doing your project in C/C++. For anything I've worked on since graduating 2007, I'd estimate it would easily take me 100x longer to program in C/C++.. and that's truly no exaggeration. Having had to do stuff recently in those languages, it is a much less forgiving environment of unmanaged memory and a very different base library which really isn't conducive to what I'd consider practical engineering work.

Ultimately for me I'd say the strengths or pitfalls of any language come down to (a) how easy and powerful the language is itself, (b) how extensive the libraries are. Matlab language itself is.. eh, it's alright - nothing incredible but it's a safe little sandbox to play in. The libraries are where it crushes anything else - because who has time to write your own basic 1- and 2-d interpolation methods.. much less digital filter implementations.. optimization and data fitting routines.. etc, etc. In many other languages none of that exists for you, you have to make it yourself!

I do hear good things about Python and the libraries that have grown around it, though the impression I get is that while the language is wonderful the libraries aren't quite as extensive as what the Mathworks offers. So for me I live between C# (which is wonderful!) and Matlab.

-Working mechanical engineer
Grip is a four letter word. All opinions are my own and not those of current or previous employers.

nora.rh
nora.rh
0
Joined: 18 Nov 2014, 16:58

Re: Matlab suspension modeling

Post

I was wondering if anyone can give me some advice on how to generate different frequency responses from a simulink suspension model. For example, spring/damper force per unit displacement, or the response of the sprung mass supported by the suspension springs and dampers.

I made a full car model with nonlinear values (lookup tables) for the dampers, springs and tyre stiffness, and 'ground position' as an input (either a step function, chirp signal or sinewave).

I already tried the following:

- Using FRESTIMATE. Here I am uncertain if I should use just an open-loop in- and output as linearization type, or whether it is better to use an additive input at a certain point in the loop (input perturbation), and I'm also not sure where exactly to place them to generate certain frequency responses. Whatever I have been trying, the outcome never looks like a standard bode diagram, the graph fluctuates too much.

- Using the System Identification App. Again here I'm not sure what linearization type and placing to use. I also don't know what number of poles and zeros I should choose.

- Applying the state space model, as shown here:
http://nl.mathworks.com/help/robust/gs/ ... esign.html
The problem is that my damping coefficients and stiffnesses are not constants, but timeseries. I made a loop to make it work like the example, but obviously that generates a different frequency response for each time, which makes the whole point of describing the problem in the frequency domain useless.

- Using the Matlab tf and bode functions, as shown here:
http://ctms.engin.umich.edu/CTMS/index. ... lFrequency
For the constant values used in this example I made 'To Workspace' blocks in my Simulink model, which generate timeseries. Again I made a loop, and I again have the problem there is a different frequency response at different times.

I would highly appreciate any feedback, advice or other ideas to try!

Greg Locock
Greg Locock
237
Joined: 30 Jun 2012, 00:48

Re: Matlab suspension modeling

Post

Almost all of the analysis methods you have suggested are inappropriate for a non linear model.

The easy way to do it is to apply a sine sweep excitation to the contact patch. Of course what this will mostly do is excite wheelhop, so you might consider forcing the system at another point.

Your problem is analagous to experimental modal analysis.

The other option is to replace all your non linearities with linear models.