PDA

View Full Version : Detecting Horizontal Movement



Atom058
- 29th December 2011, 21:30
Hello - I have an application where I wish to detect my movement over ground (asphalt, dirt, grass, snow, etc.). I need non-contact measurement from about 3 feet off the ground. I am not concerned with speed or distance, just the fact that I am moving. I thought of an accelerometer, but I need it to continuously output a signal the entire time I am moving and stop when I stop - similar to what an optical mouse does when you move it over a surface. I've thought of using ultrasonic sensors or even PIRs, but I don't think they will give me the results I want. Possibly a laser pointer aimed at the ground, but what would I use to sense the scattering when I move? I don't think a vibration sensor would work as there are too many things that could trigger it falsely. Anyone have any suggestions? Thanks!

Darrel Taylor
- 29th December 2011, 22:05
You can do that with a simple accelerometer.

By "integrating" the signal, it can tell you when it's moving.
Integration is just a subtraction of a "Base" reading from the accel. reading, and adding the difference to an accumulator variable.

Compensation for "Drift" is also needed, but can just be a new "Base" reading when the object is not moving.

Atom058
- 30th December 2011, 03:29
Darrel - Thanks for your response, but don't accelerometers just detect changes in speed? I would think that once speed was constant, there would be no signal until the speed changed again (sped up or slowed down). Jeff

rsocor01
- 30th December 2011, 04:46
Darrel - Thanks for your response, but don't accelerometers just detect changes in speed? I would think that once speed was constant, there would be no signal until the speed changed again (sped up or slowed down). Jeff

Yes, you are right. The acceleration of any object is defined as dv/dt, which is a change in velocity divided by a given amount of time. If the velocity doesn't change then the acceleration is zero. However, if you want to detect your own movement, running or walking, chances are that you won't be able to maintain a constant speed. There would be small fluctuations in your body speed that the accelerometer would be able to detect.

Robert

Ioannis
- 30th December 2011, 08:00
May be a gps module can help if the speed is over its lower detecting limit.

Ioannis

mackrackit
- 30th December 2011, 08:10
Add a compass and you have everything a "smartphone " has. They work very well for tracking movement.

Ioannis
- 30th December 2011, 13:24
But Dave, if you are moving to the direction the compass is showng, then I suspect no movement will be detected.

I have not used a compass, so this may not be true.

Ioannis

mackrackit
- 30th December 2011, 15:15
I have not used a compass chip but the coding I have done with Android shows the compass to be very sensitive. I can not move in a straight line without averaging. It would be interesting to see what a raw chip does.

Atom058
- 30th December 2011, 15:23
Thanks Guys - Price is a factor (of course), so GPS will probably be out. Rsocor01, you have a point about the "jarring" effect of walking and the use of an accelerometer to detect that, but now we are getting back to vibration... Not sure how reliable that will be - might still be an option. My dream sensor is something that could be aimed at the ground and can determine when what it is looking at has changed - as what happens when an optical mouse moves. If I could hold an optical mouse 3 feet off the surface and still have it detect movement, that would be ideal, but we all know that won't work...

Acetronics2
- 30th December 2011, 16:42
Hi,

Bo need to put your head under the sand ...

a location device will be necessary : moving at a constant speed doesn't produce any accelaration and compasses changes are too weak to be seen.

so:

1) a string fixed to a reference point ( the simplest ... :love_heart: )
2) a surveyor dog
3) a wheel on the ground
4) the RSSI indicator of a Rx chip ( need a Tx somewhere in a reference point ...)
5) a stupid GPS device ???

you already have locating devices on the market ( for dogs, old persons, cars ....) so, try to see how they work ...

Alain

Bruce
- 30th December 2011, 19:14
As Darell already mentioned, the accelerometer is all you'll need. What you're looking to do is what accelerometers are made for....;o)

JetPack Spartan
- 30th December 2011, 19:59
There are a couple companies making autopilot devices for autonomous helicopters, which use a camera looking down to maintain position in much the same way a mouse does.

Atom058
- 30th December 2011, 22:34
Bruce - So, if an accelerometer is attached to a moving object and the object is moving at a constant speed, I will get some feedback that the object is moving? Even over a smooth surface?

JetPack - That sounds interesting (it is working much like an optical mouse), but I think it is getting out of my price range - otherise, I'd consider the GPS route, too...

Thanks Guys!

JetPack Spartan
- 30th December 2011, 22:44
When the accelerometer detects acceleration you can determine the speed by the amount of acceleration and the amount of time spent accelerating. Then, if there is no further acceleration or deceleration, you know that you are still moving at that speed. So you won't get feedback that you are in motion, the lack of feedback tells you that your speed hasn't changed.

amgen
- 30th December 2011, 23:19
an accelerometer has a base setting which is derived from "freefall, a no acceleration , no forces base point", so on earth, which is rotating, the reading is an offset from the base point and motion is an offset from that ofset ???

Darrel Taylor
- 31st December 2011, 02:57
Darrel - Thanks for your response, but don't accelerometers just detect changes in speed? I would think that once speed was constant, there would be no signal until the speed changed again (sped up or slowed down). Jeff


Bruce - So, if an accelerometer is attached to a moving object and the object is moving at a constant speed, I will get some feedback that the object is moving? Even over a smooth surface?
That's what the "Integration" does. It converts Acceleration over time into speed.

Sorry, it took me awhile to make something that would show how it works ... but here goes.

"Integration" is the "I" in PID loop.
By itself, it converts change in a value over time, to an approximated absolute value.
In other words, acceleration over time can show speed.
Speed over time can show distance.

I made a simulation that shows a simple acceleration to speed integration.
The PIC on the left simulates a single axis analog accelerometer, using HPWM to generate a DC voltage. Although they are ideal waveforms that you will never see from a real accelerometer, it was the easiest way to get exactly the same acceleration as deceleration profiles. Nature balances it out in real life, taking the exact amount of deceleration to stop an object that was accelerated.

The yellow trace is the accelerometer, and its output only registers the Change in speed.
The PIC on the right is running the very short "Integrater.pbp" program (attached).
The output (blue trace) of the integration is sent to the HPWM to be able to see on the scope.
The red trace is a digital output indicating "Forward Motion".

You can see that the output (blue) is a constant speed when there's no change in acceleration.
http://support.melabs.com/DT/Accel_Integrate.jpg

http://support.melabs.com/DT/Accel_Integrate.jpg

The integrated Speed could then be integrated again to produce distance traveled.

Disclaimers:
The simulation is not scaled to any particular Accelerometer, acceleration range or maximum speed range.
It is only intended to show how "Integration" works.

In real life, motion in other axis would affect the output, so multiple axis should be monitored.
Additional sensors (Gyros and Magnatometers) can be combined for greater accuracy and stability.

Products like the UM6-LT (http://www.chrobotics.com/index.php?main_page=product_info&cPath=1&products_id=9)can provide all the sensor data required for all 3 axis, plus combined orientation information.

Ioannis
- 31st December 2011, 09:20
Darrel, either moving at a constant speed-constant direction or at complete stop, the result of the Integratio won't be the same?

Ioannis

Acetronics2
- 31st December 2011, 09:37
Hi,

The only problem of that method is small errors ( < 1 LSB measurements for simple explanation ... ) are not taken into account and final result is then false.

Try this into an elevator ( or an automated train ) and I promise you will stay a moment in it calling for help ... !!!

Alain

Darrel Taylor
- 31st December 2011, 18:29
Hi,

The only problem of that method is small errors ( < 1 LSB measurements for simple explanation ... ) are not taken into account and final result is then false.

Try this into an elevator ( or an automated train ) and I promise you will stay a moment in it calling for help ... !!!

Alain
Apparently, you didn't read the whole post.

Acetronics2
- 31st December 2011, 22:01
Hi, Darrel

you sure ??? ...

reminds me a thread about oversampling ... ( about altimeter ) that is a total view of mind for very small variations ( < 1LSB ) - like here !

Have a Happy new year. :love_heart:

Alain

Darrel Taylor
- 31st December 2011, 22:15
you sure ??? ...
Sure about what?
That "Integration" is a very usefull function used throughout electronics and computing.

Or that I could make a device that detects forward motion using accelerometers/gyros/and magnatometers.

In either case, YES!!!!

Atom058
- 31st December 2011, 23:27
Darrel - Thanks for that very nice example! I completely understand what you are trying to get across now. One last question... will this be sensitive enough to tell if you slooowwwwllllly coast to a stop?

Thank you to all of you who replied to this post! I hope everyone has a safe and happy New Year! Jeff

Atom058
- 31st December 2011, 23:54
Just did a quick look at Sparkfun for accelerometers and found that they have a bunch that look like they could easily be used with PICS. They have a nice comparison here:

http://www.sparkfun.com/tutorials/167

FYI - Jeff

Darrel Taylor
- 1st January 2012, 00:10
That depends on how slowly you coast, the resolution of the sensor, maximum speed and other factors.

You never really gave us an idea of what you are doing, other than moving over different surfaces, so I can't say.

Atom058
- 1st January 2012, 03:34
Darrel - Unfortunately, you just about know as much as I do. The person that wants me to do this is being pretty secretive. Here is a little more... I am assuming it is a motorized vehicle and the position of the wheels will not always be the same, so they can't be used for indication. This will be in an outside environment, moving over any type of surface from very smooth to rough (grass, dirt, pavement, snow, etc.) at a pace that can range from 1/2 normal walking speed and up. Ideally, they are looking for something that they can just aim at the ground and determine that it is moving. They are not concerned about speed or direction, just movement. Height of sensor can be about 3 feet. Oh yeah, and cheap (duh) ... I am leaning towards a vibration sensor, but I don't know enough about the end system to be able to say that it would be 100% reliable - I have not tossed out the accelerometer, thanks to you... So there you have it... And again, thank you for your input. It is appreciated! Jeff

mackrackit
- 1st January 2012, 10:10
At first I thought this was a "person carry" project.

I wish to detect my movement over ground

Mounting to a vehicle has more possibilities.
These a very nice units.
http://www.dickey-john.com/product/radar-ii/

Ioannis
- 1st January 2012, 13:22
Wow, nice sensor! And heavy too, over 2kg !

Darrel, i was thinking about the integration of accelerometer and humbly appologize for my doubts. The spikes in the oscilloscope snapshot clicked me.

Ioannis

rsocor01
- 2nd January 2012, 12:21
Darrel, i was thinking about the integration of accelerometer and humbly appologize for my doubts. The spikes in the oscilloscope snapshot clicked me.

Ioannis

Well, I had my doubts too, but not anymore after studying Darrel's program ;).

There are a couple of things that I wanted to mention. First, for this program to work properly it is assumed that the initial speed of the integration is zero. In other words, it is assumed that when the program is started the speed that we want to measure is zero. Second, referring to Alain's comment


Try this into an elevator ( or an automated train ) and I promise you will stay a moment in it calling for help ... !!!

Alain

You have a point there. So, it is necessary to obtain all the 3-axis acceleration components (X, Y, and Z) and calculate the resultant acceleration vector to obtain a valid result for the speed. There shouldn't be any problems with this program.

Robert

Ioannis
- 2nd January 2012, 15:19
it is necessary to obtain all the 3-axis acceleration components (X, Y, and Z)

Darrel noted that too.

Ioannis