Page 1 of 2
Calculating acceleration of unsprung mass
Posted:
Tue Oct 04, 2011 7:56 pm
by CAPMAGIC
Hi there,
I need to calculate the acceleration of unsprung mass per wheel. I do have a linear potentiometer on every wheel to measure deflection.
For my formula I need the delta value between two measured values. How do I code this?
Greetings
Julian
Re: Calculating acceleration of unsprung mass
Posted:
Thu Oct 06, 2011 8:50 am
by PaulGM
Julian,
If you are assuming that the corner package has had a force applied to it directly, then the acceleration of that unsprung mass is simply the second derivative of position (or the derivative of velocity, whichever you already have setup).
Unfortunately, you don't really know (without platform-condition calculations and some other sensors) whether the corner is being compressed/elongated due to platform movement or due to gravity/bump force acting on the unsprung mass in the corner package. For example, if the car is braking then the front corners will be compressed and you would see a vertical acceleration from your calculations, but in reality they have not vertically accelerated (the sprung mass of the main vehicle body has accelerated downwards).
Could you explain what you mean by needing a "delta value between measured values"? What are you trying to accomplish?
Re: Calculating acceleration of unsprung mass
Posted:
Thu Oct 06, 2011 11:39 pm
by Holmz
PaulGM wrote:Julian,
...
Could you explain what you mean by needing a "delta value between measured values"? What are you trying to accomplish?
I m pretty sure he means d/dt(P) - so "a numerically derived derivative of position" to get velocity and then d/dt(V) - or d^2/dt(P) to get the numerical derivative of acceleration.
If I was not too lazy to boot into windows I would look up the how you do that in i2.
But I am interested how you do that in i2 as well.
Re: Calculating acceleration of unsprung mass
Posted:
Fri Oct 07, 2011 3:44 am
by PaulGM
Both integrals and derivatives are included in i2 as Functions in the Math Expression Editor. I do not know what method i2 uses to calculate derivatives internally, but one of the Software Engineers from Australia may pipe in on this thread if they see it.
As for calculating derivative estimates manually (near the limit, at the minimum sample step), you cannot do this in the Channel Maths, as you can only reference the Nth sample (not the Nth-1 or Nth+1 sample). You have to write your own Function in VB or C# and they will show up in the list of Functions; any solving method you choose can be used in this case.
Re: Calculating acceleration of unsprung mass
Posted:
Fri Oct 07, 2011 7:53 pm
by CAPMAGIC
Hi,
thanks for the answers. What I was looking for is "derivative".
Holmz is right with his interpretation. That's what I meant.
Greetings
Julian
Re: Calculating acceleration of unsprung mass
Posted:
Sat Oct 08, 2011 10:17 am
by PaulGM
My apologies, the term I'm used to seeing is "Difference Quotient."
The above answer stands, in that a Difference Quotient at any step size will need to be calculated by a custom function.
Re: Calculating acceleration of unsprung mass
Posted:
Sat Oct 08, 2011 4:06 pm
by Holmz
PaulGM wrote:My apologies, the term I'm used to seeing is "Difference Quotient."
The above answer stands, in that a Difference Quotient at any step size will need to be calculated by a custom function.
Thanks Paul-
I will dig out those .dll motes and do this in the next week or two.
~Holmz
Re: Calculating acceleration of unsprung mass
Posted:
Tue Oct 11, 2011 4:46 am
by PaulGM
Holmz,
No worries. If you have any questions with writing the Plugins or Functions, please post them here and I will try and answer them in a timely manner.
You may already be aware, there is also sample code available in the installation directory for i2 Pro (the absolute directory will be something like Program Files\Motec\i2\1.0\Samples\Maths\). You may have to include a Motec DLL in the code with a slightly different name than the one already present (I believe the old reference was to "Interpreter.DLL" and it should be to "Analysis.DLL" now) to get them to work.
When you add the Functions or Plugins, make sure that you run i2 as an Adminstrator (not just your user account, but actually run the software as Administrator). With Functions, you will have to restart i2 to get them in the Maths listing.
Paul
Re: Calculating acceleration of unsprung mass
Posted:
Tue Oct 11, 2011 11:41 am
by Holmz
PaulGM wrote:Holmz,
No worries. If you have any questions with writing the Plugins or Functions, please post them here and I will try and answer them in a timely manner.
You may already be aware, there is also sample code available in the installation directory for i2 Pro (the absolute directory will be something like Program Files\Motec\i2\1.0\Samples\Maths\). You may have to include a Motec DLL in the code with a slightly different name than the one already present (I believe the old reference was to "Interpreter.DLL" and it should be to "Analysis.DLL" now) to get them to work.
When you add the Functions or Plugins, make sure that you run i2 as an Adminstrator (not just your user account, but actually run the software as Administrator). With Functions, you will have to restart i2 to get them in the Maths listing.
Paul
Thanks Paul..
HDD died over he weekend.
Q1> How does one put in things like Coefficient of Aero drag or other constants and pick those up in the .dll call?
Q2> Does the .dll run the number for the entire file duration, or just the windowed data?
I'll have more no doubt...
Re: Calculating acceleration of unsprung mass
Posted:
Wed Oct 12, 2011 7:58 am
by PaulGM
Holmz,
Funny you mention the HDD; I just lost a motherboard and am in the process of setting up another workstation here in the office. Until I'm up and running again I won't actually be able to test my own statements, but here is what I know from previous experience:
1. When experimenting with i2 Constants previously, I've found that the software treated them like normal channels that were (pardon the wordplay) constant. In other words, a constant of something like "Spring Rate = 400 lbs/in" is just going to be a channel which is 400 for the duration of the Outing (which, in i2, refers to a collection of laps categorized by a single run on the track; you can see where Outings begin and end programatically or just opening multiple files in i2 and looking at how the "Data" window organizes them). In the Function/Plugin code, the method which selects Input channels from the current dataset should have access to the constant by name.
2. The loop written into the sample code's Evaluation method, by definition, covers the entire outing. If it didn't, you would have to replace any non-numeric values with a specific string (which I believe is "N/A" or "Invalid"). If there is any value in the channel over the course of the outing that i2 doesn't like, it will not display the channel at all and list an error in the Channel Status. I cannot test right now to see if those strings will work, but you can try both; either that, or just enter a 0 anywhere you don't care to evaluate a calculation.
Sorry that I cannot test these statements right now to confirm their accuracy, but I will do so as soon as my workstation is set up again.