PDA

View Full Version : Lapsim



Kevin V
09-07-2013, 08:00 PM
I want to create a lap simulator for my team to use. I do not know where to begin but to read papers about it. One thing I want to be included model is the weight transfer of the vehicle. If anyone has any input to how to start one or where to begin that would be great!

tgman
09-07-2013, 11:17 PM
The best place to start is by working out what you know about your vehicle and defining a mathematical model to transfer this into forces onto the tires. The approach I took was just get a the pen and paper out to work out the relationships between all the forces and as you have there how weight transfer will effect those forces. Pretty quickly you should realise the you need very different models for the vehicle when its cornering and when its travelling in a straight line. Sit down, think about both those cases and develop a mathematical model that represents them.

The next step is probably to think about what sort of track or scenarios you want to test the vehicle over. This can be the form of you just looking at a Nascar oval or you can do what I have done for the last two years at FSAE-A and wonder around with a trundle wheel, string, note pad and gps tracker.

If you have the sort of track or scenarios that you want to test the vehicle over work out how to stick it into a computer. Firstly a purely analytical solution is virtually impossible, iterative simulations are a million times easier. Find a method you enjoy (I have seen both excel and Matlab producing pretty good results) to program the thing and just think of the most logical way to do things. I made the assumption that we would be limited by grip in the corners rather than engine power which allows you to work out what speed you would enter and leave every straight section, this makes acceleration modelling and braking relatively easy because you have the initial and final speeds and you just work from both ends until they match up. This was a very simple model to program but has obvious short comings, the first one that comes to mind is that if you have 2 corners in a row there is a step change in velocity between them but there are a few others. Having said that I got results to within a few decimals of a percent of results from comp that year with an approach that simple (possibly dumb luck but I am claiming hard work). I also like that when you play with variables it behaves pretty well as expected (hint to everyone - get big wings, screw drag!!).

An approach like that can work but I have also seen ones doing the calculations using energy instead of forces, so don't take this as necessarily a good idea. There are many ways to skin a cat, look at what tools / knowledge you have at your disposal and work from there

My 2c, take it or leave it

Claude Rouelle
09-08-2013, 12:45 PM
Kevin,

For weight transfer I suggest you start with the last Excel spreadsheet created by Karam in the Damper Rates post. Karam did a good job. It is not perfect because this simulation is a bit simplified but it is useful. I know FSAE / FS teams who use it (or something very similar) and were able to make good understanding of their car and good progress on track.

Before you go to the full steady state or transient study of a car I suggest you download OptimumLap which is a simplified mass-point lap time simulation. It is free of charge. Some people think that if it is free of charge and it is simplified it must not be good. Well try... It will help you to appreciate the compromise to be done between weight, power, grip, aero drag and aero downforce. We use a much more complete simulation package called OptimumDynamics with our passenger car and race car consulting customers but a few months ago we used the "simplified" OptimumLap for a LMP2 team which ended up making first and second in last June 24 hours of Le Mans and we were 0.5 second wrong on a 3.38.0 lap time.

One of the thing I always insist on in the company or students seminar OptimumG teaches or in universities course I teach is "Why don't you try to make it useful before you make it complicated?"

Big Bird
09-08-2013, 10:08 PM
I'm with Claude on the "make it useful before you make it complicated" philosophy. It is very easy to succumb to the lofty ambitions mentality when designing a lapsim - the "we can have weight transfer and we can have transients and damping and gearshifts and engine maps and optimized paths and ...." mindset that leads to a project that never gets finished.

Know what you want to achieve with your lapsim, and limit your ambitions to exactly that. Every new feature is another potential failure point.

My advice - set yourself a time limit for the finished product, start from the very basics and build the lapsim incrementally (excel is great for this). Divide a track into straights and corners, divide it into 1 metre increments, and using your first year dynamics theory to calculate the velocity at the end of each metre given the vehicle characteristics (power, velocity, resistance) at the start of each metre. Your output velocity at the end of each metre becomes the input velocity at the start of the next. Start with a point mass vehicle of constant power and infinite grip, and then start refining. Note that it is VERY important to sense check your outputs at every step of the way - so as you get a feel for the numbers and a sense of how much "more accurate" your model becomes as you complicate it.

Steps that I added in to mine incrementally:
Self-selecting braking markers on straights
Self-selecting grip or power limited acceleration
Wind resistance
Tyre grip variance for differing vehicle masses (load sensitivity)
A non-linear lookup chart engine model
I never got around to aero, but it wouldn't be hard

A trick if you are using Excel:
Put in columns for power limited acceleration, and grip limited acceleration. Calculate each for every metre, then a third column that selects the lower of the two values. Voila, you now have a self-selecting function reading out how much time you are grip limited and power limited

I slapped together a good points simulator in about a weekend, using straight lines and circular arcs for a track, that was accurate enough to drive the early conceptual design of our cars. I learnt a huge amount about the sensitivity of vehicle mass and power on overall results. Many of my successors pointed out the shortcomings of my model, and I don't know how many final year project proposals I read that started along the lines of "the existing RMIT lapsim is very rudimentary and we will improve it by adding (cornering transients, spline cornering, weight transfer, etc etc)." And I never saw one of these "improved" lapsims completed.

A 95% accurate model tomorrow is more useful than a 96% accurate model in twelve months' time...

Cheers,

Geoff

dynatune
09-10-2013, 08:49 AM
Kevin,

Creating a laptime simulator is far from simple and takes a lot of work. I speak out of experience, I have just put one in EXCEL for an affordable price on the market. Maybe you should have a look at it on: www.dynatune-xl.com

Dynatune

exFSAE
09-11-2013, 08:03 PM
Creating a laptime simulator is far from simple and takes a lot of work.

Can't say I agree with this statement. A lap time simulator is only as complicated and difficult as you choose to make it, same as any tool. In my opinion (and experience) a meaningful LTS can be banged out in a day, if not a weekend, in a programming language of your choice. Will it be a very simple model? Yes, but insightful none the less.

Ultimately all models are "wrong" and only some are useful, so you cannot ever create the "perfectly correct" model by heaping on complexity. It's always a choice you have to make... to answer 'question X', what is the simplest / fastest / most economical method of doing so that will get you the right solution? Sometimes that may be an ADAMS model. Sometimes it may be a point mass vehicle sim you whip up over a couple beer and a Chipotle burrito.

dynatune
09-13-2013, 09:30 AM
Let me explain,

Coming from a long simulation background in ADAMS(over 25 years) and all other kind of simulations I started exactly with the intention to do an elementary simulator in EXCEL (as anything in DYNATUNE has been developed to be as efficient as possible with the least possible complexity in EXCEL) and I did enjoy rather quickly some success. As long as one initially starts with the assumption that laptime is "all braking, all accelerating & all cornering" one can reasonably quick enjoy successes. If you refer to this ok, agreed.
However and very unfortunately for all of us, NOT all corners are pure cornering but sometimes trailbraking, sometimes just a quick lift and sometimes full acceleration all through the corner long and that is where it becomes tricky and interesting. Put on top of that the fact that in all those "intermediate conditions/non full limit ax or ay" the combined slip tire conditions permit "multiple" solutions (more lateral g, less longitudinal g or vice versa) the matter does become rather complex. Then adding understeer and oversteer perception creates another dimension of complexity. And I have not even mentioned yet the work needed to create a simple 2D track from a minimal amount of data. If you are interested have a look at www.dynatune-xl.com and see how the laptime simulator was created and what it is about. There is quite a bit of information on the approach.

exFSAE
09-13-2013, 09:48 PM
Oh I have no doubt that you put plenty of time into your product and that there's a thought process behind your approach. I'm just making the point that those complexities you speak of, are only there because you chose to deem them important enough to include... and that the value added outweighs the complexity added.

As an aside I feel like often a critical question to ask about some software like this is not "What can it do?" but "What can't it do?" or "What can't it do well?"

dynatune
09-14-2013, 06:44 AM
Yes, that is absolutely correct. I made a trade-off on what needs to be in the tool and what not based on an experience of 25 years in vehicle dynamics & simulation, covering the range from a 40t 18 wheeler truck to an F1 car and anything on wheels in between. And your "critical" question has always been the main driver for any development in DYNATUNE.

Cheers,

dynatune www.dynatune-xl.com

DougMilliken
09-14-2013, 10:05 AM
... Sometimes it may be a point mass vehicle sim you whip up over a couple beer and a Chipotle burrito.
As noted in RCVD, p.340, lap time simulations were run in the mid-1950's by Mercedes-Benz and also at CAL (possibly others too--any references are always welcome), but it wasn't always so easy. While the algorithms might have been developed quickly, the actual calculations took a long time! At CAL there was a room full of people with job title "computer", they worked long calculations according to a written out program, using mechanical "adding machines".

Back to the original question, I'm with Claude and Geoff, start out simple and get something working. After you get a feel for the problem(s), reading through RCVD might help you decide what things to add to your lapsim?
http://www.millikenresearch.com/rcvd.html

dynatune
09-20-2013, 01:04 PM
Starting simple is a good thing and if you are interested in programming an excellent idea. The problem(s) that come up will be firstly related to vehicle dynamics - which is great fun to get your mind into - and then will be unavoidably become related to numerical or programming language issues. If you are a novice to vehicle dynamics and numerical mathematics / loop routine logic, you should however carefully decide what it is the "worthy" part that you are looking for in this exercise. If you want a laptime simulator because you are looking to do trade-off studies in vehicle dynamics but you cannot find an affordable one and you are not very interested in writing your own Newton Euler Algorithms, you should definitely use something on the market and spend your time on understanding vehicle dynamics. If you however "always wanted" to learn to program a lap time simulation you should start to write your own - as I did myself. Beware, that it takes a long time and there is a good affordable alternative on the market that will get you right there where you wanted to be.

Cheers

dynatune, www.dynatune-xl.com

Ray19
10-01-2013, 06:16 AM
I have started making my own Lapsim and as people here have suggested I have started off with a very simple point mass model with constant power which is power limited in straights and traction limited in corners and braking. I have done the calculations on paper and will be using Excel to program it. What confuses me is why Geoff here has advised to break the track into 1m increments. I see that even OptimumLap does the same. Can someone tell me why because according to me just dividing the track into straights and corners should be enough.

Edward M. Kasprzak
10-01-2013, 07:07 AM
Think about the next feature you would add to your model: The continuous change in radius from straights to corners and back? Braking or accelerating while cornering? Maximum engine power as a function of engine rpm? Aerodynamic drag/downforce effects? Any of these will need recalculation at many points down a straight or in a corner. At the level of modeling you've chosen you only need straights and corners, but to go any farther you will benefit from smaller divisions.

Many lap sims divide the track into small segments, such as 1 m, to recalculate the force and moment balances. It acts like a "step size" in numerical integration. It's not the only way to do it, but it's very common.

Ray19
10-01-2013, 02:03 PM
Thank you for the quick reply. I had a hunch it might be required for more complicated models. I just wanted to make sure I wasn't going wrong with my current one.

dynatune
10-02-2013, 05:46 PM
Braking up the track in discrete distances is a common practice, but it will never get you to calculate your breaking point down to the last inch. Either you brake up your track to data points of spaced cm or inches which will blow up your data management or you try to do it diverse and more clever. In Dynatune for Excel we have created a method never used prior in laptime simulation with excellent results. Your braking points will be calculated correctly to the mm and your cornering behavior will certainly follow the "performance envelope" of the car in every combined force situation possible. It's all there. Use it.

Cheers,

dynatune, www.dynatune-xl.com

Big Bird
10-03-2013, 10:25 AM
.... Your braking points will be calculated correctly to the mm .....

Big Bird
10-03-2013, 10:33 AM
... correctly...

Big Bird
10-03-2013, 10:35 AM
...millimetre...

DougMilliken
10-03-2013, 11:01 AM
.... Your braking points will be calculated correctly to the mm .....

Just to add a little bit to Geoff's comment, our MRA LTS interpolates between the ends of track sections to find the cut-off (braking) point, this feature was probably added sometime in the late 1980's. It calculates *a* braking point to any arbitrary precision...but since this is a model and not reality, it's unlikely that this is really *the* braking point. Further, the utility of this level of precision is questionable, see, for example, http://www.mathsisfun.com/accuracy-precision.html (edit -- found a better link).

Before the interpolation was added, we were faced with very limited memory in the Apple II+ (64K) and early MS-DOS machines (640K). In 1982 on the Apple, we allowed the track to be broken down into thousands of sections using our own virtual memory scheme (saving intermediate results to disk).

How consistently can race drivers repeat their cutoff point? I'm curious to hear if anyone has looked at this with in-car data?

HenningO
10-04-2013, 07:30 PM
How consistently can race drivers repeat their cutoff point? I'm curious to hear if anyone has looked at this with in-car data?

On this Friday afternoon, I can share some information on this. This is recent data from a championship winning driver in a one of the top racing series in the world. The driver was leading part of this race, but there were some yellow periods (those laps are removed for clarity). This distance is calculated from a fixed point in the corner, so a lower value means the driver is braking later.

Some statistics:
Average brake point: 233.3968 meters before apex (please note the number of decimals...)
Braking point standard deviation: 9.187583 meters

Distance is calculated using wheel speeds so there will inherently be fairly large errors coming from there. Although this is the first corner of the lap (which is triggered by a beacon), so the integration errors (to get from speed to distance) are decent (compared to the last corner).

Dynatune, I'd be interested to hear more about the method you've been using?

dynatune
10-05-2013, 07:05 AM
Thank you guys for your points, we all know that in real life the braking point can differ quite significantly due to many changes of many parameters. However in the virtual world it would be nice to have a robust procedure. Without giving away the full trick: As you can read on the website the approach in dynatune is somewhat different than the usual one. Based on separately calculated 4D performance envelope's (ax, ay, v, and US/OS), at any reference point of the track the car knows what it's performance limit's and will be at that limit. This a fully simultaneous situation for all reference points on the track. Now by cleverly "investigating" the distances between those reference points (for instance in dynatune there are solely 2 data points for a straight) and knowing that the car must obey the performance envelope's one can "iterate dynamically" to a point of "perfect match" of the respective acting performance envelope's. This matching point is obviously not fixed to any distance marker. That's all.

Cheers,

dynatune, www.dynatune-xl.com

MCoach
10-05-2013, 10:24 AM
If you're calculating all of this with a simple model based on cornering stiffness, are you assuming that the tires are only operating in the 'elastic' region?

dynatune
10-05-2013, 06:31 PM
In Dynatune one can select the base tire model that assumes - as is shown on the website - a linear decay of cornering stiffness with lateral force (so it is not a constant cornering stiffness in the elastic region). A linear change in cornering stiffness indicates a non-linear change lateral force over slip angle (since cornering stiffness is the instantaneous derivative of the lateral force at a given slip angle). Beyond that Dynatune provides also an enhanced tire model that reflects the classical tire tables that one typically sees. The user can basically create his own tire in a straight forward understandable manner. Consequently the user can select to create a Performance Envelope based on a linear model (meaning linear suspensions without bumpstops and a linear changing cornering stiffness) or a full non-linear model (meaning considering eventual bumpstops in the suspension and using the classical non-linear tire table for slip angle determination) which comes obviously at increased CPU time.

Cheers

dynatune, www.dynatune-xl.com

exFSAE
10-16-2013, 06:07 AM
To be fair here... I've actually heard some high praise for Paul (Mr. Dynatune) as being quite sharp and experienced in this field. Maybe it's worth giving a look to, even if it isn't a quite "mainstream" utility yet.

dynatune
10-20-2013, 03:17 PM
I wonder who did speak with such praise about me then exFSAE :D, let me know and I will offer you and the guy/lady a beer/glass of wine in return for the flowers.

Being a Petrol Head my "mission" was and is to give young engineers in the field of vehicle dynamics the best possible information/education based on years of experience (many very painful experiences too !) and hoping to see someday a bright young engineer come back to me and show the stubborn old man that he is getting too old ..... With that mindset and trying to capture all that experience in one tool & site I dedicated a significant part of my professional life to develop Dynatune and tried to realize every feature I had thought of "this would be nice to have" in all those years (For instance the 4 dimensional US gradient carpet plot's have never been shown before as far as I know). Whether the tool is worthwhile or not to look into, everybody needs to decide by him/herself. Being a tool in Excel there are of course limits. You will not have a pacejka tire model with 28 parameters for lateral force that you do not oversee anyway (nor do I), but you will have the solid knowledge of experts like Bundorf or Matschinsky at your hands. With respect to other tools, the only thing I can say, is that "mainstream" competition was very "eager" to look at the "new kid on the block". Some gave compliments, some wanted to buy it, some threatened with law-suits. All compliments in one way or the other:cool:

Paul (Mr. Dynatune)