StromTrooper banner

1 - 20 of 42 Posts

·
Registered
Joined
·
2,502 Posts
Discussion Starter #1 (Edited)
My stromputer is essentially a mobile voltage meter - I set it up to show gear voltage levels, after noticing some issues with correct gear detection.
At first I thought it was a bug, but then double checked with another voltage meter. The stromputer is extremely accurate and is not the problem.
>> The motorcycle GPS (Gear Position Sensor/pink wire) seems to be outputting different voltage levels for the same gear, depending on the transmission (or perhaps ambient) temperature!
Once again, an external voltage meter (connected to the motorcycle) shows the same reading.
N for example, goes from to 4.95V (hot) to 4.6V (cold) . In fact the entire gear range shifts by about 0.35V between hot and cold.
Changing the voltage detection ranges to have wider values causes an overlap in gear detection, and is not really a good solution.

Has anybody noticed that?
I have an idea how to solve this, but wanted to first get some feedback.
 

·
Registered
Joined
·
944 Posts

·
Registered
Joined
·
2,502 Posts
Discussion Starter #3
Thanks.

Well, I only noticed that once I turned the 'Show Gear Voltage' display option on.

Trying to think what can be the cause of that.

I am hooking to the pink wire using a Posi-Tap, but I highly doubt that as a cause. The temperature behavior is very persistent.

The only things connected to the battery are the Arduino, Stebel air horn, GPS charger and the Coocase Topcase. I did modify the coocase two months ago to have 24 leds instead of 2 (on each side), but not sure how that is related.

Could you share with me your voltage levels? I'd like to compare with mine.

Also, I never got the initial readings that were published in ADV (i.e. 1st Gear = 1.78V). Mine was always much lower.
 

·
Registered
Joined
·
722 Posts
Zero experience with the GPS/I wire or its voltages. Just some wild-ass guesses.

Could this be related to the overall +12V voltage from the R/R? I installed one of those single LED, heads-up voltage monitors last winter and noticed that I am 'in the green' (12.9-15.24V) when the bike first fires up. (I assume there is some sort of electronic choke at play here.) Once warm I usually fall into the steady red (12.1-12.5V) range at idle. Even at stop lights I see red. As soon as I blip the throttle the monitor kicks right back to green.

0.35V is well within the delta my monitor is showing me between idle and not.

You monitor voltage on your setup too, right? What's that showing?
 

·
Registered
Joined
·
2,502 Posts
Discussion Starter #5
Zero experience with the GPS/I wire or its voltages. Just some wild-ass guesses.

Could this be related to the overall +12V voltage from the R/R? I installed one of those single LED, heads-up voltage monitors last winter and noticed that I am 'in the green' (12.9-15.24V) when the bike first fires up. (I assume there is some sort of electronic choke at play here.) Once warm I usually fall into the steady red (12.1-12.5V) range at idle. Even at stop lights I see red. As soon as I blip the throttle the monitor kicks right back to green.

0.35V is well within the delta my monitor is showing me between idle and not.

You monitor voltage on your setup too, right? What's that showing?
Yes, I do have a battery voltage monitor. never thought of connecting both..
And yes, the voltage does change significantly between 11.8V to 13.9V.
I just didn't record the levels, since I was focused on the gear levels.
Will look out today - every ride is now a scientific experiment..with logs :weapons_41:
 

·
Registered
Joined
·
2,502 Posts
Discussion Starter #6
Just checked:
Bike cold (not started), connected to Battery Tender all night:
11.8V battery, 1st gear 1.33V

I started it (30 seconds):
13.9V, 1st gear 1.24V

:confused:
 

·
Registered
Joined
·
2,502 Posts
Discussion Starter #7
My ride today experimented with an auto adjust (basic self learning) mechanism to compensate for the voltage changes.
It worked very nicely.

Still want to understand the source of problems.
 

·
Registered
Joined
·
944 Posts
@Big:

While out riding today I was thinking about your problem. BTW, I agree with you; the positaps are probably not the issue. Maybe, but I don't think so.

I am pretty sure the sample for your ADC is referenced from the output of the 5VDC regulator that supply Vcc to your microcomputer. Here is my guess.... you are not getting a stable 5VDC into your rig. Maybe the regulator is heating up and dropping a few 100mV.

Is there a way for you to connect a voltmeter to the 5VDC supply voltage on your rig? I think you may see a correlation.

Here are my values. I used a range to help prevent erratic reading. So far none have been observed or reported by others that built my design.

Gear Volts
1 less than 1.690
2 1.690 to 2.200
3 2.200 to 2.930
4 2.930 to 3.690
5 3.690 to 4.325
6 4.325 to 4.755
N 4.830 or greater

Keep us posted.
 

·
Registered
Joined
·
2,502 Posts
Discussion Starter #9
@Big:

While out riding today I was thinking about your problem. BTW, I agree with you; the positaps are probably not the issue. Maybe, but I don't think so.

I am pretty sure the sample for your ADC is referenced from the output of the 5VDC regulator that supply Vcc to your microcomputer. Here is my guess.... you are not getting a stable 5VDC into your rig. Maybe the regulator is heating up and dropping a few 100mV.

Is there a way for you to connect a voltmeter to the 5VDC supply voltage on your rig? I think you may see a correlation.

Here are my values. I used a range to help prevent erratic reading. So far none have been observed or reported by others that built my design.

Keep us posted.
Thanks - your explanation makes a lot of sense. ADC is indeed a function of VCC.. great direction.

I feed the Arduino with (what is supposed to be) a stable 9V - the battery 12-14V voltage is converted and regulated to 9V using LM2940.
I can connect a volt meter to the 9V output and check it - very good idea.

But then the Arduino itself has an internal 7805 5V regulator.
It could be that the 7805 is causing the issues.

Did some searching on this subject:
1. I read that there is a way to feed a stable external 5V and therefore bypass the 7805. But that will require a lot of hardware changes.
2. Another solution is to measure the Arduino's own VCC voltage from within Arduino! That is quite cool, and I will test it tomorrow.
SecretVoltmeter - tinkerit - Accessing the secret voltmeter on the Arduino 168 or 328 - Open source releases from TinkerLondon and Tinker.it - Google Project Hosting

If I can indeed measure VCC, then the whole problem is solved, since I will multiply the ADC reading by VCC, not by a constant 5 (=5V) as I do today.
 

·
Registered
Joined
·
944 Posts
Or... After looking at the code for the internal voltmeter you linked...

You could just reference the Stroms GPI voltage against the precision 1.1VDC reference the code reads. It seems like if the microcontroller is alive, that voltage will be 1.1VDC.

What I know about Arduinos is close to nothing so everything I just said may either be impossible of BS.
 

·
Registered
Joined
·
2,502 Posts
Discussion Starter #11 (Edited)
Or... After looking at the code for the internal voltmeter you linked...

You could just reference the Stroms GPI voltage against the precision 1.1VDC reference the code reads. It seems like if the microcontroller is alive, that voltage will be 1.1VDC.

What I know about Arduinos is close to nothing so everything I just said may either be impossible of BS.
Yes, that is exactly what I intend to do. Changed my code already.
So I measure the VCC using that internal 1.1VDC stable reference.
Then my ADC calculations are multiplied against VCC instead of 5V.

An ADC read of 1023 today (before change) means 5V. ADC in Arduino are 10 bit - 0..1023.
But after the change, 1023 will mean VCC - e.g. if VCC is 4.8V then 1023 read means 4.8V, not 5V which is what I get now; Which is causing incorrect higher readings when VCC goes down. Why VCC goes up/down? I don't know. Probably due to heat.

On to the experiment..will provide results later on - a bit rainy today.
 

·
Registered
Joined
·
2,502 Posts
Discussion Starter #12
I rode today - not for too long, so it is not a very good experiment, but - the gear levels seem to be much better. They are stable.
What is odd is that the internal voltage is a pretty stable 5.01VDC.. :confused:
I expected it to go up and down.

Maybe by sampling the internal voltage meter I've actually caused some reset? who knows..
The board temperature ranged between 62-75F.
Would still like to see how this performs on a long ride when on-board temperature reaches 85-90F.

BTW: I ordered another temperature sensor (1-Wire DS1820 this time, like yours Voltar) so I will have an on-board temperature sensor and another external temperature sensor for ambient air temperature. I converted my design bug into a "feature".. :mrgreen:
 

·
Registered
Joined
·
944 Posts
Big:

Interesting. I am willing to bet that the voltage from the ECM is very stable *unless* the Arduino is loading the output. I do not think that would be the case as the Arduino certainly is modern as has a high input impedance.

Do you have anything between the ECM from the DL and the Ardunio? A diode, cap, resistor, shoestring, etc? I run my ECM input straight into the PIC uController. I was able to view the internals of a commercial GPI and it ran the ECM straight into the uController as well.

BTW.... My temp sensor is the DS18B20. I don't know if you left the "B" out by accident. I read the data line on the DS18B20 via the I2C bus. If you don't want to monkey with the I2C bus let me know and I can suggest a one input device that does not require the I2C. The advantage of my method is that it is very accurate. The disadvantage is it is a bit harder to program.

Keep my posted,please. :lurk5:
 

·
Registered
Joined
·
2,502 Posts
Discussion Starter #14
Big:

Interesting. I am willing to bet that the voltage from the ECM is very stable *unless* the Arduino is loading the output. I do not think that would be the case as the Arduino certainly is modern as has a high input impedance.

Do you have anything between the ECM from the DL and the Ardunio? A diode, cap, resistor, shoestring, etc? I run my ECM input straight into the PIC uController. I was able to view the internals of a commercial GPI and it ran the ECM straight into the uController as well.

BTW.... My temp sensor is the DS18B20. I don't know if you left the "B" out by accident. I read the data line on the DS18B20 via the I2C bus. If you don't want to monkey with the I2C bus let me know and I can suggest a one input device that does not require the I2C. The advantage of my method is that it is very accurate. The disadvantage is it is a bit harder to program.

Keep my posted,please. :lurk5:
I put a posi-tap on the pink wire going from the gear/transmission to the ECU.
So the ECU should be getting the same voltage levels as the Arduino.
Other than the Arduino analog port (used for ADC), there is nothing except for wire. But the calculations I'm was making could have indeed made a gear level change, just by virtue of ADC errors. I did notice two odd but short readings of 4.75VDC and 5.5VDC for the internal volt meter..

I don't like Voodoo - and this smells voodoo to me.

Regarding temp sensor: Yes I did order the DS18B20. don't mind using the I2C bus as other components are already I2C. I2C is actually easier to program against that OneWire (at least with Arduino).
Just wanted to learn and play the OneWire protocol this time :)

Will keep you posted. :beatnik:
 

·
Registered
Joined
·
944 Posts
Big:

When you get the wrong gear readout does it last forever or just for a brief moment? I sample the ECM as many times a second as the PIC will let me to monitoring for a voltage (gear) change. If the PIC does see a change I wait 100mS, resample the ADC and update the display ONLY IF the PIC confirms the gear change. I didn't have an issue, but put this routine in to allow some settle time just in case.

So far, there are maybe 15 or so of my GPI that have been built by DIY'ers. No reports of false reading so maybe the 100mS settle time could help your condition?
 

·
Registered
Joined
·
2,502 Posts
Discussion Starter #16 (Edited)
When the problem happened, it was not a short peak but a long 'creeping'
So the readings would start drifting to lower values. Then later when the ambient air temperature would get lower (at the afternoon/evening, then the gear levels start drifting back up to normal values)
The volts were creeping down - So 1st gear started at 1.33V and slowly and gradually went down to 0.95V after about 20-30 minutes.

Nevertheless, I do have a 'settling' logic, and also an moving average calculation to smooth out any short peaks.
I actually read the gear level inside a very accurate timer ISR at 20Hz (Every 50msec). That time interval can be easily changed.

My suspicion at this point is that the on board voltage went up above 5.0VDC (maybe due to heat), say to 5.5VDC

Since my old code (before you pointed out correctly that VREF is not constant) was dividing by a constant 5, I would get smaller results for the same input gear level, because the ADC circuit is working in relation to VREF, not to a constant 5VDC.
For example: 1.33V would result at ADC reading of 272 (of 1024) at 5VDC
But at 5.5VDC 1.33V would result at ADC reading of 247 (of 1024), that I would incorrectly divide by 5 and get 1.2VDC.

This still doesn't explain at all why I got 0.95V. To get to that value a much higher VREF is needed.

What I wrote in the previous answer was not accurate - I do have a voltage divider (2:1) in front of the Arduino Port, in order to protect it from peaks (over 5V) that would fry it. It could be that the resistors become inaccurate when they heat up and therefore change the voltage divider properties..:confused:
If I'm correct then I have to find some better high accuracy resistors (<%1 with a low ppm/C instead of the ebay inaccurate cheapos I used), and/or find resistors with better heat resistance.
 

·
Registered
Joined
·
199 Posts
I included a tolerance factor to allow for minute variations like you are experiencing. You might consider something like this:

if((AD_Result >= (Gear1 - Tolerance)) && (AD_Result <= (Gear1 + Tolerance))) {
display(1);​
}

Ron :mrgreen:
 

·
Registered
Joined
·
2,502 Posts
Discussion Starter #18
I included a tolerance factor to allow for minute variations like you are experiencing. You might consider something like this:

if((AD_Result >= (Gear1 - Tolerance)) && (AD_Result <= (Gear1 + Tolerance))) {
display(1);​
}

Ron :mrgreen:
Thanks, Ron.
My firmware introduced tolerances since day 1, I called them ranges - I know that voltar is using the same design (He even put his ranges up here in this thread).
The problem is that if the voltage levels drift by 0.35-0.4V then the tolerance/ranges cannot help, since this is the area in which the gear ranges start to overlap.

1. One issue that I fixed, thanks to Voltar's keen eye, was the incorrect constant 5VDC VREF. I have no idea if this fix is needed, but I do have the VREF displayed now, so if it goes up or down I will know.
2. I might next explore better more accurate resistors in my voltage dividers
3. Then I might return to my last resort plan of a self learning system. It is a fuzzy algorithm, that self adapts.
 

·
Registered
Joined
·
199 Posts
I think I posted these once in another thread:

Neutral 5.07
1st 1.40
2nd 1.81
3rd 2.55
4th 3.28
5th 4.16
6th 4.61

These readings were taken while under way.

Ron :mrgreen:
 
1 - 20 of 42 Posts
Top