Posted by: drracing | July 10, 2019

Suspension Kinematics Tool strikes back – joining the dark side of Matlab

Hi everybody!

This post is about something old, on one side and something relatively new, on the other side.

As the title says, i am revising my suspension kinematics tool, as I am porting some of the work I did in Excel in the past into Matlab.
After many years, I started working again with Matlab, in an attempt to refresh, improve and update both my skills and my projects, in a coding/computing environment which surely is among the most powerful and widespread in engineering.

I am in no way an expert in coding in Matlab, so this is really a learning exercise for me. Beside bringing the tools and its functionalities into Matlab, my goal with this small project was really to learn and refresh as much as I could in terms of programming.
With this respect, I received some very good help from some friends who have much more experience than me with it and could point me several times in the right direction. The great thing about Matlab, is that there is a huge community sharing every possible advice, files and material online. Beside this, the help provided with the software and the “benefits” of being registered at Mathworks (see for example free training) are also a nice addition.

To be fully honest, i actually think a suspension kinematics tool is probably not the best way to use Matlab full potential. This is really something that would work relatively well also in Excel, in my opinion, with the addition of some simple macros that can be handy for any iterative process, like creating plots of how typical suspension metrics (like toe, camber, etc.) changes with respect to suspension motion.
Anyway, I also think it is a good idea to (re)start with something I know relatively well now and, having already an equivalent tool, also provides a benchmark for correlation.
Moreover, beside the pure tool functionalities, this project offered a good chance to take confidence with a large array of features that can be useful with many other kind of projects in the future.

The way the tool works and its features are principally the same as the one I built in Excel. Also, as the previous one, also this tool is meant only for double wishbones geometries, with a push/pullrod that activates a rocker. The system includes a third element and an U-Antiroll bar.
Still, being the approach one can use in Matlab completely different compared to what can be done in Excel, the way the tool interacts with the user is necessarily different too.
From a solver perspective, the basics are still the same I already explained when I introduced my suspension kinematics tool here for the first time: the position of each pickup point is calculated by intersecting three spheres. The cool think about Matlab is its ability to deal with vectors, which made unnecessary to solve once again the system of three quadratic equations in three unknowns, which is not that funny.

How does the tool work exactly? 
The first step is obviously the input of the pickup points coordinates.
These are already pre-given in the code, but can be manipulated by the user by mean of a table, that also records any change with respect to the initial points.

 

Sus Tool Table

 

The user can afterward specify some other design aspects, like for example to which component the pushrod is attached, and define suspension motion (heave, roll and steering).

 

Sus Tool Table - Push and motion

 

Basing on these inputs, the tools calculates the actual position of each point, the most important metrics (Toe, Camber, Caster, Scrub Radius, Roll center position, etc.) and then output the results with a table, an interactive image of the suspension itself (this is a pretty cool feature in Matlab: you can manipulate the 3D image of the suspension rotating it or zooming in and out) and, depending on user’s input, typical plots of a parallel wheel travel motion (the user can specify if the tool should produce these plots or not; if the plots are produced, the user can input how much travel in compression and rebound must be considered).

 

Sus Tool All results + plots

 

Once the simulation has been done, the user can select which metric he wants to plot with respect to wheel travel, using a popup menu.

The results of each run are saved in a dedicated file, that can be opened with another function, which also plot the results of each run and of each metric comparing them to the same results for all the other runs.

 

Sus Tool comparing results

 

The user can also decide if the numerical results of all runs should be exported to an excel file, to be accessed externally.

It is nothing revolutionary, indeed, as the main functionalities are the same I built in my “old” Excel tool already; still it is nice to have all of this in Matlab too. As i mentioned, although this tool is probably not the best application to explore Matlab potential, it is interesting to see how certain things have to be handled differently compared to Excel and, also, how certain features could be made even more interactive.
Matlab is surely better suited than Excel for typical engineering applications. For sure, having a lot of typical, time consuming, mathematical / numerical approaches to solve certain problems already built in is one of the things that make Matlab more appealing.
Beside this, the opportunity to work so easily on vectors, matrices and differential equations is sure extremely interesting, also with simulation applications in mind.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Categories

%d bloggers like this: