Page 1 of 1

Voltage Based shifter issue

Posted: Wed Dec 05, 2012 10:21 pm
by jamies
Lance,

In regards to Ford - voltage based shifter, there seems to be a bug in the code in relation to ADC and manual gear, this seems present on both v2 and v4 code bases and i have replicated it both in the car and on the bench.

Basically using the default thresholds (as they are correct for my vehicle) the voltage reported will be correct, for example 2.5v, however the gear will be bouncing between 3rd and 4th.

There are two logs attached from bench testing, adc.msl is a v2 log and adc_v4 is a v4 log
look at input1 vs manual gear in the logs and you will see what i mean.

I also have a couple other logs from on the car if you want them, showing the same issue.

This happens immediately after a firmware upload and only changing the input parameter to ford voltage based, and no other changes to the default settings

Regards
jamie
adc.msl
2.202
(70.56 KiB) Downloaded 742 times
adc_v4.msl
v4
(155.85 KiB) Downloaded 804 times

Voltage Based shifter issue

Posted: Thu Dec 06, 2012 7:56 am
by Bernard Fife
Jaimie,

I will have a look when I get a chance. I have an initial idea what may be happening, and it should be an easy fix.

Lance.

Re: Voltage Based shifter issue

Posted: Fri Dec 21, 2012 6:26 pm
by Bernard Fife
Jaimie,

Sorry, I forgot about this issue, mostly because it was in the code release thread, which I generally only check when I post new code. I will have a look over the weekend and respond here.

Lance.

Re: Voltage Based shifter issue

Posted: Sat Dec 22, 2012 1:58 pm
by Bernard Fife
Jaimie,

It looks like 3rd is being indicated whenever the voltage is =2.499, so I suspect that's on a threshold, and with rounding, etc. the code is getting confused. I will dig into the code next, and should be able to sort this out fairly quickly. I'm not set up for testing the voltage based shift right now though (the bench is set up for testing the microTCU solenoid driver's right now, and I don't want to interrupt that), so I will likely post some code for you to test.

Lance.

Re: Voltage Based shifter issue

Posted: Sat Dec 22, 2012 2:27 pm
by Bernard Fife
Jaimie,

Here is some code for you to try:
2202_test_only_Monitor.abs.s19
This code smooths the ADC signal whenever the voltage based gear is set (only 1/16th of the change in INI from one sampling to the next is applied), and it assigns a 'dead band' to the ADC count that is considered invalid and ignored. The dead band is set in the code at about 0.05V, but I could easily make this a user defined value if it helps.

So try this, and let me know what you see. If it's not better, I have some other ideas.

Lance.

Re: Voltage Based shifter issue

Posted: Sun Jan 06, 2013 6:50 am
by ashford
i was wondering how this would work for a ford as well since they don't have a physical shifter position for 3rd. they have 1-2-D and a switch to disable od. since the inputs for gear position have a 3rd ant a 4th how would this be set up in software? setting them at the same voltage i would assume would cause confusion in software.

Re: Voltage Based shifter issue

Posted: Sun Jan 06, 2013 8:51 am
by Bernard Fife
ashford,

It should still work. The code is designed to pick the first gear that matches, so multiple matches are allowed (in theory, it's been a wile since I tested this). I can't recall if the code looks from high to low, but I expect that it does. So the same value for 4th and 3rd would set the lever as 4th.

If it was mine, though, I would probably set the 'missing' gear lever position to an 'out of range' value (one that the lever never outputs). Then you would only have the actual positions as inputs.

Also, recall that the shift lever just sets the highest gear that the code will select in the forward positions. The actual shifting is intended to be done with the sift buttons. So even if you only had D (Drive) as a signal from the lever, you would still be able to shift through all the gears.

Lance.

Re: Voltage Based shifter issue

Posted: Sun Jan 06, 2013 9:39 am
by ashford
interesting, i thought they had to be inline voltage wise so the code could figure out "deadband" of gears and make the limits of each inbetween.

on a side note if it does not need to be linear assigning 3rd to 5v would work nice as a failsafe if you lost sensor connection so you would still have 3 forward gears

Re: Voltage Based shifter issue

Posted: Sun Jan 06, 2013 2:59 pm
by Bernard Fife
ashford,

The code doesn't expect the voltages in any particular order (like ascending or descending). It was done this way to make it as 'generalized' as possible.

Lance.