View Single Post
      01-02-2012, 08:06 PM   #125
MFGJR
First Lieutenant
27
Rep
341
Posts

Drives: 2007 Z4 M Coupe
Join Date: Sep 2008
Location: Richmond, VA

iTrader: (0)

Let’s see…when we left off before the holidays, we were trying to figure out a math channel that would indicate what was going on with the pedal inputs, allowing the production of a track graphic with information more granular than longitudinal accel would show. The single channel would combine the inputs from the accelerator and brake pedals, but complexities were introduced when both pedals are applied, either in a heel-toe downshift or when left foot braking and feeding in gas while still not completely off the brakes.

I went out and logged some data, including a heel-toe downshift, and a series of six instances of left foot braking, each time beginning to add throttle before the brakes were completely released.

I had previously identified that my original, match channel that was simply the difference between throttle and brake pressure inputs would show wacky results on a heel-toe downshift. In the graphs below, the upper pair of lines are the individual throttle (dark green) and brake pressure (red) channels. Note that, to present them this way, I reversed the brake pressure channel so that it’s negative—below the line—and set the scale on both throttle and brake channels to range from -100 to +100.

The lower graph’s orange line is longitudinal acceleration, so we can see where the car is actually being accelerated or decelerated. The bright blue line is the original simple formula, and you can see where it gives misleading info when the throttle is blipped for the downshift. The dark blue line—which covers most of the bright blue line as they have the same values much of the time—does a much better job of depicting when the car is actually being decelerated or accelerated. It uses an if-then-else statement conditioned on the clutch switch to ignore the throttle blip.

Name:  heel toe.png
Views: 451
Size:  157.5 KB

On to left foot braking… We last discussed using additional if-then-elses to select the dominant input, conditioned on which pedals are engaged and on longitudinal accel as the tie breaker. As I feared, the single channel makes big, instantaneous jumps from the brake value to the throttle value as soon as the long accel value is crossed. It seems that the best solution, when both pedals are being applied, is to blend the values. Weighting the brakes 80% and the throttle 20% seems to do a pretty good job of crossing the line from braking to accelerating around the point where longitudinal accel goes from negative to positive. In the below graph, once again the upper set are the throttle and brake traces—note how throttle is being added before complete brake release in each braking/accel event. The lower set’s orange line is longitudinal accel, the bright green line is the flawed formula that makes the instantaneous leaps, and the purple line is the good, blended, 80/20 version. The 80/20 ratio might need to be adjusted to something else at track speeds, however.

Name:  left foot.png
Views: 412
Size:  162.1 KB

So, the final formula using RS2 syntax and Z4M ECU protocol channel names is as follows:

IF(EQ(Z4M_CLUTCH_SW,1),Z4M_BRAKE_PR,IF(GT(Z4M_PPS, 0),IF(LT(Z4M_BRAKE_PR,0),(Z4M_BRAKE_PR*.80+Z4M_PPS *.20),Z4M_PPS),IF(LT(Z4M_BRAKE_PR,0),Z4M_BRAKE_PR, Z4M_PPS)))

Note that earlier, when I was using the default settings on the brake test channel, it was a positive value and so I was using the negative of its value in the new math channel. Now that I’ve reversed the brake channel as discussed above, it’s already a negative value and so it can come straight into the formula and it’s added to the throttle value when blended.

Now, I’m going to have to learn to left foot brake so all this isn’t for naught.
__________________
Appreciate 0