Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Using an accelerometer to measure speed MPH

Status
Not open for further replies.

change1

New Member
I want to put an accelerometer on my radio control car to see what is the max speed in MPH. Anyone know if an accelerometer is the best device to use, and will i need a microprocessor to make this work? and what I will need to do the conversion from G's to MPH? here is a link to the Accelerometer I want to get...thanks

Memsic 2125 Dual Axis Accelerometer - RadioShack.com
 
I want to put an accelerometer on my radio control car to see what is the max speed in MPH. Anyone know if an accelerometer is the best device to use, and will i need a microprocessor to make this work? and what I will need to do the conversion from G's to MPH? here is a link to the Accelerometer I want to get...thanks

Memsic 2125 Dual Axis Accelerometer - RadioShack.com

It would be easier to place two poles 100 metres apart and measure the time taken between the posts.
Get your car to max speed before it passes the first post.
 
It would also not work if your remote control car travels across a non-constant inclination (a changing slope) because then the acceleration of gravity would mix in with the car's acceleraiton unpredictably so you cannot factor it out.
 
if i recalled correctly, acceleration is the derivative of velocity... which the first derivative is equal to dx/dt = velocity

f'(x) = speed (velocity)

f"(x) = acceleration

so if i take the integral of f"(x)=acceleration, it will give me the f'(x) = velocity? correct me if i'm wrong?



you can't. think about it, an accelerometer measures acceleration not speed.
 
if i recalled correctly, acceleration is the derivative of velocity... which the first derivative is equal to dx/dt = velocity

f'(x) = speed (velocity)

f"(x) = acceleration

so if i take the integral of f"(x)=acceleration, it will give me the f'(x) = velocity? correct me if i'm wrong?

It would not work if your remote control car travels across a non-constant inclination (a changing slope) because then the acceleration of gravity would mix in with the car's acceleraiton unpredictably so you cannot factor it out. This includes vibration.

Regular accelerometers have biasing and scale factors that are too crappy to use for integrating over long term. You would have to calibrate the bias and scale factor (which change over time and temperature which does not help). It's best to calibrate the gravity vector and reset the integrating speed to zero every time the RC car comes to a complete stop and you would have to do that frequently enough (I'm guessing about every 5 seconds or so) for things to stay accurate. This still does not overcome the changing inclination problem outlined above.

You are better off attaching some kind of rotation sensor to some spinning part attached to the drivetrain on your car.
 
Last edited:
Ubergeek you can measure speed from acceleration, if you do it from a standing start, you just apply the acceleration over time to calculate speed. There's so much vibration on an RC car though and like DK said it would have to be done on a perfectly flat and smooth surface, it's jut not practical. Eric's idea was nice and simple. You could also use an opto interuptor or encoder on the motor shaft to measure speed.
 
I thought of using only a one axis accelerometer. Just the direction the car is heading...i just want to calculate the forward speed...



It would not work if your remote control car travels across a non-constant inclination (a changing slope) because then the acceleration of gravity would mix in with the car's acceleraiton unpredictably so you cannot factor it out. This includes vibration.

Regular accelerometers have biasing and scale factors that are too crappy to use for integrating over long term. You would have to calibrate the bias and scale factor (which change over time and temperature which does not help). It's best to calibrate the gravity vector and reset the integrating speed to zero every time the RC car comes to a complete stop and you would have to do that frequently enough (I'm guessing about every 5 seconds or so) for things to stay accurate. This still does not overcome the changing inclination problem outlined above.

You are better off attaching some kind of rotation sensor to some spinning part attached to the drivetrain on your car.
 
It's still not gonna work change1. Accelerometers drift so rapidly your speed would be at best a bad guess and it would only work once from a standing start on a smooth road. Put a sensor on the output shaft of the motor and measure your tire diameter, using your gear ratio of your drive shaft and then circumference of the tire you can calculate the speed the car is moving at precisely.
 
It is possible. It won’t be accurate though and will be complicated depending how you want to go about it.

Acceleration is a change in velocity with respect to time A=dV/dT).Therefore if you know the acceleration and the time it took for this change you can calculate it dV=A*dT). If you have a standing start, V = 0+(a*dT).

The problem is you will unlikely be able to achieve a constant acceleration which means you will have to either take an average acceleration or calculate it periodically during the run (say at least a few times a second).

To make it more accurate you could just use the accelerometer/pic combo as a data logger and then input its data into excel etc afterwards

This method, like other people have mentioned will be susceptible to inclines, whether positive or negative so the flatter the ground the better.

In my opinion there are much easier and more accurate ways to measure speed, especially on something so small.

Hope this helps
 
Last edited:
I thought of using only a one axis accelerometer. Just the direction the car is heading...i just want to calculate the forward speed...

That's not good enough because on any incline more than a flat surface at least a bit gravity is also acting in the same direction the car is accelerating. THis causes the acceleration of the car and acceleration of gravity to mix together and the accelerometer can't tell the difference. And integrating will amplify any errors very quickly to the point of uselessness.

For an accelerometer-based velocity measurement to work you either NEED to know the inclination of the car during your velocity calculations. If your inclination is constant and you know it ahead of time, you can punch in all the math ahead of time to remove gravity from the measurement. In reality this pretty much means it's not possible since even the best surfaces are never paved perfectly. If you do the trig, you'll see that even a 5 degree incline will cause about 9% of the acceleration of gravity to mix in with the acceleration measurement. 9% of 9.81m/s^2 is a lot of acceleration error that is going to be amplified even more by integrating.

But if the inclination is changing and you do not know it ahead of time,you need tilt sensors as well and there are only two tilt sensors I've heard of that can deal with this, since all other tilt sensors are themselves affected by acceleration of both the car and gravity. THese are horizon sensors and gyroscopes. The first only works on planes travelling high above the ground, and the second requires serious calibration, accurate and stable sensors, math, processing power, and cost beyond what most people can provide since they require integration themselves and all associated errors as well as a lot of rotating coordinate math. Whether you just need forward speed or more, it would end up being a 3-axis translation & rotation sensor setup whether you like it or not and it would basically be sticking a plane navigation system onto a car (and very few plane system, if any, even go as far as to measure the speed by integrating acceleration.)

THe only systems I know that use this level of navigation are nuclear submarines that can't resurface to get their bearings for long periods of time, and the most expensive cruise and ballistic missiles to work when their radar and GPS are jammed...and probably spacecraft too.
 
Last edited:
possibly using some type of GPS based data logger could give you a basic on the go measurements. My friend has one of those hand held units and one function it has will tell what speed you are traveling at even at a walking pace.

Or just use the point to point method ericgibbs mentioned. Just use a light beam and sensor at each end to trigger a timing system. Its as acurate as you will ever need.

Or find a cop and get him to radar gun it for you! Just make sure you bring the good douhnuts! ;) :D
 
I was curious, does GPS measure horizontal velocity only? Or does it measure any velocity (like if you were in an elevator would it give a reading?)
 
I think it has several vector readouts actualy. I think it can tell you velocity in all three axis. I dont see why not. Althought technicaly handheld GPS units dont work very well inside buildings.
I know my brothers hand held reads longitude, latitide, and elevation all at once. So there should not be any reason that mathimaticaly speed in any direction cant be calculated accurately.

I may have to go and borrow some ones and find out!

This would almost be worth an independent thread dont you think?
I believe that there has to be at least a few GPS experts on this site. Maybe one of them could clarify this better.
 
It should return verticle data, but because the satelites are effetivly in a very flat plane in compared to the source it would be several orders of magnitude less accurate. The X/Y distance between the satelites is.... vast maybe bellow the noise floor.
 
Last edited:
Possible.
But I do know modern geological survey equipmnet is very accurate even in the vertical axis. And that is using GPS based referances. Also those satilites dont point strait down. Whats above California is viewed as being to the side of me in North Dakota.

And my brothers GPS unit can tell me that I am 3 feet lower in my driveway than I am when I am standing on my deck! The more sattelite signals a reciever can pick up the more acurate and senitive it is in all directions.
The actual software in the unit is what limits its true resolution I believe.

The GPS sytem is a 3D maping system not a 2D flat map. (4D if you include a time referance!) :D
 
Public GPS only has a 100M precision from the satellites. Cheap GPS systems use averaging to eventually narrow this down to less than a meter or so. You can also use differential systems which broadcast correction data that can be used to improve accuracy as well, but still down to just sub 1m resolution, although you have to subscribe to them. With both you might get sub decimeter resolution.

Vertical resolution is a bit less due to the lateral differential of the satellites being much less than their horizontal difference, but again, with averaging and other techniques, you can still get quite precise. They are not in a flat plane, but in a medium level orbit. It's just the fact that we only see part of the orbital sphere that makes vertical resolution less, but not that much.

Miltary GPS systems have 1m resolution, and with averaging and differential systems, can easily get down to sub-centimeter precision.

It would be easiest to just measure the rotation of the drive train, just like real cars do.
 
Last edited:
Ubergeek you can measure speed from acceleration, if you do it from a standing start, you just apply the acceleration over time to calculate speed. There's so much vibration on an RC car though and like DK said it would have to be done on a perfectly flat and smooth surface, it's jut not practical. Eric's idea was nice and simple. You could also use an opto interuptor or encoder on the motor shaft to measure speed.
Only if there is a constant change in speed creating a measurable acceleration. If the speed is changing to slowly to register on the accelerometer, you can increase from 0-60 and continue at 60 and drift back down from 60-0 while not measuring a thing.

Acceleration is the rate of change of speed. if the speed is not changing the acceleration is 0. If the acceleration is not high enough to be measured by the chosen accelerometer, the acceleration is 0.

Dan
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top