Oscillation graph of a pendulum with Thymio II

The simple pendulum

The pendulum is a classical study object.

With Thymio and a basic structure one can create a pendulum whose oscillations can be measured.
Here is an example how:

pendule-thymio.jpg

This realisation is based on a structure which provides the suspension for the pendulum. The rotational axis of the pendulum goes through the pencil orifice of Thymio II. This way Thymio II is not too much off centre and doesn't weigh too heavily on the pendulum. The axis guides the oscillation which thus takes place laterally to the robot. At the end of the pendulum a weight is attached which stabilizes the oscillation.

The inclination of the pendulum can be measured with the accelerometer. The following code allows the accelerometer to be collected, by averaging over 4 values to smooth the signal. NOTE: in order for this code to compile an event named plotAcc with one parameter must be created (on the right in the AsebaStudio window).

var accTampon0[4] = 0,0,0,0
var accTamponPos0 = 0
var sumacc0

onevent acc
  accTampon0[accTamponPos0] = acc[0]-2
  accTamponPos0 = (accTamponPos0 + 1) % 4
  sumacc0 = accTampon0[0] + accTampon0[1] + accTampon0[2] + accTampon0[3]

  emit plotAcc sumacc0

The last line of code allows an event to be generated. As already mentioned this event must be created within AsebaStudio as having one parameter (zero by default). The emission of this event allows the accelerometer values to be traced graphically as the oscillations take place. To do this one must perform a left click on the name of the event in the event list at the right. Then one is given the possibility of creating the graph of the variable emitted by this event. Here is the video of the operation and the result:

Here is the screen shot of the result (click on it to enlarge):

Plot-pendule.png

Some questions for the curious:

  • What does this graph really represent, on the y-axis?
  • By making a vector of two values one can have the graph of axis 2 of the accelerometer superimposed. What does the graph give in this situation?

Pendulum with the LEGO Technic 8069 kit

How to construct this if one doesn't have a stock of Lego parts?
One possibility is to buy a box which has enough parts. For example here is the pendulum made using the LEGO Technic 8069 construction kit. This kit contains enough bars to make a simple version of the pendulum, like this:

global-pendule-lr.jpg

This pendulum is constructed only using parts from the LEGO Technic 8069 construction kit. Unfortunately the limited number of parts gives a pendulum which is not as strong, and the results are not as good, as the pendulum mentioned above. The lack of stability and the shorter arm give less stable oscillations

plot-acc.png

If one wants to observe the frequency of the pendulum, one can also plot the value of a distance sensor which looks at the ground. One gets graphs of this type (lateral sensor):

plot-prox.png

Finally here are some details of the construction. Note that the pendulum must be stabilized when in use, for example by fixing it to the table.

pendule-face-cote.jpg
structure.jpg

Pendulum with the LEGO Technic 8258 kit.

The LEGO Technic 8258 construction kit provides many more parts and thus allows a stronger pendulum to be constructed. Using the Thymio II as the pendulum weight seems like a good idea, but requires a very stable structure. It is better to use the Thymio in the structure, and other items (here the wheels) as pendulum weights. The support structure must be rigid and well positioned on the ground.

pendule8258.jpg

This pendulum works exactly like the others above and uses the same code. However it allows the oscillations to be recorded much more cleanly than the previous ones:

pendule-graph-8258.png

Finally here are some details of the construction:

details-pendule8258.jpg
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License