vehicle test bench - smoothing dynamics data with KALMAN filter

5 次查看(过去 30 天)
He guys,
i'm working on a tiny vehicle power test bench (cmp. fig. 1). while doing so i'm using a SIEMENS S7 1516 CPU, a SIEMENS CU320 and SIEMENS 1FT7..-Servo drives. The DUTs are bambini karts. the servo drive directly measure angles (encoder) and provides derivates like velocity and acceleration (i guess/bet/am sure it's be done by difference quotient as well). the kart's combustion engine is a HONDA GX200 one piston engine which produce huuuuge systematic disturtion. the dynamics are measured and applied right on karts rear axle (dismounted rear wheels). the system (kart) is using an automatic centrifugal clutch. so at cold temperatures the rear axle is slightly following the engine's idle speed at no-load scenes.
fig. 1: test bench enviroment
the main goal for now is to implement a clearly, smooth acceleration-dependent torque load, which is generated by servos.
the main equation to do so is: , where as α is the angular acceleration, is the translationa mass (driver + kart), and is the rotational inertia. Therefore i can use the measurement values of angle or the derivates velocity and acceleration (all come from Servo). The test sequence is a max-throttle ramp [cmp. fig. 2).
fig. 2: max speed up test ramp
the time is measured in , the angle is measured in , the velocity is measured in , the acceleration pops up in
one of the problems is, that the one piston engine creates velocity depenent systematic noise. there are several milliseconds where the velo is high (ignition/combustion) then there are several milliseconds, where the velo is low (blow out phase). So this isn't really white gaussian noise and it's frequency is raising hand in hand with velocity. you can imagine what the acceleration values coming from servo looks like. i need to get rid of the sub alternating accelerations while the global acceleration is constant, rising or falling otherwise my servo drive always punches the GX200 and there is no real motion
fig. 3: systematic noise
the mentioned test ramp is like this:
fig. 4: test ramp without load
the blue line is the velocity right from the Servo drive (so also right of rear axle). it starts from 0. then the GX200 is jump started and it's speed idles. the rear axle's velo is doing so as well and falling near to (degree per seconds). then the maximum throttle situation is applied. the velo is immediately falling to maximum speed within round about . then the mechanical speed limiter limits the velocity. at throttle is turned off and the coast down phase is starting. whats going on in here within one second needs to be slowed down to about eight seconds. if we find a satisfying solution in here, i can generate a continiously load to slow down this process and imitate a real on-the-road-ride. on the road the max-speed-up-ramp is lasting about this eight seconds.
so far i tried several thing to filter data. i used mooving average filters. i used PT1 filters and finally i used Kalman filters
e. g.:
  • use the real measurement value: angle -> filter -> and derive velo and acc -> unsatisfying
  • use the derivates of servo values: velocity -> filter -> and derive acc -> unsatisfying
  • tried several Kalman configurations like (0th order, 1st order, 2nd order, 1 state var, 2 state vars, 3 state vars) -> unsatisfying
no filter result is really satisfying. some look really good and smooth from the distance but zoomed in ....
MAF - mooving average filtering:
fig. 5: exemplary velocity-MAF where smoothing looks good
If the smoothing is felt as pretty good (global smoothing) the remaining time delay is about
As expected, same results at PT1 filterings.
PT1 - filtering:
fig. 6: exemplary velocity-PT1-filtering
in every filter result, wheras the global smoothing is quite good, there is to much alternating in the max speed range. when i zoom into velocity tip at i'm finding to much remaining alternating velocity. every difference quotient qould put much alternating accelerations.
fig. 7: closer view at maximum velocity range
i need to find a way, where i dont have remaining time delay and smooth out every up-and-down. even if i'm using filtered angle, i dont get all of this ( i know that filtering is a compromise (theoretically i can't get something without dying another death))
when i tried several Kalman implementations, it always lead to results like this:
fig. 8: exemplary Kalman filtering
that is also looking quite good, but if zoomed in...
fig. 9: detail of fig. 8. closer view to max speed range
there is remaining ripple, which leads to alternating accelerations. And there is no matter whether i "diffQuo" the KF-filtered velocity or take the acceleration estimates of KF. Every try leads so same struggles / issues. theoretically i'ld like to get results like this (green in fig. 10) or way less ripple in face of as less as possible time delay... (yaaaah, i know, dont bitch about me ^^ !)
fig. 10: theoretically aimed curve with Kalman-filtering (grenn line)
So is there someone who is motivated to take my data, to fiddle a little and maybe we (you) find a better result than me did. i'm pretty sure you will.
attachements:
  • ServoDat.mat - carries the measurement/deviates data; 1st column relative measurement time in ; 2nd column relative rotaional angle in (directly measured of/by Servo); 3rd column angular velocity in (derived of/by Servo); 4th column angular acceleration in (derived of/by Servo)
  • PT1_filtering.mlx - carries the section of my live editor where PT1 filtering is applied multiple times. you can set a vector of weights C to calculate multiple parameters and plot the results in one figure with plot browser enabled. so you can switch on / switch off certain plots and better compare the effects of C-variations
  • MAF_filtering.mlx - carries the section of my live editor where MAF filtering is applied multiple times. you can set a vector of window sizes W to calculate multiple parameters and plot the results in one figure with plot browser enabled. so you can switch on / switch off certain plots and better compare the effects of W-variations
  • KF_2nd.mlx - carries the section of my live editor where i applied a Kalman filter of 2nd order. i used 3 state variables [position, velo, acc] (rotational related). velo and acc are derivates of angle -> 2nd order; at this example code, i exemplary set the measurement directivity , so i play-acted like all 3 data rows (position, velocity, acceleration) would act like independent real measurement data.
  • KF_1st.mlx - carries the section of my live editor where i applied a Kalman filter of 1nd order. i used 2 state variables [velo, acc] (rotational related). velo and acc are derivates of angle, but acc is the first derivate of velo -> 1st order; at this example code, i exemplary set the measurement directivity , so i play-acted like thevelo data are directly measured. the inconstant'ness of acc is "mapped" with noise.
hopefully i did not confused you guys and you get what i mean. while looking for a best filtering result keep in mind, that my device is a plc. i cannot implement array operations in SCL by default. so i need to manually type in every matrix multiplication lines. for that reason dont build a state vector with 6 entries ^.^. the fewer the better
many thanks in advance

回答(0 个)

产品


版本

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by