PiBoSo Official Forum

GP Bikes => Mods => Plugins => Topic started by: afarre on February 17, 2017, 01:48:28 PM

Title: Pos & Vel & Acc & Attiude (roll,pitch,yaw) data have a lot of vibration
Post by: afarre on February 17, 2017, 01:48:28 PM
For example this is what I get for acceleration at plugin (m_fAccelerationX/Y/Z) once converted fron G’s to m/s2 WHILE BEING STOPPED at pit lane:

Tm:10.651  Acc: -0.03854,  0.04696,  0.02026
Tm:10.661  Acc:  0.03568, -0.01455, -0.01586
Tm:10.671  Acc: -0.01369,  0.00086, -0.06813
Tm:10.681  Acc:  0.05925, -0.01978,  0.00242
Tm:10.691  Acc: -0.11423,  0.11189,  0.07062
Tm:10.701  Acc:  0.10622, -0.10067, -0.08319
Tm:10.711  Acc: -0.03617,  0.04870,  0.04864
Tm:10.721  Acc:  0.00575, -0.03101,  0.00218
Tm:10.731  Acc:  0.01728,  0.05173,  0.02555
Tm:10.741  Acc: -0.02552, -0.04527,  0.00980

It is a lot, see how sometimes vibration is of tenths of a m/s2. It is annoying for example for connecting any sort of movement platform.

It can be removed by applying a Low Pass Filter but it is to introduce important delays (latency). I am wondering how people using movement platforms are dealing with this problem.

Also I have to ask if is possible to remove that vibration from GPB output data.
Title: Re: Pos & Vel & Acc & Attiude (roll,pitch,yaw) data have a lot of vibration
Post by: HornetMaX on February 17, 2017, 03:49:12 PM
What's an m/sg2 ?
Title: Re: Pos & Vel & Acc & Attiude (roll,pitch,yaw) data have a lot of vibration
Post by: afarre on February 17, 2017, 04:00:08 PM
sorry, I mean meter/seconds^2 (plugin GPB acceleration * 9.81)
Title: Re: Pos & Vel & Acc & Attiude (roll,pitch,yaw) data have a lot of vibration
Post by: HornetMaX on February 17, 2017, 04:01:56 PM
Well, a bike does have vibrations when the engine is on. Does the output vibrate that much when the engine is OFF ?
Title: Re: Pos & Vel & Acc & Attiude (roll,pitch,yaw) data have a lot of vibration
Post by: afarre on February 17, 2017, 06:24:03 PM
I have to confess that I have no idea how to turn the engine off, but in crashed status, once the engine sound is off, vibration data remains.
I hope it is equivalent to turning the engine off and means that data vibration at plugin has nothing to do with engine rumble.
Title: Re: Pos & Vel & Acc & Attiude (roll,pitch,yaw) data have a lot of vibration
Post by: HornetMaX on February 17, 2017, 07:39:53 PM
Quote from: afarre on February 17, 2017, 06:24:03 PM
I have to confess that I have no idea how to turn the engine off,

Slam the bike in 1st gear, engine will stall.
Title: Re: Pos & Vel & Acc & Attiude (roll,pitch,yaw) data have a lot of vibration
Post by: PiBoSo on February 17, 2017, 08:50:35 PM

Which output frequency are you using?

Do you still have the vibration while riding along the track?
If this is the case, an option could be to apply the low pass filter only under a threshold bike velocity.
Title: Re: Pos & Vel & Acc & Attiude (roll,pitch,yaw) data have a lot of vibration
Post by: afarre on February 18, 2017, 08:38:44 AM
Quote from: HornetMaX on February 17, 2017, 07:39:53 PM
Quote from: afarre on February 17, 2017, 06:24:03 PM
I have to confess that I have no idea how to turn the engine off,

Slam the bike in 1st gear, engine will stall.
Ok, thanks, then I did it right, at the end the only way to stop the engine is crashing :)
Title: Re: Pos & Vel & Acc & Attiude (roll,pitch,yaw) data have a lot of vibration
Post by: afarre on February 18, 2017, 08:49:18 AM
Quote from: PiBoSo on February 17, 2017, 08:50:35 PM

Which output frequency are you using?

Do you still have the vibration while riding along the track?
If this is the case, an option could be to apply the low pass filter only under a threshold bike velocity.

Hello PiBoSo, tested with al frecuencies (10, 20, 50, 100Hz) with same results.

Please find attached a couple of graphs (second one is a zoomed part of first one) recorded at 50Hz.

Red graph = m_fAccelerationZ * 9.81
Blue graph = m_fSpeedometer

Data recording secuence:
Record 1-80: bike stopped
Record 80-352: max throttle, 1st gear, until bike reaches 20m/s speed
Record 352-456: max breaking until bike stops
Record 456-625: bike stopped

See at zoomed graph how vibration is even present while increasing velocity.
See how vibration is even worst during breaking.
See when bike is stopped again, suddenly appears some heavy acceleration peak values.

Because the problem is present at all velocities, it does not seem that an Adaptive LPF as function of velocity is going to help.
Title: Re: Pos & Vel & Acc & Attiude (roll,pitch,yaw) data have a lot of vibration
Post by: afarre on February 18, 2017, 09:06:45 AM
Some extra information:
I tried to get acceleration from pos (m_fPosX/Y/Z) or from velocity (m_fVelocityX/Y/Z), with same result, or even worst because 3 issues:
Pos or Vel data come in world coordinates which need to be converted to bike-local by applying bike-attitude matrix which is build also from vibrating data roll/pitch/yaw.
Even using double precision matrix introduces vibration because it is built with single precision data (float).
Acceleration coming from GPB already has some sort of filtering (averaging).
Title: Re: Pos & Vel & Acc & Attiude (roll,pitch,yaw) data have a lot of vibration
Post by: HornetMaX on February 18, 2017, 11:37:15 AM
Quote from: afarre on February 18, 2017, 08:38:44 AM
Ok, thanks, then I did it right, at the end the only way to stop the engine is crashing :)
No need to crash. You can stall the engine without crashing, like on a real bike.

Quote from: afarre on February 18, 2017, 08:49:18 AM
Red graph = m_fAccelerationZ * 9.81
You probably meant / 9.81, just to be sure.

Quote from: afarre on February 18, 2017, 08:49:18 AM
Because the problem is present at all velocities, it does not seem that an Adaptive LPF as function of velocity is going to help.
What PiBoSo proposed is to have some filtering active only below a certain speed, but that was if the problem was visible only with the bike stopped.

Anyway, unless there's a way for PiBoSo to "fix" this, why is this bothering you ? What are you trying to do with the acceleration signal ?
I'd tend to think that for most applications, simply using a moving average should help you in smoothing it.
It's probably unintentional, but the signal looks like one coming out from a noisy sensor :)
Title: Re: Pos & Vel & Acc & Attiude (roll,pitch,yaw) data have a lot of vibration
Post by: afarre on February 18, 2017, 11:57:56 AM
Quote from: HornetMaX on February 18, 2017, 11:37:15 AM
You probably meant / 9.81, just to be sure.
Nope, m_fAccelerationZ comes in G's, so it should be multiplied by 9.81 to be converted to m/s2.
Title: Re: Pos & Vel & Acc & Attiude (roll,pitch,yaw) data have a lot of vibration
Post by: afarre on February 18, 2017, 12:09:57 PM
Quote from: HornetMaX on February 18, 2017, 11:37:15 AM
Anyway, unless there's a way for PiBoSo to "fix" this, why is this bothering you ? What are you trying to do with the acceleration signal ?
I'd tend to think that for most applications, simply using a moving average should help you in smoothing it.
It's probably unintentional, but the signal looks like one coming out from a noisy sensor :)
I am in the midlle of development of a new movement platform and, as any simulation movement platform, it is fed with acceleration data. As stated at very begining, high frec noise can be filtered out but it always is going to create delays increasing simulator latency.

I don't know about GPB internals, but based in my experience I can say that this problem is very similar to 3D apps handling data in single precision (float) instead doubles, mainly when there are matrix products in between.
Title: Re: Pos & Vel & Acc & Attiude (roll,pitch,yaw) data have a lot of vibration
Post by: HornetMaX on February 18, 2017, 04:51:23 PM
Quote from: afarre on February 18, 2017, 11:57:56 AM
Quote from: HornetMaX on February 18, 2017, 11:37:15 AM
You probably meant / 9.81, just to be sure.
Nope, m_fAccelerationZ comes in G's, so it should be multiplied by 9.81 to be converted to m/s2.
Oups, right.

Quote from: afarre on February 18, 2017, 12:09:57 PM
I am in the midlle of development of a new movement platform and, as any simulation movement platform, it is fed with acceleration data. As stated at very begining, high frec noise can be filtered out but it always is going to create delays increasing simulator latency.
True but would that make a difference (the delay I mean) ? Did you try ?

Quote from: afarre on February 18, 2017, 12:09:57 PM
I don't know about GPB internals, but based in my experience I can say that this problem is very similar to 3D apps handling data in single precision (float) instead doubles, mainly when there are matrix products in between.
That's why I'm not sure it can be "fixed".
Title: Re: Pos & Vel & Acc & Attiude (roll,pitch,yaw) data have a lot of vibration
Post by: afarre on February 18, 2017, 05:41:59 PM
Quote from: HornetMaX on February 18, 2017, 04:51:23 PM
Quote from: afarre on February 18, 2017, 12:09:57 PM
I am in the midlle of development of a new movement platform and, as any simulation movement platform, it is fed with acceleration data. As stated at very begining, high frec noise can be filtered out but it always is going to create delays increasing simulator latency.
True but would that make a difference (the delay I mean) ? Did you try ?

Quote from: afarre on February 18, 2017, 12:09:57 PM
I don't know about GPB internals, but based in my experience I can say that this problem is very similar to 3D apps handling data in single precision (float) instead doubles, mainly when there are matrix products in between.
That's why I'm not sure it can be "fixed".

I can deal with this  :)
I just wanted to warn about this issue just in case it could be a bug.
About delays, just say that latency is always a hard nut to crack in simulation, so keeping it as low as possible is always a good practice  ;)
Title: Re: Pos & Vel & Acc & Attiude (roll,pitch,yaw) data have a lot of vibration
Post by: h106frp on February 18, 2017, 06:05:16 PM
I would expect most of this low level or high frequency (step change) could be tuned out with the servo drivers PID loop and some of it will just be lost becuase the motion platform just will not respond quick enough.
Title: Re: Pos & Vel & Acc & Attiude (roll,pitch,yaw) data have a lot of vibration
Post by: HornetMaX on February 18, 2017, 06:08:18 PM
Quote from: h106frp on February 18, 2017, 06:05:16 PM
I would expect most of this low level or high frequency (step change) could be tuned out with the servo drivers PID loop and some of it will just be lost becuase the motion platform just will not respond quick enough.
Exactly. If you're "just" driving a servo with that signal, it is very likely the noise will be filtered out anyway.

The nois is annoying only if you do some advanced control and/or signal processing, like online identification of some bike parameters or usage of the acc signal for some estimator (e.g. lean angle estimation).
Title: Re: Pos & Vel & Acc & Attiude (roll,pitch,yaw) data have a lot of vibration
Post by: afarre on February 19, 2017, 07:24:55 AM
You are both right, this high frecuency & low amplitide noise is not a big issue to direct drive hardware actuators.
It does become an issue when needed to handle that data at software post-processing, like me  :-[

I recognice that when handling recorded real telemetries, I necessarily need to apply filtering becuase real telemetry is always noisy.
Even that it seems to be buggy having similar noise at syntetic data coming from physics model, mainly when noise remains when engine stalls or bike crashes
Title: Re: Pos & Vel & Acc & Attiude (roll,pitch,yaw) data have a lot of vibration
Post by: h106frp on February 19, 2017, 10:39:48 AM
I dont know if it help but i have noted that the background vibration levels (including stationary) is bike dependant. Poorly defined bike/suspension geometry (GEOM) appears to make the problem much wose so might be worth sampling across several bikes.
Title: Re: Pos & Vel & Acc & Attiude (roll,pitch,yaw) data have a lot of vibration
Post by: HornetMaX on February 19, 2017, 11:20:18 AM
Quote from: afarre on February 19, 2017, 07:24:55 AM
You are both right, this high frecuency & low amplitide noise is not a big issue to direct drive hardware actuators.
It does become an issue when needed to handle that data at software post-processing, like me  :-[
But what kind of post-processing do you need ?  Didn't you say that you're "only" using this to drive the movement platform ?
Because in that case you have the filtering done by the actuators, plus the one you need to do anyway (to prevent the platform reacting too much when, let's say, the bike smashes in a wall) etc.

Quote from: afarre on February 19, 2017, 07:24:55 AM
I recognice that when handling recorded real telemetries, I necessarily need to apply filtering becuase real telemetry is always noisy.
Even that it seems to be buggy having similar noise at syntetic data coming from physics model, mainly when noise remains when engine stalls or bike crashes
I wouldn't say buggy but I agree that it shouldn't be there, unless it comes from the engine vibrations (I have no idea if the amplitude is realistic or if GPB even "simulates" that, easy to check though: bike standing still, very the RPMs and see if the vibration is affected).

What h106 said is interesting.

Random question for Piboso (just a curiosity, not a suggestion): what would be the penalty in going from float to double ? Huge ?
Title: Re: Pos & Vel & Acc & Attiude (roll,pitch,yaw) data have a lot of vibration
Post by: afarre on February 20, 2017, 10:15:50 AM
Before continuing, let me apologize because I had to start by introducing myself, that was because I already did it with PiBoSo by private mail, I'm sorry again.

I am developing a simulation project with the skill of faithful reproduce all bike environment cues. Compared with any other kind of simulator here we find 2 hard nuts to crack: physics model and movement platform.

For both subsystems I would prefer to act as integrator of existing parts but, about physic model there is nothing similar to rFactor for bikes, finding that GPB closely match what I need, starting with its interfacing hardness.

About platform does not exist anything able to reproduce bike accelerations in terms of intensity and sustainability, so I am developing a new platform & 'motion cues algorithm', which can reproduce all bike accelerations with no limit of time.

Mentioned algorithm includes a lot of post-processing. While I have tried to use GBP output interface 'as it is', I found that I need some other data, or maybe I can get them by transforming available ones. Example: I would need pos & vel & acc based on 'ground reference' instead CG, but I hope I can get them by undoing the transform to CG.

But, in any case, a more stable data would help, do not forget that vibration occurs even with bike stopped and engine off (stalled).

From this point let me do some more tests to manage both problems: vibration and getting needed data from available ones, and I will post my results.
Title: Re: Pos & Vel & Acc & Attiude (roll,pitch,yaw) data have a lot of vibration
Post by: afarre on February 20, 2017, 10:17:56 AM
Just in case anybody wants to check vibrating data just follow this:

Enable telemetry output (http://forum.piboso.com/index.php?topic=19.0)
Run GPB and, as HornetMaX said, slam the bike (1st gear, having gear and clutch in manual)
Wait until bike stops; wait few more seconds to record telemetry with bike stopped.
Exit GPB
Edit file “GP Bikes\gpbikes\logdata.csv”, go to the end of file and see how numbers are dancing at columns 8 & 9 ("LatAcc","LonAcc")

NOTE: see that vibration is 10 times bigger because logdata.csv acceleration is in G’s, but it needs to be converted to m/s2, in coherence with pos & vel, for any sort of use.