VSS Filter logic.

A forum for discussing applications and implementations of the MegaShift transmission controller code for the GPIO from B&G. This can control up to 8-speeds and 6 shift solenoids (plus a 16x9 table for controlling a PWM line pressure valve). It has manual and fully automatic modes (16x9 load x speed table), with under and over rev-limit protection, and full data logging of all inputs and outputs (among many other abilities). A TransStim to test your completed board is also available.
tobmag
Posts: 206
Joined: Mon Jan 02, 2012 4:22 am

Re: VSS Filter logic.

Post by tobmag »

Lance
I tried your MSQ (2013-09-0112.16.27.msq) on my bench, and I can find no run-away speedo instability at all between 0 and 77 kph (41 to 584 Hz on my function generator). It is very stable. That doesn't mean you aren't seeing an issue that's need to be solved, but it does mean were have to look more carefully.
I have the same thing here on my bench, everything works very fine...I did also check the signal before in the car with the scope and there are no noice coming in via the VSS input...
I will try tonight to edit the log files.

In my head the logic tells me that there is only a certain speed increase over time that should be seen as valid speed so not sure how it or if it could be done or if my logic is that logic :-)

Now in theory this will not filter anything since X and Y will see same signal and noice
This could be worked around if X and Y have different sampling rates so they never look at
the signal at the exact same time, this might however not be possible to do within the code?
VSS filter.jpg
VSS filter.jpg (26.21 KiB) Viewed 15306 times

BR//Tobmag
Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: VSS Filter logic.

Post by Bernard Fife »

Tobmag,

If it *never* does it on the bench, it's unlikely to be a code issue. It suggests a hardware issue of some sort. Perhaps something is resonating in the VSS circuit or wiring. Have you tried a diode (a common 1N4001 or similar, for example) in series with the VSS input? That should help squelch resonance (by removing all signals below +0.7 Volts), but it may be too much.

What input mask values have you tried? If this was mine, I would be tempted to try VSS Input Masking values from 10 to 100 in 5% increments to see if there was a 'sweet spot' anywhere in that range. I would also experiment with the minimum speed in 0.5 kph increments from 0 to 10 kph, and the max speed in 10 kph increments from 200 to 300 kph.

I would also set the Max. Errors to Reset to 5000, and the Reset filter off to 25. (See: http://www.msgpio.com/manuals/mshift/V41tune.html#gv)

It's certainly possible to set a limit in the code on the rate of change of the speed (i..e the first derivative of the VSS period). In fact, that's essentially what the input mask is, but the accel/decel would be averaged over a longer period instead of over a few dozen teeth.

I suspect that:
- the limit on the rate of accel and decel will need to be different (most cars can brake significantly faster than they can accelerate, and they ones that can't are scary to drive!),
- the rate should probably be speed dependent, i.e. most vehicles car accelerate much faster at low speed than high speeds (because of gearing and aero effects). This is sort of like the speed-dependent filtering you mentioned earlier, I suppose.

The question becomes, what do we do if the accel is outside that range. We could:
- limit the rate of change to the max (on the assumption that some, but not all, of the signals are false),
- limit the rate of change to zero (on the assumption that the signal are entirely false),

Then we would need to decide if the limit applies only to the speed calculation, or is also applied to the raw VSS input filtering (which can cause all sorts of troubles).

BTW, the code once had such a scheme (which was applied to the VSS filtering rather than the speedo calcs), and while it worked for some, it was a nightmare for others. So this would need to be implemented carefully.

If this gets implemented, it will be in the 5.00x series of beta code.

Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw
tobmag
Posts: 206
Joined: Mon Jan 02, 2012 4:22 am

Re: VSS Filter logic.

Post by tobmag »

Lance.

Wired up everything on the bench again now with a new signal generator....

Found this at a closer look of the signal at VR1 at the 25pin header, 50hz sine wave out from the signal generator and ppv 8v
I guess that the processor doesnt like this, speedo in TS showing max speed....
So it seems to be hardware after all...
Attachments
50hz.png
50hz.png (9.23 KiB) Viewed 15276 times
tobmag
Posts: 206
Joined: Mon Jan 02, 2012 4:22 am

Re: VSS Filter logic.

Post by tobmag »

Some more scope shots.

Noice in the 5v supply (internal GPIO)
5v supply.png
5v supply.png (11.15 KiB) Viewed 15268 times
signal at R43 at 50hz
50hz at R43.png
50hz at R43.png (9 KiB) Viewed 15268 times
Signal at R45 at 50hz
50hz at R45.png
50hz at R45.png (9.4 KiB) Viewed 15268 times
Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: VSS Filter logic.

Post by Bernard Fife »

Tobmag,

Well spotted! I strongly suspect those oscillations are the source of the problem. The most interesting place to scope would be the base of Q13 (the transistor's middle pin), as this is the intermediate stage in turning the AC signal intro a square wave. (Nevermind, that's what your R43 shot is showing)

For the power supply, if the divisions on the blue trace are 10mV, then the variation (34mV peak-peak, 6.3mV RMS) is fine. It's a bit hard to tell though, since the absolute level isn't specified (it looks like the screen shot has AC settings displayed).

If this was mine, I would probably:
- check the VR1 circuit very, very carefully , and touch up any joints that didn't look perfect (and maybe touch up ALL of the VR solder joints just to make sure),
- I would inspect the two transistors (Q13,Q14) very, very carefully to make sure the soldering is perfect and there is no bridging or residual solder flux anywhere at all,
- if that didn't help, I might try building up another of the VR circuits (if any are available) with new components and jumpering the new circuit to use as the VSS as it's not impossible some of the components are defective or have been damaged by static or heat,
- finally, if none of that helped, I might replace R42 and R43 (both 33K) with 10K resistors to make sure that the transistors could turn on and off quickly.

Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw
tobmag
Posts: 206
Joined: Mon Jan 02, 2012 4:22 am

Re: VSS Filter logic.

Post by tobmag »

Lance.

I actually just stumbled over this, if I masure the VR1 signal at the 25 pin header and just hit the auto scale function on the scope it will display a perfect square wave.
What I noticed was that I didnt get any frequency reading in the wave form parameters, thats when I changed the time line to strech out the wave....
Actually the raising edge is looking the same as the falling.

As usual I forget to switch over to DC as I did checking the 5v supply.

I will build up a new circuit on a experimental board since I have checked, re-solderd, washed the circuit board so many times.....

I will hook up on the ISS input and jump over to the VR1 input at the 25 pin header, that will show if this is just on the VSS cisrcuit or on both....
If its both I suspect that the components in the kit isnt up to the task...


BR//Tobmag
tobmag
Posts: 206
Joined: Mon Jan 02, 2012 4:22 am

Re: VSS Filter logic.

Post by tobmag »

Lance

So I used the ISS circuit VR3 instead and there is no noice there, clear signal so apperantly there is something with the VR1 circuit....

Anyway I suspect there is a glitch in the code as well, at 5hz.... yes I know very low but here I have the same issue as I had at 1300hz before.
this is what is creating the huge jump when accelerating from a stand still or coming to a stop.

I have attached a log with a 5hz and using the VR3 circuit as input jumpered to PT0
now also with a correct .msq.

BR//Tobmag
Attachments
2013-09-10_22.07.03.msq
(45.06 KiB) Downloaded 904 times
2013-09-10_21.58.31.msl
(84.75 KiB) Downloaded 801 times
Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: VSS Filter logic.

Post by Bernard Fife »

Tobmag,

I will have a look at 5Hz on my bench. Just curious, what speed is 5Hz supposed to be in kph on the speedo with your set-up, and is this above or below your minimum speed setting?

If this is a result by the same sort of root cause as the 1300 Hz issue, there are certainly more measures I can apply (I did think that the solution to that problem might just shift the issue to another rpm). The solution used for the 1300 Hz issue was the simplest possible, so an addition or two might also fix the 5Hz issue.

Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw
tobmag
Posts: 206
Joined: Mon Jan 02, 2012 4:22 am

Re: VSS Filter logic.

Post by tobmag »

Lance.


Just by calculation 5hz should mean that the output axle makes 7,5rev/min (40teeth x 7.5/60)
With my diff gearing and tire diameter it would be about 0.4kph

When I made this log the "min vehicle speed" was set to 3.1kph


BR//Tobmag
Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: VSS Filter logic.

Post by Bernard Fife »

Tobmag,

Based on what I am seeing on my bench, this is an amplitude problem rather than a frequency issue. I need to look at this more, but it appears I can recreate the 5Hz issue at different low frequencies by lowering the amplitude to near my generator's minimum. If the peak amplitude is near the trigger voltage, the speedo goes "nuts" by maxing out. But this never happens if I input a square wave. What may be happening is that the amplitude is falling to near the trigger threshold, and this is creating unstable oscillations in the output of the VR circuit.

I'll need to think very carefully about how to handle this. Setting the threshold to zero volts (to make a true 'zero-crossing detector' circuit) would do it, but also make the circuit more susceptible to noise. Perhaps we need to feed the minimum speed into the filtering, but this would need to be done very carefully. Give me a little bit of time to think it through.

In the meantime, you might try one or two 1N4001 diodes in series with the VR signal. This will totally eliminate the low amplitude signals, so they should no longer be able to cause a problem.

Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw
Post Reply