Pi Inertia first created 10/02/16 - last modified 10/02/16 Page Author: Ty Harness
I heard to television last night they have discovered gravity waves. http://www.sr.bham.ac.uk/gwgroup/#toggle031 What is gravity? What is acceleration? What is force? Perhaps the Raspberry Pi and Sense-Hat with its Inertial Measurement Unit/sensors may be able to help us make sense of it all!
Inertial Measurements
From the Sense-Hat documentation the Inertial Measurement Unit, IMU is an ST LSM9DS1 The manual can be found at: https://www.raspberrypi.org/blog/astro-pi-tech-specs/


text here text here text here




Linear acceleration sensitivity = 0.061 mg/LSB (I don't quite understand this yet). Reading p12 of the manual: 'Linear acceleration sensitivity can be determined, for example, by applying 1 g acceleration to the device. Because the sensor can measure DC accelerations, this can be done easily by pointing the selected axis towards the ground, noting the output value, rotating the sensor 180 degrees (pointing towards the sky) and noting the output value again. By doing so, 1 g acceleration is applied to the sensor. Subtracting the larger output value from the smaller one, and dividing the result by 2, leads to the actual sensitivity of the sensor. This value changes very little over temperature and over time. The sensitivity tolerance describes the range of sensitivities of a large number of sensors.'

To be honest I'm not sure about the direction of the axes and the pin 1 dot position in the manual. Not that it matters because we can find the axis directions using a simple python program.
pythonhosted.org/sense-hat/api/#imu-sensor
from sense_hat import Sense Hat

sense = SenseHat()
raw = sense.get_accelerometer_raw()
print("x: {x}, y: {y}, z: {z}".format(**raw))
and just steadily moving the Sense-Hat around and noting -1g when the axis is plumb (aligned with the centre of Planet Earth).
Pendulum Experiment 1
Other than a body in free fall {insert picture of Galileo dropping a Pi off the leaning Tower of Pisa} the pendulum is one of the next well understood and well studied mechanics problem. Galileo showed us the period of oscillation is the same irrespective of the amplitude of swing or the bob's mass. The period is determined by the length of the pendulum rod. Newton was born the same year Galileo died and he had a bit to say about motion and centripetal force. I've rigged up the Pi and Sense-Hat to form the pendulum bob mass. Using the Sense-Hat data logger software example I've managed to capture some acceleration data while the pendulum is swinging. Of course for a small swing where $sin \theta \approx \theta$ we are expecting to see simple harmonic motion, SHM.

The radial direction along the pendulum rod is the device x-axis and tangential direction is the device y-axis. The device z-axis is out of the plane of the pendulum. When the pendulum is at rest the x-axis records -1g. I forgot to record the other 2 axes. That was a school boy error.




The graph below shows the logged data from the IMU graphed using Mathematica. Please note when t=0 the pendulum was already swinging.

I would have thought the device z-axis acceleration would have been zero but it's approximately constant at 0.04g. That's 10 times greater than the sensitivity so it is significant. My only thoughts are:

  • The device could be out of calibration. https://www.raspberrypi.org/forums/viewtopic.php?f=104&t=119543
  • I'm using a thin polycarb. ruler as the pendulum rod and bob mass is hung off one side (eccentrically). The centre of gravity is not through the sensor. I should have checked the z axis reading while the pendulum was static.
  • It could be the Coriolis acceleration due to the Earth rotation. You know the one, if you live in the Northern Hemisphere the bath water spirals down the waste opposite direction to the Southern hemisphere! Perhaps Foucault's Pendulum is a better example.https://www.youtube.com/watch?v=F4URN5hnoTg

    The x and y accelerations are both oscillatory. The device x acceleration appears to have twice the frequency of the device y acceleration. (Hhmm not sure I was expecting that - maybe I missed that lecture.) The time period of the y data is approx. 1.2 seconds.

    I think we should mathematically model the problem and see if these experimental results make any sense.

    text here






    text here


    To get a handle on a dynamics problem I like to apply D'Alembert's Inertia force/torque to freeze the problem i.e. it's then an equation of statics rather than motion. I can then split the elements down into free body diagrams with equal and opposite forces/torques applied to all the elements. For plane statics problems the sum of the forces in any two directions and a moment about any point will equal zero.

    From the above figure we can resolve the mg force on the pendulum bob into 2 components, and in this case it's convenient to use the radial and tangential force components because they're orientated with the device axes.

    If you think those inertia forces look complicated - they are. The IMU is going along for the ride. Remember when you was young and liked the park swings you were the mass being impelled to move in circular arc. I found H. Stommel's book: 'An Introduction to the Corolis Force' shows how to derive these mysteries forces and in what situations you can apply them. They don't teach you that in school.

    From the data captured we've got accelerations on both the x and y axes. School texts proceed on with the equating of torques because it's easier to understand.

    Torque is equal to force x perpendicular distance i.e. tangential force component x the length of the pendulum: $mgsin \theta * l$. The radial force (cosine component) x 0(perp. dist) = 0 of course.

    If we apply D'Alembert's inertia torque $I \ddot\theta$ to freeze the pendulum in space (hence it's now a problem of statics) we know the algebraic sum of the torques must equal zero.

    $ I \ddot\theta - lmgsin \theta = 0$

    The second moment of inertia (assuming the bob mass,m is much greater than the pendulum rod mass): $I = ml^2$

    $\ddot\theta - {g \over l } sin \theta = 0$

    $sin \theta = \theta$ for small angles then we've got a nice and easy 2nd order linear differential equation.

    The natural frequency:

    $\omega = \sqrt{g/l}$

    I live on the surface of the Earth (unlike TP) where g = 9.81m/s^2. The Length of the pendulum rod was 0.4m.

    $\omega = \sqrt{9.81/0.4} = 4.95$ radians/second

    $f = \omega/2\pi = 0.79$ cycles per second(Hz)

    and the Time period for 1 cycle. $T = 1/f = 1.26$ seconds {Not too bad}

    Back to the funny forces:
    If we equate the forces in the x direction and we assume the IMU is positioned at x=L and constant then I'm assuming $ \dot L = 0 $

    $m L^2 \ddot \theta - mgsin \theta = 0 $ and that's the same equation we got when equateing the torques. Ah so that where the $I \ddot \theta $ comes from!

    The device y-axis: Again assuming L is const and $\ddot L = 0$ and when $\theta$ is small then $cos \theta \approx 1$

    $ T = mg - mL \dot \theta ^2$

    The squared velocity term would make the periodic function appear to have twice the natural frequency. The wave would always be positive. http://www.wolframalpha.com/input/?i=sine+squared+x+%2C+sine+x

    When the bob's angular velocity $\dot\theta = 0$ hence $\dot \theta ^2 = 0$ the centripetal force component disappears for split second at the pendulum swing extremes which happens twice per cycle which is what the IMU x axis data is showing.
    Centripetal Force Experiment - Work in Progress


    Corolis Force Experiment - Work in Progress