View Full Version : Microcontroller speedo correction
msi1259
05-03-2007, 07:34 AM
From numerous postings and corrected speedometer face plates, it appears most DL1000 speedos read about 8% high, with a linear tracking throughout the (normal) speed range. To correct the speedo, all that is needed is to length the pulse from the speedo sender on the front sprocket by this amount. Microchip PIC 12HV619 microcontrollers are (currently) $0.92 each. It simply reads the pulse from the sender, multplies the pulse length by 108% (actually multiplies by 138, then divides by 128 ), and outputs this pulse on another pin. The only other compnents are a resistor and capacitor to reduce the 12 volts to 5 volts for the PIC - total cost is <$2US. In testing with a GPS, the corrected speed (7.8%) was right on for a partially worn TrailWing rear tire.
msi1259
05-03-2007, 07:36 AM
The source code for the 12HV619 is attached. A good programmer is the Microchip PicKit2 starter kit, it has tutorials and a demo board for learning PIC programming.
WeThereYet
05-03-2007, 09:17 AM
You KNOW there would be a market for these if you want to whip a bunch of them up! I'll take the first one. (If I built it, my bike would probably burn to the ground.)
GrayStrom
05-03-2007, 10:08 AM
Great idea! I'll probably do this with an AVR for my wee.
mojokim
05-03-2007, 10:21 AM
But now isn't the odometer going to be off?
msi1259
05-03-2007, 10:59 AM
Great idea! I'll probably do this with an AVR for my wee.
I haven't played with the AVR chips (yet), but what makes the PIC 12HV619 attractive for this purpose is the on-board voltage regulator and on-board 8Mhz oscillator. Because the DL1000 only has 4 lobes triggering the sensor, the frequency is low (<300 Hz at top speed) - most other bikes have up to 64 lobes (final gear on output shaft). Having to make a printed circuit board would greatly complicate things, and using "dead bug" build techniques with epoxy gives a pretty robust assembly. The source code can be modified to different % corrections (+-20%?) if the gearing is different.
I doubt anyone would buy these, most people want plug-n-play, and the connectors alone would be ~$50. Feel free to try...
Yes, the odometer will now read ~8% low.
GrayStrom
05-03-2007, 11:08 AM
Some of the AVR's have a built-in clock too. Also, I'm an IPC certified PCB designer, and I use PCAD software at work, so it would be VERY easy to make a batch of surface mount boards that would handle the task, and would be very small. Add some conformal coating in a tiny plastic enclosure, and some small connectors, and you're in business.
Also, using the onboard comparator and a potentiometer you could allow for speed adjustability.
FlyingFinn
05-03-2007, 01:26 PM
Yes, the odometer will now read ~8% low.
Excellent work! It keeps amazing me that there are people out there who can actually write assy code.... That stuff is like "Klingon" to me.
About the odo. It obviously reads 8% lower now. But is it really so that the odo IS accurate in stock trim but speedo reads 8% high. And if you fix the speedo the odo is 8% low?
That would quite suprising. I.e. if you take a stock bike, ride it for one hour at indicated 60MPH, the odo would increment by 1h x 60mi/h x 0.92 = 55.2mi?
--
Mikko
mojokim
05-03-2007, 01:44 PM
I haven't tested the odometer myself, but every thread I have ever seen regarding fixing the speedo error says the odometer is accurate in stock form but the speedo reads high. I think that was the impetus behind the guage face correction as it leaves the odometer reading alone.
msi1259
05-03-2007, 06:42 PM
Some of the AVR's have a built-in clock too. Also, I'm an IPC certified PCB designer, and I use PCAD software at work, so it would be VERY easy to make a batch of surface mount boards that would handle the task, and would be very small. Add some conformal coating in a tiny plastic enclosure, and some small connectors, and you're in business.
Also, using the onboard comparator and a potentiometer you could allow for speed adjustability.
Neat, I've only done through hole boards - have to try SMD sometime. A couple of years ago, I made an adjustable corrector for my SV1000s - I used an A/D input on a 25 turn trim pot as user input to give 1% per turn (picture attached). After conformal coating, plastic case, potting compound and connectors were added, I could have almost bought a commercial product for less. :(
Redbeard
05-04-2007, 08:50 AM
So it still sounds like if you want the speedo and odo to be right - even with gearing changes, the best option is still the corrected speedo face for $40.00 and a speedohealer for around $90.
Bob S.
tinman
05-05-2007, 01:05 AM
I think you need to change the pulse rate, not the width, in order to correct the speedo.
Does anybody have a salvaged instrument cluster? I have to believe that a modification inside the speedo is possible - that is, to change the meter's reading in relationship to the input from the sensor.
GrayStrom
05-17-2007, 12:36 PM
Neat, I've only done through hole boards - have to try SMD sometime. A couple of years ago, I made an adjustable corrector for my SV1000s - I used an A/D input on a 25 turn trim pot as user input to give 1% per turn (picture attached). After conformal coating, plastic case, potting compound and connectors were added, I could have almost bought a commercial product for less. :(
Looks good!
I've been on vacation, but thought a late reply was better than none...
I know what you mean. It amazes me how cheap some of these things can be made, especially when it is done in China. It makes it virtually unprofitable and worthless to do.
vBulletin® v3.8.1, Copyright ©2000-2010, Jelsoft Enterprises Ltd.