xendelaar

tips on building a trip master/ tachometer/ odometer

Recommended Posts

hey kerbonauts!

this thread is way of topic but I'm stgoing to post it anyway. :)

here goes: 

i want to build a device that is able to measure the distance travelled with my car for rally purposes. it needs to be quite accurate (at least 100 meters accurate.. but I would prefer 10 m). and I want to get the signal to my computer so i perform calculations on it.

I've been thinking of building an arduino tachometer with a hall sensor but my electronic skills are... let's say.... non existent... 

so i was wondering... maybe I can buy a bicycle computer and somehow" hack" the signal from the device.  

is this even possible?  do you guys have any ideas of tackling this problem?  maybe you've got some interesting alternatives? i would love to hear them!

 

 

I've been playing around with several gadgets but without any positive results, including:

-GPS dongle; it wasn't accurate enough because of several reasons.

-obd2 plug with diagnostic tools; you can retrieve almost any signal from your car computer with this plug...... all but one! the odometer... i tried integrating the velocity but that wasn't accurate enough. 

- webcam on dashboard with OCR software; this was pretty creative! I pointed a webcam towards the odometer and transformed the generated pictures to digits with OCR software! this worked pretty well when the engine didn't run... but while driving it got to shaky to get a proper reading...

sorry for the long post

Share this post


Link to post
Share on other sites

you can get a cheap imu, but the maths are pretty mind boggling. in theory its just integration but theres a lot you need to do to cancel out unwanted components (like gravity and centrifugal force while in turns). 

Edited by Nuke

Share this post


Link to post
Share on other sites
6 hours ago, Nuke said:

you can get a cheap imu, but the maths are pretty mind boggling. in theory its just integration but theres a lot you need to do to cancel out unwanted components (like gravity and centrifugal force while in turns). 

i had to Google the word imu hehe. thanks for the tip. it does sound hard to program but i will look in to it. :)

thanks

Share this post


Link to post
Share on other sites

You can get an encoder disk and a photogate fairly cheaply. Add in an Arduino set to count the photogate pulses and you've a meter. Make the disk rub on the wheel, do a little math, and you can calculate distance traveled.

 

Share this post


Link to post
Share on other sites

Anything measuring the wheel rotation is entirely useless in this application, since the wheels will mostly likely spin much faster than the pace at which the road goes by. It's a rally after all.

IMUs are equally useless, they drift almost as much as the rally car itself.

 

Share this post


Link to post
Share on other sites
18 minutes ago, Shpaget said:

Anything measuring the wheel rotation is entirely useless in this application, since the wheels will mostly likely spin much faster than the pace at which the road goes by. It's a rally after all.

So your choices are: GPS, which has been demonstrated to not work in this case; inertial, which you don't seem to like; and…uhh…what else?

20 minutes ago, Shpaget said:

IMUs are equally useless, they drift almost as much as the rally car itself.

Inertial guidance can be quite accurate if you put enough money and/or volume into it. It's been accurate enough for spacecraft since the 60s, and plenty accurate for submarines since whenever my dad served on one. Sure, if you get a budget or micro IMU you're likely to get crap, but that's what you paid for.

Share this post


Link to post
Share on other sites

 

6 minutes ago, 0111narwhalz said:

Inertial guidance can be quite accurate if you put enough money and/or volume into it. It's been accurate enough for spacecraft since the 60s, and plenty accurate for submarines since whenever my dad served on one. Sure, if you get a budget or micro IMU you're likely to get crap, but that's what you paid for.

Yeah, accurate if you pour enough money into it, but by the definition of the word "enough" you can take any approach and "enough" the crap out out it until it works. The problem is that in this case "enough" means a lot more than OP can likely afford (otherwise OP would have already bought an off the shelf device that does the job).

I won't go deep into comparing aviation or military grade devices to hobbyist stuff, since that is meaningless, but I will point out that neither aviation devices, nor, I would assume, submarine IMUs rely solely on inertial system. They are almost certainly augmented by other devices that correct the drift error (such as compass, GPS, radio navigation, maps etc). Furthermore they do not require 10 m accuracy.

 

15 minutes ago, 0111narwhalz said:

So your choices are: GPS, which has been demonstrated to not work in this case; inertial, which you don't seem to like;

A cheap GPS was demonstrated to not work. A more expensive, dedicated tracking device might.

It's not that I don't like inertial systems. They are great for certain application, just not this one.

I'm not claiming there is a solution, just that the two mentioned are not what OP is looking for.

15 minutes ago, 0111narwhalz said:

and…uhh…what else?

The wheel rotation sensing method.

Share this post


Link to post
Share on other sites
Just now, Shpaget said:

The wheel rotation sensing method.

Which statement of invalidity precipitated that response.

Share this post


Link to post
Share on other sites
1 minute ago, 0111narwhalz said:

Which statement of invalidity precipitated that response.

I don't understand what you mean.

That was one of the proposed solutions. You were giving the list of proposals, stopping short of that one, then asked "what else?" which to me seemed as if you were having trouble remembering it, so I helped you out with that. 

Share this post


Link to post
Share on other sites
1 hour ago, Shpaget said:

Anything measuring the wheel rotation is entirely useless in this application

55 minutes ago, 0111narwhalz said:

So your choices are

You dismissed wheel rotation. I offered a list of alternatives, to each of which you appeared to have a rebuttal. The wheel rotation option was already given in the quoted text.

Share this post


Link to post
Share on other sites
37 minutes ago, 0111narwhalz said:

You dismissed wheel rotation.

With an explanation of why it is not a good idea.

37 minutes ago, 0111narwhalz said:

I offered a list of alternatives, to each of which you appeared to have a rebuttal.

Is that not what this thread is about? To share ideas and thoughts? I don't see why would me pointing out a flaw in a proposal be a bad thing.

I still don't understand what point you are trying to make.

Share this post


Link to post
Share on other sites

 

 

Thanks for the advice people!

 

Buying a tripmaster of 450 euro is of course the easiest way of tackling  the problem. Alas, I don’t want to invest that much money in a “rally” that only occurs once a year. J

I also have to clarify what I mean with the word “rally”.

 

It’s not a race in the sense that I have to get from A to B as fast as possible. It’s more of a puzzle roadtrip (with 400 other vehicles) where I have to reach several checkpoint at a certain (yet exact) time. I don’t know where the checkpoints are but when I spot one, I have to check in. every minute I’m too early or too late, I get a “penalty point”. I have to drive exactly 45 km/ hour without getting lost in order to receive zero penalty points. This is off course impossible because you make mistakes along the way…

Anywho..so when a  “wild checkpoint” appears, it’s very important to know at what distance the checkpoint is situated, because then I can calculate at what exact time I have to check in.

To date I’m using a very cool excelsheet and the odometer of the car to check whether I’m on time or not.
 

Spoiler

 

In this sheet I also calibrate my own odometer with the odometer(and trip master) of the person who made the puzzle course.. for this calibration I use a small amount of data I get at the beginning of the rally:  During the first 20 km, I get the exact driven distance given per given “puzzle”-action. Here are several examples:

 

Distance             Action

0km                     Turn left at exit

0,21km               turn right at intersect

2,14km               At weird looking lamppost, turn right

19,0km               turn left at green bench

<entering blind zone>

… km                   at city sign, turn right

Etc.

 

I use the given km’s to calibrate my own odometer. This has to be very accurate, because a small error can result in many penalty points after 500 km.

 

 

With my cool excelsheet, I’ve won the last two years (hurray for me!). however… I have to manually enter the distance travelled in my excelsheet, every time I want to perform a checkup. For the next “rally”, I want to automate this manual action!

That’s why I need a fool proof, affordable, yet accurate method of measuring the distance.

 

My first idea is to use an Arduino module with a Hall effect sensor and a strong magnet to measure the rotations of the wheels. I think this is a solid way of getting a proper measurement. My electronic skills are terrible and I would also have to learn to program the Arduino chip as well.  This could be very fun, but I feel it’s a bit too complicated for my current skill level..

Another idea is to buy an existing bicycle computer (that also uses a hall effect sensor) and then somehow “hack” the data from the bike computer to the my laptop. To me that sounds relatively easy to do, but I can’t find anything useful on the interwebs. It would be even better if I could buy a bike computer that comes with an usb conncetion and software, but I don’t think these babies are for sale.

 

I think these two options are the most promising ones because they use the same measuring mechanism as the person who plotted the course. This is one of the main reasons the GPS method didn’t work.

 

 

 

Share this post


Link to post
Share on other sites

Ok, now we have some proper data.

In this case, counting the wheel turns will work, and it could work really well.

As someone who's been tinkering with Arduino for the last couple of years, I can assure you that what you want (get data into an Excel spreadsheet) is not that difficult. In fact, somebody has already done the hard part for you.

Watch this:

Also read this:

https://medium.com/@islamnegm/quick-start-to-simple-daq-system-using-plx-daq-excel-arduino-d2457773384b

 

I'd stay away from the attempts of hacking a bicycle odometer. It would likely require much higher knowledge to tap into the data stream and translate it to something that a computer can handle than just using Arduino.

Share this post


Link to post
Share on other sites

i think i just struck gold in the forum. :) I'm going to buy a arduino starters kit with some Hall effect sensor.

This is going to be fun! I'll post an update if get things going :)

Edited by xendelaar

Share this post


Link to post
Share on other sites

just ordered the arduino uno start kit. Can't wait to start playing with my new toys!

With @Shpaget's tutorials I will be able to create the device I need. the only thing I don't know is how constant the detection and noise signal will be. By this I mean what the spread is in the detection time when the magnet passes the hall effect sensor (at different velocities). If the spread is small the accuracy is higher.. maybe I can reduce noise and increase the sample rate somehow after I finished the proof of principle.

Also I'm worried about connecting the device to the car. It will have to be a rigid contraption and I wonder what will happen if the sensor starts shaking/vibrating while driving. I wish I had KSP struts haha.

I guess I'll have to test this in order to get answers :D

any tips are still welcom off course :)

 

Share this post


Link to post
Share on other sites

Don't worry about speed of acquisition. Even the, by today's standards, snail paced Arduino Uno with its 16MHz processor is more than fast enough, by a few orders of magnitude. If you are driving at 12,5 m/s (45 km/h) and the tire has a circumference of roughly 2 m, you only need 6 detection per second. A hardware interrupt takes about 2 µs. The necessary software updates of the variables and all the calculations can easily be done in under 1 ms, so your Arduino will still have about 165 ms more to twiddle its digital fingers in anticipation of the next time the magnet passes by the hall sensor. You could add more magnets for better precision and smaller increments.

Conceptually, for the software should do a simple thing every time a magnet passes - add the circumference of the wheel to the distance passed variable. That's pretty much it, then every now and then pass that data to the computer (or to a small 16x2 character LCD.

Take care when you buy hall sensors. There are different models operating with different logic. Some are active only while there is a magnet in its proximity, others will stay active until a magnetic field opposite polarity is achieved (they latch). Frankly I prefer the former.

What you do need to worry about and take seriously is the electrical noise of the car itself. Spark plugs and alternator are quite messy and you'll need to filter that out.

Mechanical mounting of the sensor and magnet is something I can't help you with, you'll have to find a suitable place yourself, but probably the best bet would be the rear axle.

Share this post


Link to post
Share on other sites

good to know record speed won't be a problem. 

i bought a non latching version. but it's a cheap one.  maybe I have to invest in a more expensive one that is more sensitive? we'll see...

like you said the software will be really array.  just a counter that writes a number to a file.

didn't think about the noise from the car.  I'll have to test that as well.  maybe I can shield the signals with extra magnets? 

the mounting of of the gadget will also be tricky.  but first things first: 

learning to assemble electronics and programs some daq software. :)

i also have to wait a couple of weeks before i get the gear.... that sucks

Share this post


Link to post
Share on other sites
On 1/26/2018 at 10:03 AM, Shpaget said:

Mechanical mounting of the sensor and magnet is something I can't help you with, you'll have to find a suitable place yourself, but probably the best bet would be the rear axle.

Actually, it depends on which wheels are doing the driving. If the vehicle is RWD, then the front wheel would be preferable.

On 1/22/2018 at 3:39 PM, xendelaar said:

-obd2 plug with diagnostic tools; you can retrieve almost any signal from your car computer with this plug...... all but one! the odometer... i tried integrating the velocity but that wasn't accurate enough. 

xendelaar,
 You never mentioned what kind of car you're driving. Did you try monitoring the wheel rotation from the OBD2? If your car has antilock brakes, then it already has a hall effect switch and reluctor plate on each brake rotor to monitor the wheel RPM for slippage.

Best,
-Slashy

Share this post


Link to post
Share on other sites
On 28-1-2018 at 11:45 PM, GoSlash27 said:

Actually, it depends on which wheels are doing the driving. If the vehicle is RWD, then the front wheel would be preferable.

xendelaar,
 You never mentioned what kind of car you're driving. Did you try monitoring the wheel rotation from the OBD2? If your car has antilock brakes, then it already has a hall effect switch and reluctor plate on each brake rotor to monitor the wheel RPM for slippage.

Best,
-Slashy

During the rally, we drive an Volvo XC70 (2013). It doesn't have RWD.

I found this list on the web with all the signals you can retrieve from the car computer. I wasn't able to find the code for the odometer or the pulses from the antilock brakes.

https://en.wikipedia.org/wiki/OBD-II_PIDs

is there a way of getting information from the wheel rotation? Am I missing something in the list? THat would be awesome, because that would save me a lot of work! I would still make the arduino unit though, just for fun hehe. :D

Share this post


Link to post
Share on other sites

xendelaar,

 It's been a lot of years since I've done automotive stuff, and Volvos weren't something I worked on back in the day.

I was able to track down the BCM on your car. Should be mounted under the MAF sensor near the brake master cylinder. I found a scat that may or may not be yours, but I can't make heads or tails of it since it's all in German.
Volvo-ewd.gif

 Each wheel has a shielded wire running to this module. Should look something like this:

pic01.JPG You should be able to tap into one of these lines and count the pulses as they feed into the BCM. You'd have to run it through a comparator to translate the pulses to TTL level, then the Arduino will be able to keep count. Unfortunately, this system will not be able to tell if you're moving forward or backward. It will simply total the rotation of the wheel to a very fine degree.

 HTHs,
-Slashy

Edited by GoSlash27

Share this post


Link to post
Share on other sites

Wow! Thanks @GoSlash27 for going out of your way to gather this much information about my friends volvo!
It’s a shame it is not possible to retrieve the rotation pulses from the OBD2 plug. It still is a mystery to my why it is possible to retrieve the distance the gas paddle is being “pushed in” while it is not possible to get the milage from your darn digital dashboard!

In the past, the thought occurred to us to “hack” the signal from the cars pulse sensor as well, but we never had the guts to cut the wires and tamper with the electronics. I can imagine that it would be pretty bad if something went wrong…

Your post gives me encouragement . Since I’m not an electrician, nor a mechanic, it would be best to let a professional take a look at it. Maybe he can attach a copper wire to the signal wire for me. After that I can try to count the pulses with the Arduino, like you suggested!

We’ve already found that the ODOmeter of the car is very accurate compared to the distances provided in the puzzle description so this solution would be perfect!

Share this post


Link to post
Share on other sites

So hi guys! it's been a while! Sorry for necroing this post, but I made some progress!

@GoSlash27 I went to my local autoshop and asked if they could hack the signal of my ABS. The engineers didn't know what I was talking about and said it wasn't possible. It was kind of frustrating because I know it should be possible. GOslash told me so!

After that I started tinkering with an arduino board, a hall effect sensor and big magnet. I wrote a small program and performed a test on "lab scale". I used the program @Shpaget suggested to import all the juicy data to excel! In the video below you can see the setup (please don't mind the clutter)...

This test worked perfectly, but I needed some validation. So... next, I attached the magnet to my scooter-wheel and mounted the sensor near the wheel. After that, I started the program and took my scooter for a spin....

Here are the first results!

VRvUvNI.jpg

In the left graph you can see the distance I travelled plotted against the time I spent driving. I stopped 5 times to make a picture of the scooters' analogue odometer. These "stop" points are highlighted with the red circles. I then plotted the arduino measurements versus the analogue odometer readings, which are displayed on the right side. You can see there is a big 7,51% scalar error between the two measurements, but the R^2 is near perfect! I'm very pleased with the results! :D This was just a simple proof of principle. My next step will be mounting the sensor onto my car and perform more long distance tests! 

thanks for all the help guys! If you have any tips for improvements, please let me know!

Edited by xendelaar

Share this post


Link to post
Share on other sites

Outstanding! I'm glad it's working out for you.

Best,

-Slashy

Share this post


Link to post
Share on other sites

Kudos for getting some hardware on line!

I wouldn't be surprised with the difference in odometer and your hall sensor device. Odometers are not particularly accurate devices and there could have been some error in your measurements of the tire diameter. You could and probably should calibrate your device by comparing its data to some known and well measured distance such as a football field or a decent stretch of straight road and compare it to GPS data or even Google maps measure tool, which is certainly better than 7% accurate over a few kilometers.

Great job anyway!

Share this post


Link to post
Share on other sites
This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.