I need to pick your brains for a creative solution to a problem which doesnt seem to have any sensors available.
I have a single rope tree swing as seen here:
I would like to measure the swinging speed of this swing OR find a way to understand when its in the center location, during swinging. Because i would like to install led lights, which light up brightest, during its pass from the center location, the goes dimmer as it reaches the top, where swing stops for a brief moment, then swings again with lights getting brighter, and brightest again as it passes from the center.
however since it can rotate on its axis while swinging it is proving to be very difficult with accelerometers which are mounted stable and measure in one direction. So when the swing rotates on its axis and the child swings towards her back for example, the accelerometer cannot measure, it starts measuring negative.
I was successful in measuring the swinging speed of a two rope, regular childrens swing using mpu6050 however this particular problem seems to need a different approach and its more difficult.
Time the swings or measure the distance from the suspension point to the approximate center of mass (same thing).
Since the math problem has already been solved, two bits of data are all you need to calculate the velocity at any point in the cycle. An accelerometer cannot measure velocity.
No, but the accelerometer can tell you when the swing reaches the top.
Time the swing with the accelerometer, then using the distance to the focal point, then apply 5th grade math to get the speed.
I need to do this calculation live but the speed was just a representative value of the activity on the swing. In essence i would like to put led lights on the swing which light up the brightest when the swing reaches the center position and darkest when it reaches the highest position of the swing.
Accelerometers have certain mounting standards. In essence their manual includes how you should mount them on a car, plane or even a swing with two ropes. But a swing with a single rope rotates on its axis so it seems not possible.
You are suffering from a common misconception. The acceleration due to gravity, g, is constant near the Earth's surface. The accelerometer may be able to measure the change in centripetal acceleration, which depends on the swing velocity, but that will be added to g.
Only in the Z axis. And on a swing that would also be untrue as the swinging movement would add centrifugal forces.
The only time an accelerometer would measure zero is when it is not moving, or it is moving in a steady state. There is no steady state on a moving swing, so when all three accelerometers summed together reaches its lowest value, you are at the top of the arc.
Swing is a pendulum, the time for a complete swing cycle would be constant without any input from the person on the swing, but velocity will depend on the amplitude (maximum height reached).
An accelerometer near the Earth's surface reports 1 g total acceleration when it is not moving, or moving at constant velocity.
For a swing of length l of 3 m and starting angle 1 radian (57.3 deg), at the lowest point of the trajectory the swing occupant is moving at 5.2 m/s and is subjected to an additional centripetal acceleration of about 9 m/s^2, or about 0.92 g.
A consumer grade accelerometer can easily detect that difference. A nice experiment!
Edit: the above assumes the small angle approximation, which is several percent off for a starting angle of 1 radian.
Build an upside down 2-axis joystick with the swing suspended. Any movement of the swing will affect one or both pots. and a simple analog read gives the value for one axis. Massage with math to determine the current angle away from vertical.
Accelerometers would not work with a single rope swing, because a single rope swing rotates on its axis.
So when its going the same direction, it can read 10 and -10 depending on this free rotation on axis.
I dont think even if i get the average or total of all readings, if i measure a swing which rotates on its axis, readings will be strange... The sensor is simply not built for such an application of sending acceleration on a rotating axis.
Simply discount any readings you don't want to use.
And as stated just use a little math to get the actual number you want. You know it travels in an ARC so you wont get a straight line speed unless you discount the readings in between and just use the end to end reading.
When you stop accelerating you are in free-fall. Accelerometers only understand general relativity in fact.
Or more practically when stationary you'll see a 9.8m/s/s acceleration, when moving you'll see something somewhat greater or less.
Without a full IMU you'll be unable to determine the acceleration due to gravity and thus subtract it out from the data.
If the accelerometer has its z-axis aligned with the rope then the x and y components will be a minimum at the centre of the swing, although you will probably have to low-pass filter to remove any vibration of the rope.
Is it me, or is this seriously flawed? Here is a quotation from that web page:
Accelerometers
Accelerometers serve as the tool for velocity measurement on an IMU since we know its functionality is to detect the rate of change in velocity of an object
Can only measure pitch and roll, no information about yaw
This all sounds wrong to me. The first bullet point is OK, though simplified to avoid mention of calculus. The second, though? Accelerometers don't measure pitch, roll or yaw. That's what a gyroscope does. They measure acceleration in three axes.
Gyroscopes
Gyroscopes serve as the tool for rotation/rotational rate measurement on an IMU since we know its functionality is to detect rotational changes or maintaining orientation
Yeah, OK, I suppose. Not very clear, but not obviously wrong.
Magnetometer
Magnetometer serves as the tool for gravitational force measurement on an IMU
Compared to Accelerometer that can’t measure yaw since it works on a constant gravitational force, a magnetometer is a great compliment for accelerometer sensors
As far as I can tell, both bullet points are complete nonsense. Magnetometers measure magnetic fields, which help with orientation of the object wrt earth's magnetic field.
Has everything I thought I knew about 9DOF sensors been wrong all this time??