# Precision Pendulum Assembly: Calibration

## Calibration

### String measurement

Measuring tape rigorous calibration with a caliper aid.
Detail of the pendulum cable length calibration, where the plateau touch the measuring tape to avoid parallax giving in this particular case 2824 mm.

The pendulum accuracy depends strongly in its rigorous length measurement (~2,8 m) with less than 0,5 mm. Indeed this is the crucial factor to achieve the desired 0,02% accuracy and for that propose a well-calibrated measuring tape as to be chose. If this method is adopted special care has to be taken to avoid parallax. Alternative methods like ultrasonic measurement with laser targeting are the best, using a metallic or marble stone plane fitted tangential to the weight (allowing it to roll but touching the plane). With this method a few takes shall be done surrounding the ball and their average value will be considered the pendulum reference length.

Recalibration of the length as to be pursuit every month to guarantee a reasonable precision.

In the first figure is shown how to rectify the measuring tape initial offset by careful eliminating the systematic error from the contact with the sphere. Then, the tape passes through the plateau's hole where the fulcrum seats till it reaches the ball surface. Then a few measurements should be taken in order to have a proper average.

### Plane of oscillation

Correctness of the launcher alignment after the procedure to adjust the plane of oscilations.

The plane of oscillation has to be critical defined in order to avoid second order effects on the period determination due to an elliptic moment instead of a planar one. Of course Coriolis force can not be avoided but only for very long runs (>15 min) it will influence significantly the movement.

To have the plane well established any tangential force during the bob's launch as to be avoided. For such, a perfect alignment of the shovel trajectory within the plane of oscilation has to be verified.

#### Floor parallelism from top and bottom triangles

The first calibration is to provide a coarse parallelism between the upper and lower structural triangles. For that end the structure as to be laid down in a regular floor and have a final tighten of the screws leading to a rigid armor fixture.

Then, the top triangle has to be leveled by using the bob itself, letting it be in the center position of the lower triangle and at ~10-12 cm from the back; in the orthogonal direction of the oscillatory plane a spirit level has to be used in first approximation and later a fine tuning of the bob has to be refined according to the photo-gate position. It as to be guaranteed that the bob travel exactly by the middle of the photo-gate.

#### Bob movement given by fulcrum excitation

After locating the pendulum in it's final place and having the bob at rest, start a gentle swinging (slow movement) by exciting it in the fulcrum at the top in order to define the plane of oscillation.

• First of all assure that this oscillation is roughly parallel to the launcher/wall by rotating the fulcrum's holder.
• With the help of a flashlight (i) in the front of the shovel/bob and (ii) putting a white paper with a vertical centered black line on top of the shovel at the origin (iii) adjust the horizontal tilt screws of the launcher in order to have the launcher platform perfectly aligned with the plane of oscillation. This can be seen easily if the shadow center of the bob do not move horizontally and the cable's shadow do no deviate from the paper's black line.

### Interface console to micro-controller

The micro-controller provides a menu that allows the user to set the parameters of the experiment and run predefined functions to allow configuration and testing. The interface between user and micro-controller is performed via the RS-232 serial connection with the following parameters:

   • Baud-rate: 115200 bps
• Parity: No
• Data bits: 8
• Stop bits: 1


Please be aware if you have another application using the corresponding device. Actually you can have the JAVA deamon running, preventing access to the serial port. In such case it should be stopped (by running the command with the flag STOP) prior to run the minicom application as in the following example (please adapt to your local path):

elab@WP-RAI:~ $/home/wpa/rec-deployment/wpunicvrai/wpunicvraiDaemon.sh Stop  After any maintenance where it was deemed necessary to stop this daemon is as to be restarted by issueing the reciprocal command: elab@WP-RAI:~$ /home/wpa/rec-deployment/wpunicvrai/wpunicvraiDaemon.sh Stop


As an example, the “minicom” console interface can be used to communicate with the micro-controller. In the RaspberryPi, this interface can be called from a shell using the following command:

   minicom -D /dev/ttyS0


or

   minicom -D /dev/ttyAMA0


The “/dev/ttyS0” or "/dev/ttyAMA0" is the device (micro-controller) location. The minicom program will create a serial connection with default parameter which, in principle, are the same as the ones mentioned above. If not, check the help page of the minicom program (type "man minicom") to see how to set those parameters. After launching the program, be sure to add a line feed so that the messages sent by the micro-controller appear in new lines. In minicom, the line feed is activated/deactivated by pressing Ctrl+a followed by a. Once the communication (connection) is established, it is possible to access the micro-controller menu by sending:

   ? (question mark followed by an enter hit)


or

   help (“help” followed by an enter hit)


The output will be similar to the one shown in the following figure:

Every command should be followed by a carriage return – “\r” (hit enter) so that the micro-controller can process the sent string. Hitting enter also clears the micro-controller input buffer, so it can also be used for that purpose. The words in the commands are separated by one space character only except for the “cfg deltaX[…] N[...]” command where the words/inputs are separated by one tab character “\t”. If the sent command is successively received, the micro-controller will reply to the sent command by returning the send command in capital letters. If the command is successively executed the micro-controller will reply with an OK.

The “[ ]” (square brackets) in the commands define the range of accepted input values. The numeric representation of these limits indicate the type of accepted value, i.e., integer or float. If the limit value contains a decimal case, the accepted values for that parameter are float. If the limit value does not contain a decimal case, the accepted values are integer only. See the following examples:

   cfg    deltaX[5:25]    N[10:1000]                                      ->    cfg    15    30
set maximum position %lf [40.0 60.0] (cm)                              ->    set maximum position 47.7
set catch ball delay %d [1 2000] (ms)                                  ->    set catch ball delay 300
set pulley diameter %lf [1.0 4.0] (cm)                                 ->    set pulley diameter 2.356
set ID string %s [maximum length of 32 characters]                     ->    set ID string WORLD_PENDULUM_LISBON
cur                                                                    ->    cur
go to origin speed[1.0:50.0] acceleration[1.0:150.0]                   ->    go to origin 11.5 41.1
move forward deltaX[1:50.0] speed[1.0:50.0] acceleration[1.0:150.0]    ->    move forward 4.5 2.2 2.0


Before turning the micro-controller on, it is important to perform two position measurements (maximum and vertical). The procedure to measure these positions is described in Setting specific parameters for the experiment.

#### Description of the console menu (commands/outputs)

Commands related with the state machine and communication with e-lab driver (Java program running in the RaspberryPi):

• cur: Ask the micro-controller about its current configuration. The micro-controller will return the following line:
• str: Change the micro-controller state to STARTED and starts an experiment if previously configured using a "cfg" command. Once the experiment has started the micro-controller will output the data in the following format: 1st column - data point number, 2nd column - period (s), 3rd column - g (m/s²), 4th column - velocity at laser location (cm/s), 5th column - room temperature (degC). See the figure below for illustration:
• stp: Stops an experiment and send the micro-controller to the STOPED state.
• rst: Resets the micro-controller and send it to the RESET state.
• ids: Ask the micro-controller to send an its identifications. E.g.: IDS WP_LIS STOPED
• cfg: Send the configuration for a new experiment. This command accepts two integer parameters: 1st - initial displacement in cm, 2nd - number of oscillations

Commands to execute predefined functions, useful for calibrations and testing:

• stop ball: This command is used to stop the ball from oscillating. After stopping the ball, the shovel resting position is at the photo-diode/photo-gate.
• prepare launch: This command accepts one integer which corresponds to the initial displacement (maximum amplitude) before releasing the ball. The command displaces the shovel to the required position and rests at that position.
• launch ball: This command released the ball by sending the shovel to the origin at its maximum speed.
• test laser: This function is used to simultaneously test the laser and the photo-gate/photo-diode. A more detailed description of this command is found in Laser and photo-gate test as well as procedures to check in case of a failed test.
• go to origin: This command accepts two inputs: 1st - speed in cm/s (double) and 2nd - acceleration in cm/s² (double). It sends the shovel to the origin (until it reaches the micro-switch).
• move forward: This command accepts three inputs: 1st - horizontal displacement in cm (double), 2nd - speed in cm/s (double) and 3rd - acceleration in cm/s² (double). It moves the shovel in the forward direction (away from the origin).
• move backward: This command accepts three inputs: 1st - horizontal displacement in cm (double), 2nd - speed in cm/s (double) and 3rd - acceleration in cm/s² (double). It moves the shovel in the backward direction (towards the origin).
• move to photodiode: This command accepts two inputs: 1st - speed in cm/s (double) and 2nd - acceleration in cm/s² (double). It sends the shovel to the photo-diode/photo-gate if the shovel is beyond the photo-diode/photo-gate in the forward direction. If the shovel is between the photo-diode and the origin the command sends the shovel to the origin (until it reaches the micro-switch).
• light bulb on: Turns the light bulb on to illuminate the experiment.
• light bulb off: Turns the light bulb off.
• laser on: Turns the laser on.
• laser off: Turns the laser off.
• reboot: Performs a software reset to the micro-controller. Before resetting, the micro-controller stores the current number of oscillations into the flash memory.

Commands to set the specific parameters for the experiment (see section Setting specific parameters for the experiment for more details) and stores them in the flash memory so that they are not lost in case of a power down situation:

• set maximum position: Stores the shovel maximum absolute allowed position in cm (where it is mechanically impossible to go further in the forward direction).
• set sphere diameter: Stores the sphere diameter in cm and measured at the equatorial plane.
• set pendulum length: Stores the length of the pendulum. See String measurement for details on how to measure the string length. IMPORTANT: the pendulum length should include the radius of the ball.
• set origin position: Stores the position of the shovel when located at the origin, i.e., when the shovel is stopped by pressing the micro-switch.
• set vertical position: Stores the position of the shovel when the pendulum (ball + string) is perfectly vertical.
• set photodiode position: Stores the position of the shovel when located at the photo-doide/photo-gate location.
• set catch ball delay: Stores the delay used to catch (stop) the ball when this one is oscillating with a relatively large amplitude. NOTE: This parameter is no longer used in the recent firmware versions because the micro-controller is now able to automatically catch the ball based on its velocity. For the catch ball to work well, ensure the ball alignment is set as specified in the schematics of Order of assembly and filling with sand.
• set pulley diameter: Stores the diameter of the pulley attached to the step-motor. This value is used to calibrate the displacement of the shovel.
• set display intensity: Stores the display light intensity. This value should be set so that the numbers are visible/readable on the live video stream when the experiment is running, i.e., when the light bulb is on. 0 is the lowest intensity and 15 is the maximum one.
• set global oscillation counter: Stores the number of total global oscillations. It is also used to override/reset the counter.
• set ID string: Sores the experiment identification string (name of the experiment). The string is limited to a maximum of 32 characters.

Current values/parameters for information:

• expected period: Shows the expected oscillation period in seconds. This value is calculated with the pendulum length and it essential for the proper operation of the experimental apparatus.
• uptime: Shows the time in secdons since the micro-controller was powered up.
• shovel is at origin: Indicates if the shovel is located at the origin (yes/no).
• shovel is at photodiode: Indicates if the shovel is located at the photo-diode/photo-gate (yes/no).
• laser is on: Indicates if the laser is switched on (yes/no).
• photodiode is on: Indicates if the photo-diode/photo-gate is lit (conducting state) or dark (non-conduction state). The output is yes/no.
• temperature: Indicates the temperature in degrees Celsius. The temperature sensor is located in the DB25 box connected to the micro-controller board.
• ERR 1: Indicates that there is a problem with the laser or photo-diode/photo-gate. See Laser and photo-gate test for more details and debug procedures.
• ERR 2: Indicates that there is a problem with the micro-switch. See Connections to double-check that the micro-switch is properly connected.

#### Laser and photo-gate test

The micro-controller has a dedicated function (accessible from the console menu) to test the laser and photo-gate simultaneously. This function consist of blinking the laser 5 times with a full period of 100 ms (500 ms total). If the photo-gate correctly detects the laser state the test will be successful. To manually run the laser and photo-gate test, just type the “test laser” command in the console. During booting, the micro-controller runs the laser and photo-gate test function to ensure that both components are working properly. If the test fails, the micro-controller returns the “ERR1” error code. This error can be associated with one or more of the following possible problems:

• Wrong electrical connections: Check section Connections to ensure that both laser and photo-gate are properly connected to the micro-controller.
• Laser and photo-gate misalignment: Check if the laser light is properly pointed to the photo-gate structure hole and adjust as described in section Photo-gate and laser alignment if needed.
• The photo-gate is always closed (conducting): If the ambient light is too intense or if some source of light other than the laser is going through the photo-gate structure hole with enough intensity, it can happen that the photo-gate is always conducting making it impossible to the micro-controller to distinguish between laser ON and OFF states. In this case, the solution is to reduce the ambient light or change the experiment orientation so that the photo-gate receives less light.
Procedure to focus the laser beam.
• Unfocused laser: If the laser is not properly focused, the light intensity may not be sufficient to close the photo-gate. The laser can be focused by slightly rotating its lens (to one side or the other): rotate until the red dot is the smallest as possible (bellow 1mm) at a distance of ~150mm. To rotate the lens it is necessary to remove the laser from its support. The laser is fixed by pressure only and, in some cases, with a drop of glue or polish nail. IMPORTANT: Do not fully unscrew the lens from the body as it will result in damaging the laser. Never hold laser part A by the small printed circuit board.

After trying to correct the possible source of errors, re-run the test to check if the problem is solved.

#### Setting specific parameters for the experiment

Some of the settable parameters are essential for the correct and safe operation of the launcher and overall experiment. This subsection describes how to measure and set each one of the parameters. The following settable parameters need to be measured with the micro-controller turned off (powered off). These parameters are:

• maximum position: The shovel maximum position is measured by slowly displacing the shovel with the hand towards the end of the sliding structure (when the slider is fully extended). Once the shovel reaches the end position (cannot move further) record its absolute position by reading the value at the scale fixed on the launcher with the help of the indicator attached to the shovel.

• vertical position: This position is obtained when the pendulum (ball + string) is in the perfectly vertical position. For that, slowly move the shovel in the backwards direction (towards the origin or micro-switch) until it has passed the vertical pendulum position. Wait for the ball to stop totally. Once the ball is fully stopped, approach the shovel in the direction of the ball until it touches the ball but without displacing it. Record the absolute shovel position by reading the value on the metric scale fixed on the launcher with the help of the indicator attached to the shovel.

Once the above parameters have been measured, turn on the micro-controller by powering on the Raspberry Pi. During boot, the micro-controller performs some initial tests. Allow some time until those tests are finished before trying to send commands to the controller. In the meantime, set-up the serial console connection to receive messages from the controller. Once the controller is sending its identification string or an error code, the controller finished to boot and we can now set the specific parameters for the experiment. For that, use the commands described above. Here follows one example:

   set maximum position 47.7


If the command was sent and interpreted successfully, the micro-controller should reply in the following way:

Perform the same for the vertical position.

• sphere diameter: The sphere diameter should be measured at the ball equatorial plane where the laser points on the ball. If not mentioned or impossible to measure, consider 8 cm, which should be close enough to the usually used spheres. This measurement is mainly used for the determination of the pendulum speed at the laser location. Once the sphere diameter has been measured, store the value in the micro-controller flash by using the command "set sphere diameter". Consider to have multiple equatorial readings in different positions and take their average value because the sphere is most likely an ellipsoid!
• pendulum length: The procedure to measure the string is described in String measurement. Then, the radius of the sphere/ball (in the vertical direction, i.e., along the string direction) should be added to the string length, resulting in the pendulum length. The unit of length for this quantity is meter (unlike the other ones which is centimeter). Once the pendulum length has been measured, store the value in the micro-controller flash by using the command "set pendulum length".
• origin position: This is the location of the shovel when it is stopped by the micro-switch (see figure below for illustration). To measure this position:
• send the shovel to the origin using the following command:
   go to origin 2 2

• once the shovel is stopped, record the absolute shovel position by reading the value on the metric scale fixed on the launcher with the help of the indicator attached to the shovel.
• store the measured value (xx.xx) in the micro-controller flash memory using the command "set origin position".

• pulley diameter: The diameter of the pulley that is attached to the step-motor is used to calibrate the displacement of the shovel. A good initial guess can be obtained by measuring its diameter directly, as shown in the figure below. After storing this parameter in the micro-controller a more accurate calibration should be performed, described as the following:
• move the shovel to the origin by sending the command "go to origin 2 2"
• use the command "move forward" and request a displacement of 40 cm, e.g., "move forward 40 2 2" (speed of 2 cm/s is slow enough to guarantee a good calibration)
• check how much was the actual displacement: reached position - origin position
• if the displacement is different then the requested one (by more than 1 mm) scale linearly the pulley diameter to match the actual displacement with the requested one by using the formula:

$New\;pulley\;diameter = Old \; pulley \; diameter \cdot \frac{Actual \; displacement}{Requested \;displacement}$

• store the new "pulley diameter" in the micro-controller by using the command "set pulley diameter"
• resend the shovel back to the origin using the command "go to origin 2 2"
• check the correctness made by using again the command "move forward" and request a displacement of 40 cm. This time the reached position should corresponds to a displacement of 40 cm.

• photodiode position: The potodiode position corresponds to the location of the shovel when this one is stopped at the photo-diode/photo-gate, see the figure below for illustration. The procedure to obtain this position is the following:
• locate the shovel beyond (in the forward direction) the photo-gate and laser location. This can be achieved by using the command "move forward", as before.
• send the shovel to the photodiode using the command "move to photodiode", e.g., "move to photodiode 2 2" (to use a small speed of 2 cm/s)
• once the shove is stopped record the position on the metric scale and store it in the micro-controller using the command "set photodiode position"

After setting all parameters, double check if they were properly stored in the micro-controller by checking them on the menu by typing "?" or "help" on the console:

### Local gravity access

Local gravity in big cities normally is well known and documented by national geological entities which encompasses usually the most accurate value. Nevertheless a good comparison can be obtained with spatial harmonics even calculated on-line by a few calculators such as this Local Gravity Calculator