I wanted to detect ZIG ZAG motion.
Is it possible using accelerometer?
Or is it recommended to use any other sensor??
I want to do this using arduino.
I wanted to detect ZIG ZAG motion.
Is it possible using accelerometer?
Or is it recommended to use any other sensor??
I want to do this using arduino.
How fast are you traveling? Is the motion in the horizontal plane? How fast are the turns? How long does a turn last? How long between turns?
Need details before we could make any recommendations. Very different answers based on the answers to the above.
Need details before we could make any recommendations. Very different answers based on the answers to the above.[/quote]fll-freak:
How fast are you traveling? Is the motion in the horizontal plane? How fast are the turns? How long does a turn last? How long between turns?Need details before we could make any recommendations. Very different answers based on the answers to the above.
Travelling at 20kmph…
yes it is horizontal plane.
turns are quite slow (10kmph).
turn lasts for 4 seconds
10-15 seconds between turns.
My guess (because you’ve still not given us enough info) is that an accelerometer is bordeline because the turns are so slow that the lateral “G forces” that result would be so small as to be very hard to distinguish from background noise. Then again if the turns are tight enough (a small radius), even at 10 kph the G force might be enough. There’s not info to do anything other than guess.
A gyro might work, a 40 deg turn (a SWAG) in 4 secs is 10dec/sec on average. That’s a detectable number. A compass might work, depending on the environment (metal chassis, electric motor, etc) that’s near it.
It helps a lot to just tell us what the thing is and the problem you’re having. The whole “Top Secret” thing is tiring and not very effective in finding useful answers.
Mee_n_Mac:
My guess (because you’ve still not given us enough info) is that an accelerometer is bordeline because the turns are so slow that the lateral “G forces” that result would be so small as to be very hard to distinguish from background noise. Then again if the turns are tight enough (a small radius), even at 10 kph the G force might be enough. There’s not info to do anything other than guess.A gyro might work, a 40 deg turn (a SWAG) in 4 secs is 10dec/sec on average. That’s a detectable number. A compass might work, depending on the environment (metal chassis, electric motor, etc) that’s near it.
It helps a lot to just tell us what the thing is and the problem you’re having. The whole “Top Secret” thing is tiring and not very effective in finding useful answers.
There’s no secret in it.
I just want to detect ZIg Zag motion of a car, and send a message when this motion is detected.
I intend to mount the acclerometer/ gyro on the dashboard above the stereo.
The numbers I gave you above were just approximate. (not very sure yet, I need to startoff)
Which will be the best option and safest option?? …3 axis Gyro or 3 axis accelerometer??. This considering all possible scenarios, that is turn radius, time,etc and other parameters from the least to the maximum.
My thought is that you probably need both the accelerometer and the gyro and maybe even a compass.
Read about how to use 6 or 9 Degrees of Freedom IMUs and the math/code to derive headings and change of headings.
Here are SparkFuns offerings:
https://www.sparkfun.com/search/results … t=products
And a Guide on Accer, gyros & IMUs
OK, now we know it's a real car and not an RC car or robot or an air hockey puck or a squirrel on crack. What, in your mind, is a "zig zag" ? How would you differentiate this from a car turning left and then some distance down the road, turning right ? Or are any 2 opposite turns, not matter how far apart, a "zig zag" ?bobxcool:
There’s no secret in it.I just want to detect ZIg Zag motion of a car, and send a message when this motion is detected.
I intend to mount the acclerometer/ gyro on the dashboard above the stereo.
The numbers I gave you above were just approximate. (not very sure yet, I need to startoff)
Which will be the best option and safest option?? …3 axis Gyro or 3 axis accelerometer??. This considering all possible scenarios, that is turn radius, time,etc and other parameters from the least to the maximum.
My guess is that a compass is a good tool. If you can place a cheap compass from Walmart in the same place and have it indicate when your car turns, then an electronic version should work there too. You can then write an algorithm that looks for directional changes that constitute a zig zag. The compass need not (IMO) maintain a truly accurate heading, just be able to reasonably measure the changes.
A gyro should work too. I outlined the math in the prior post. For “short” turns what you’ll need to detect is a pulse whose magnitude > some threshold followed by another of the opposite sign. Perhaps separated in time by no less than X seconds. A slow, wide turn might get missed but then again perhaps that wouldn’t be either a zig or a zag.
An accelerometer might work but at 10 kph and perhaps a 10 m turning radius (the sharpest a lot of FWD cars can turn) leads to a 0.08G lateral acceleration. That’s detectable but I’m not sure how far above the normal noise level it would be. A longer radius turn reduces that 0.08G proportionally. Again you’d look for 2 pulses, of opposite sign and > some threshold, perhaps happening < X secs apart but now you need to (IMO) make sure each pulse has a width > some amount.
For a zig and zag that happens quickly but where the car stays in it’s lane (like to avoid squirrel), a gyro or accelerometer might be best as the directional change will be small. For a slow set of wider turns a compass, and maybe a gyro, would be best. To detect a slow wandering, back and forth within your lane (like a drunk drives) motion is the worst of all the above. So what’s a “zig zag” ? Before you choose a tool, figure out the work that needs doing. That way you won’t end up with a screwdriver when you really needed a socket set. Or be sure to buy a whole tool set, that way you’ll have whatever is needed.
For a zig and zag that happens quickly but where the car stays in it’s lane (like to avoid squirrel), a gyro or accelerometer might be best as the directional change will be small.
Is this the squirrel on crack or the one with the radio collar?
Mee_n_Mac:
OK, now we know it's a real car and not an RC car or robot or an air hockey puck or a squirrel on crack. What, in your mind, is a "zig zag" ? How would you differentiate this from a car turning left and then some distance down the road, turning right ? Or are any 2 opposite turns, not matter how far apart, a "zig zag" ?bobxcool:
There’s no secret in it.I just want to detect ZIg Zag motion of a car, and send a message when this motion is detected.
I intend to mount the acclerometer/ gyro on the dashboard above the stereo.
The numbers I gave you above were just approximate. (not very sure yet, I need to startoff)
Which will be the best option and safest option?? …3 axis Gyro or 3 axis accelerometer??. This considering all possible scenarios, that is turn radius, time,etc and other parameters from the least to the maximum.
My guess is that a compass is a good tool. If you can place a cheap compass from Walmart in the same place and have it indicate when your car turns, then an electronic version should work there too. You can then write an algorithm that looks for directional changes that constitute a zig zag. The compass need not (IMO) maintain a truly accurate heading, just be able to reasonably measure the changes.
A gyro should work too. I outlined the math in the prior post. For “short” turns what you’ll need to detect is a pulse whose magnitude > some threshold followed by another of the opposite sign. Perhaps separated in time by no less than X seconds. A slow, wide turn might get missed but then again perhaps that wouldn’t be either a zig or a zag.
An accelerometer might work but at 10 kph and perhaps a 10 m turning radius (the sharpest a lot of FWD cars can turn) leads to a 0.08G lateral acceleration. That’s detectable but I’m not sure how far above the normal noise level it would be. A longer radius turn reduces that 0.08G proportionally. Again you’d look for 2 pulses, of opposite sign and > some threshold, perhaps happening < X secs apart but now you need to (IMO) make sure each pulse has a width > some amount.
For a zig and zag that happens quickly but where the car stays in it’s lane (like to avoid squirrel), a gyro or accelerometer might be best as the directional change will be small. For a slow set of wider turns a compass, and maybe a gyro, would be best. To detect a slow wandering, back and forth within your lane (like a drunk drives) motion is the worst of all the above. So what’s a “zig zag” ? Before you choose a tool, figure out the work that needs doing. That way you won’t end up with a screwdriver when you really needed a socket set. Or be sure to buy a whole tool set, that way you’ll have whatever is needed.
This is what I assume to be ZIG-ZAg motion.
The car is at the right end for example. Now, the car turns left and within a few seconds, say 5-6 seconds, it turns right again, and again within a few seconds (5-6) it turns left.
So, this somewhat like Z-shape.
bobxcool:
This is what I assume to be ZIG-ZAg motion.
Assume ? If that’s the best definition you can come up with then I think you’ll need to spend a few more $$ and buy “the whole tool set”. That is, something from the “9DOF” family and whatever support (an Arduino ?) that’s needed to collect and analyze the data from the 9DOF. Mount it in your car and do some zig-zags and see what you can see.