Voltage Based shifter issue
Voltage Based shifter issue
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
-
- Posts: 1696
- Joined: Fri Apr 04, 2008 1:28 pm
Voltage Based shifter issue
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.
-
- Posts: 1696
- Joined: Fri Apr 04, 2008 1:28 pm
Re: Voltage Based shifter issue
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.
-
- Posts: 1696
- Joined: Fri Apr 04, 2008 1:28 pm
Re: Voltage Based shifter issue
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.
-
- Posts: 1696
- Joined: Fri Apr 04, 2008 1:28 pm
Re: Voltage Based shifter issue
Here is some code for you to try:
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
-
- Posts: 1696
- Joined: Fri Apr 04, 2008 1:28 pm
Re: Voltage Based shifter issue
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
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
-
- Posts: 1696
- Joined: Fri Apr 04, 2008 1:28 pm
Re: Voltage Based shifter issue
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.