Difference between revisions of "Precision Pendulum Assembly: Electrical interfaces"

From wwwelab
Jump to navigation Jump to search
Line 3: Line 3:
 
* a Raspberry Pi (or computer running Linux): makes the interface between the micro-controller and the human (e.g., direct connection to a console) or e-lab server via Internet.
 
* a Raspberry Pi (or computer running Linux): makes the interface between the micro-controller and the human (e.g., direct connection to a console) or e-lab server via Internet.
 
* a micro-controller (dsPic): makes the interface between the electrical components (including the step-motor) and the computer.
 
* a micro-controller (dsPic): makes the interface between the electrical components (including the step-motor) and the computer.
* electrical components: laser, micro-switch, photo-gate (or photo-diode), light bulb, temperature sensor, etc... see [[#Parts|Parts]] for detailed description. These components connect directly to the micro-controller while providing ways of controlling the pendulum apparatus and bringing  measurement capabilities.
+
* electrical components: laser, micro-switch, photo-gate (or photo-diode), light bulb, temperature sensor, etc... see [[#Parts|Parts]] for detailed description. These components make the interface between the experimental apparatus and the micro-controller while providing ways of controlling the pendulum as well as measurement capabilities.
  
 
See the [[#Connections|Connections]] subsection for details on how to connect the electrical components.
 
See the [[#Connections|Connections]] subsection for details on how to connect the electrical components.
Line 11: Line 11:
 
===Parts===
 
===Parts===
 
This subsection presents a description of the different electrical parts of the experiment.
 
This subsection presents a description of the different electrical parts of the experiment.
* '''Raspberry Pi (RPi)''': Device running Linux to allow remote connection to the experiment as well as an easy way to interface with the micro-controller. The present micro-controller and corresponding flat cable connections are designed for the Raspberry Pi 3 Model B, which has the following pin-out connections as described in https://www.raspberrypi.org/documentation/usage/gpio. If the Raspberry Pi is used to also power the micro-controller, a +5 V power supply with at least 2.5 A should be used.
+
* '''Raspberry Pi (RPi)''': Device running Linux to allow remote connection to the experiment as well as an easy way to interface with the micro-controller. The present micro-controller and corresponding flat cable connections are designed for the Raspberry Pi 3 model B, which has the following pin-out connections as described in https://www.raspberrypi.org/documentation/usage/gpio. If the Raspberry Pi is used to also power the micro-controller, a +5 V power supply with at least 2.5 A should be used.
 +
{|
 +
|[[File:rpi.png|x100px]]
 +
|[[File:rpi_ps_1.png|x100px]]
 +
|[[File:rpi_ps_2.png|x100px]]
 +
|}
 
* '''SD card''': The SD card comes with Linux operating system and all necessary additional programs.
 
* '''SD card''': The SD card comes with Linux operating system and all necessary additional programs.
* '''micro-controller board''': This board contains a micro-controller (dsPic33F) as well as all peripheral components needed for the control of the experiment. The board can be powered using the flat cable connected to the Raspberry Pi or by a USB connection (an onboard jumper is used to select the power source, the default position corresponds to the one from the flat cable).
+
* '''micro-controller board''': This board contains a micro-controller (dsPic33F) as well as all peripheral components needed for the control of the experiment. The board can be powered using the flat cable connected to the Raspberry Pi or by an USB connection (an onboard jumper is used to select the power source, the default position corresponds to the one from the flat cable).
 +
{|
 +
|[[File:dspic_board_closed.png|x100px]]
 +
|[[File:dspic_board_open.png|x100px]]
 +
|}
 
* '''webcam''': The webcam is used to provide live video streaming during the execution of the experiment. It is connected to the Raspberry Pi via an USB cable. The RPi performs the encoding and then sends it through Internet.
 
* '''webcam''': The webcam is used to provide live video streaming during the execution of the experiment. It is connected to the Raspberry Pi via an USB cable. The RPi performs the encoding and then sends it through Internet.
* '''light bulb''': The light bulb consists of a 12 V LED bulb located above the launcher. This bulb turns on during the execution of the experiment to illuminate the pendulum and launcher (especially useful if the experiment is performed during the night).
+
{|
 +
|[[File:webcam.png|x150px]]
 +
|}
 +
* '''light bulb''': The light bulb consists of a 12 V LED bulb located above the launcher. This bulb turns on during the execution of the experiment to illuminate the pendulum and launcher (specially useful if the experiment is performed during night).
 +
{|
 +
|[[File:light_bulb.png|x125px]]
 +
|}
 
* '''step-motor''': The step-motor is part of the launcher and it is controlled by the micro-controller via a quad 1/2 H bridge driver. The step-motor is responsible by the displacement of the shovel.
 
* '''step-motor''': The step-motor is part of the launcher and it is controlled by the micro-controller via a quad 1/2 H bridge driver. The step-motor is responsible by the displacement of the shovel.
* '''micro-switch''': The micro-switch is located at the origin, close to the 0 cm of the metric scale on the launcher. It used to indicate the micro-controller that the shovel reached the origin and cannot go further in the backward direction (end of course).
+
{|
* '''laser''': The laser is located approximately at the center of the launcher. In conjunction with the photo-gate/photo-diode, the laser is used to measure the oscillation period as well as the location of the shovel. On power-on the laser is set ON to allow the verification of the photo-gate alignment. It should be performed a "local start" in order to leave the microcontroller in Stand-by mode, bringing the laser to a OFF state.  
+
|[[File:step_motor_1.png|x100px]]
* '''photo-gate (or photo-diode)''': The photo-gate is located in front of the laser. The ball travels in-between interrupting the light from the laser periodically.
+
|[[File:step_motor_2.png|x100px]]
* '''temperature sensor''': A temperature sensor is located in the DB25 box to measure the ambient temperature. The ambient temperature influences the length of the pendulum cable. It is therefore important to monitor this quantity.
+
|}
* '''display''': The display shows the total accumulated number of oscillations. It consists of 8 digits, each one a 7 segments display.
+
* '''micro-switch''': The micro-switch is located at the origin, close to the 0 cm of the metric scale on the launcher. It is used to indicate the micro-controller that the shovel reached the origin and cannot go further in the backward direction (end of course).
* '''power supply''': The step-motor requires a +12 V power supply capable of providing 2 A (maximum). Note that the microcontroller unit is feed by 5V coming from the Raspberry through the flat cable ''not from this unit''.
+
{|
 +
|[[File:ms_1.png|x100px]]
 +
|[[File:ms_2.png|x100px]]
 +
|}
 +
* '''laser''': The laser is located approximately at the center of the launcher. In conjunction with the photo-gate/photo-diode, the laser is used to measure the oscillation period as well as the location of the shovel.
 +
{|
 +
|[[File:laser_1_crop.jpg|x100px]]
 +
|[[File:Laser_2_crop.jpeg|x100px]]
 +
|[[File:Laser_3_crop.jpeg|x100px]]
 +
|}
 +
* '''photo-gate (or photo-diode)''': The photo-gate is located in front of the laser. The ball travels in-between interrupting the light from the laser periodically resulting in a change of state at the input pin of the micro-controller. It is then possible to measure the period of the pendulum.
 +
{|
 +
|[[File:ph_gate_1.jpg|x100px]]
 +
|[[File:ph_gate_2_crop.jpg|x100px]]
 +
|}
 +
* '''temperature sensor''': A temperature sensor is located in the DB25 box to measure the ambient temperature. The ambient temperature influences the length of the pendulum. It is therefore important to monitor this quantity.
 +
{|
 +
|[[File:temp_sensor_1.jpg|x100px]]
 +
|[[File:temp_sensor_2_crop.jpg|x100px]]
 +
|}
 +
* '''display''': The display shows the total accumulated number of oscillations. It consists of 8 digits, each one a 7 segments display. Some of the micro-controller board versions allow the connection of the display directly on the board from outside of the box.
 +
{|
 +
|[[File:display_loose_crop.jpg|x100px]]
 +
|[[File:display_fixed_crop.jpg|x100px]]
 +
|}
 +
* '''power supply''': The step-motor requires a +12 V power supply capable of providing 2 A.
 +
{|
 +
|[[File:ps_1_crop.jpg|x100px]]
 +
|[[File:ps_2_crop.jpg|x100px]]
 +
|[[File:ps_3_crop.jpg|x100px]]
 +
|}
 
* '''start button''': The start button allows to locally start an experiment with a predefined configuration (initial displacement of 10 cm during 20 oscillations).
 
* '''start button''': The start button allows to locally start an experiment with a predefined configuration (initial displacement of 10 cm during 20 oscillations).
 +
{|
 +
|[[File:push_button_crop.jpg|x100px]]
 +
|}
  
 
===Connections===
 
===Connections===
 +
This subsection shows how the components and cables are connected between each other.
 +
* '''RPi''': The Raspberry Pi connects to the following:
 +
** Power supply (via micro USB connector)
 +
** Internet (via Ethernet cable)
 +
** Webcam (via USB cable)
 +
** Micro-controller board (via dedicated flat-cable)
 +
{|
 +
|[[File:rpi_connections.jpg|x200px]]
 +
|}
 +
* '''Dedicated flat-cable''': This cable makes the connection between the micro-controller (dsPic) board and the RPi and display. At the micro-controller side, the cable has a DB25 connector.
 +
{|
 +
|[[File:flat_cable_DB25_crop.jpg|x150px]]
 +
|}
 +
At the RPi side, the cable as a 2x20 pin connector to ensure a correct connection, see figures below.
 +
{|
 +
|[[File:flat_cable_rpi_1_crop.jpg|x150px]]
 +
|[[File:flat_cable_rpi_2_crop.jpg|x150px]]
 +
|[[File:flat_cable_rpi_3_crop.jpg|x150px]]
 +
|}
 +
At the display end, the connector consist of a 1x5 connector. Please, ensure that the connector side is correct before connecting to the display: the VCC pin of the display connects to the wire that is highlighted, in this case, with a blue trace. See figure below for illustration. Some versions allow the display to be connected directly on the micro-controller box. In such cases, the display should be connected as shown on the right hand side figure below.
 +
{|
 +
|[[File:flat_cable_display_crop.jpg|x150px]]
 +
|[[File:display_fixed_crop.jpg|x150px]]
 +
|}
 +
* '''Micro-controller''': The dsPic board connects to the following:
 +
** +12 V power supply to feed the step motor
 +
** RPi (via the flat-cable)
 +
** Electrical components (via dedicated multi-cable)
 +
{|
 +
|[[File:Dspic_board_closed_crop_connections.jpg|x200px]]
 +
|}
 +
* '''Dedicated multi-cable''': The multi-cable connects the dsPic board with electrical components used to perform the experiment. At the dsPic board end, the cable has a DB25 connector as shown in the figure below.
 +
{|
 +
|[[File:multi_cable_DB25_crop.jpg|x150px]]
 +
|}
 +
At the light bulb, micro-switch, laser and photo-gate end, the multi-cable has a 2 pin connector as shown in the following figures:
 +
{|
 +
|[[File:multi_cable_light_bulb_crop.jpg|x75px]]
 +
|[[File:multi_cable_ms_crop.jpg|x75px]]
 +
|[[File:multi_cable_laser_crop.jpg|x75px]]
 +
|[[File:multi_cable_photogate_crop.jpg|x75px]]
 +
|}
 +
At the step-motor end, the multi-cable has 4 pin connector. This is the only 4 pin connector and therefore it is not identified as the remaining ones. See figure below for illustration.
 +
{|
 +
|[[File:multi_cable_step_motor_crop.jpg|x75px]]
 +
|}
 +
The start button and temperature sensor are directly connected to the DB25 connector, so no need for intermediate connectors.
 +
{|
 +
|[[File:push_button_crop.jpg|x75px]]
 +
|[[File:temp_sensor_2_crop.jpg|x75px]]
 +
|}
  
 
===Photo-gate and laser alignment===
 
===Photo-gate and laser alignment===
Line 31: Line 130:
 
The alignment consists of pointing the laser into the hole of the photo-gate structure, as shown below in the figure on the left. The laser orientation can be adjusted using the 3 screws from its holding support structure, figure on the middle.  
 
The alignment consists of pointing the laser into the hole of the photo-gate structure, as shown below in the figure on the left. The laser orientation can be adjusted using the 3 screws from its holding support structure, figure on the middle.  
  
The laser should come from factory correctly focused; nevertheless it's focus can be refined if needed by using a proper white sheet and rotating the laser lens to bring a focus diameter below 1mm at ~150mm focal plane.
+
The procedure for the alignment consists of the following:
 
 
 
The procedure for the alignment consists on the following steps:
 
 
# Turn on the laser using the "laser on" command
 
# Turn on the laser using the "laser on" command
 
# If necessary, adjust the laser orientation so that its light goes into the photo-gate structure hole (figure on the left). An example of misalignment is shown in the figure on the right.
 
# If necessary, adjust the laser orientation so that its light goes into the photo-gate structure hole (figure on the left). An example of misalignment is shown in the figure on the right.
Line 46: Line 142:
  
 
===Electric tests===
 
===Electric tests===
* Test the micro-switch with the help of a multimeter (ohmmeter). When released it should present a very high impedance (order of MOhm) and when pressed it should present a very low impedance (like a shunt, ~0 Ohm). Perform the measurement at the DB25 pins: between pins no. 3 and 4.
+
* Test the micro-switch with the help of a multi-meter (ohmmeter). When released it should present a very high impedance (order of MOhm) and when pressed it should present a very low impedance (like a shunt, ~0 Ohm). Perform the measurement at the micro-switch and at the DB25 pins: between pins no. 3 and 4.
 
* Check voltage of step-motor power supply to ensure that it is not higher than +12 V.
 
* Check voltage of step-motor power supply to ensure that it is not higher than +12 V.
* Once connected to the Raspberry through the D25 flat cable, the display should state the last count number and power led green comes up.
 

Revision as of 00:21, 29 December 2019

Electrical interfaces

This section describes the electrical components used to operate the experimental apparatus. As an overview, each launcher consists of:

  • a Raspberry Pi (or computer running Linux): makes the interface between the micro-controller and the human (e.g., direct connection to a console) or e-lab server via Internet.
  • a micro-controller (dsPic): makes the interface between the electrical components (including the step-motor) and the computer.
  • electrical components: laser, micro-switch, photo-gate (or photo-diode), light bulb, temperature sensor, etc... see Parts for detailed description. These components make the interface between the experimental apparatus and the micro-controller while providing ways of controlling the pendulum as well as measurement capabilities.

See the Connections subsection for details on how to connect the electrical components.

The photo-gate/photo-diode and laser alignment is described in subsection Photo-gate and laser alignment. This is to be performed only after the micro-controller has been powered up, read section Interface console to micro-controller first.

Parts

This subsection presents a description of the different electrical parts of the experiment.

  • Raspberry Pi (RPi): Device running Linux to allow remote connection to the experiment as well as an easy way to interface with the micro-controller. The present micro-controller and corresponding flat cable connections are designed for the Raspberry Pi 3 model B, which has the following pin-out connections as described in https://www.raspberrypi.org/documentation/usage/gpio. If the Raspberry Pi is used to also power the micro-controller, a +5 V power supply with at least 2.5 A should be used.
Rpi.png Rpi ps 1.png Rpi ps 2.png
  • SD card: The SD card comes with Linux operating system and all necessary additional programs.
  • micro-controller board: This board contains a micro-controller (dsPic33F) as well as all peripheral components needed for the control of the experiment. The board can be powered using the flat cable connected to the Raspberry Pi or by an USB connection (an onboard jumper is used to select the power source, the default position corresponds to the one from the flat cable).
Dspic board closed.png Dspic board open.png
  • webcam: The webcam is used to provide live video streaming during the execution of the experiment. It is connected to the Raspberry Pi via an USB cable. The RPi performs the encoding and then sends it through Internet.
Webcam.png
  • light bulb: The light bulb consists of a 12 V LED bulb located above the launcher. This bulb turns on during the execution of the experiment to illuminate the pendulum and launcher (specially useful if the experiment is performed during night).
Light bulb.png
  • step-motor: The step-motor is part of the launcher and it is controlled by the micro-controller via a quad 1/2 H bridge driver. The step-motor is responsible by the displacement of the shovel.
Step motor 1.png Step motor 2.png
  • micro-switch: The micro-switch is located at the origin, close to the 0 cm of the metric scale on the launcher. It is used to indicate the micro-controller that the shovel reached the origin and cannot go further in the backward direction (end of course).
Ms 1.png Ms 2.png
  • laser: The laser is located approximately at the center of the launcher. In conjunction with the photo-gate/photo-diode, the laser is used to measure the oscillation period as well as the location of the shovel.
Laser 1 crop.jpg Laser 2 crop.jpeg Laser 3 crop.jpeg
  • photo-gate (or photo-diode): The photo-gate is located in front of the laser. The ball travels in-between interrupting the light from the laser periodically resulting in a change of state at the input pin of the micro-controller. It is then possible to measure the period of the pendulum.
Ph gate 1.jpg Ph gate 2 crop.jpg
  • temperature sensor: A temperature sensor is located in the DB25 box to measure the ambient temperature. The ambient temperature influences the length of the pendulum. It is therefore important to monitor this quantity.
Temp sensor 1.jpg Temp sensor 2 crop.jpg
  • display: The display shows the total accumulated number of oscillations. It consists of 8 digits, each one a 7 segments display. Some of the micro-controller board versions allow the connection of the display directly on the board from outside of the box.
Display loose crop.jpg Display fixed crop.jpg
  • power supply: The step-motor requires a +12 V power supply capable of providing 2 A.
Ps 1 crop.jpg Ps 2 crop.jpg Ps 3 crop.jpg
  • start button: The start button allows to locally start an experiment with a predefined configuration (initial displacement of 10 cm during 20 oscillations).
Push button crop.jpg

Connections

This subsection shows how the components and cables are connected between each other.

  • RPi: The Raspberry Pi connects to the following:
    • Power supply (via micro USB connector)
    • Internet (via Ethernet cable)
    • Webcam (via USB cable)
    • Micro-controller board (via dedicated flat-cable)
Rpi connections.jpg
  • Dedicated flat-cable: This cable makes the connection between the micro-controller (dsPic) board and the RPi and display. At the micro-controller side, the cable has a DB25 connector.
Flat cable DB25 crop.jpg

At the RPi side, the cable as a 2x20 pin connector to ensure a correct connection, see figures below.

Flat cable rpi 1 crop.jpg Flat cable rpi 2 crop.jpg Flat cable rpi 3 crop.jpg

At the display end, the connector consist of a 1x5 connector. Please, ensure that the connector side is correct before connecting to the display: the VCC pin of the display connects to the wire that is highlighted, in this case, with a blue trace. See figure below for illustration. Some versions allow the display to be connected directly on the micro-controller box. In such cases, the display should be connected as shown on the right hand side figure below.

Flat cable display crop.jpg Display fixed crop.jpg
  • Micro-controller: The dsPic board connects to the following:
    • +12 V power supply to feed the step motor
    • RPi (via the flat-cable)
    • Electrical components (via dedicated multi-cable)
Dspic board closed crop connections.jpg
  • Dedicated multi-cable: The multi-cable connects the dsPic board with electrical components used to perform the experiment. At the dsPic board end, the cable has a DB25 connector as shown in the figure below.
Multi cable DB25 crop.jpg

At the light bulb, micro-switch, laser and photo-gate end, the multi-cable has a 2 pin connector as shown in the following figures:

Multi cable light bulb crop.jpg Multi cable ms crop.jpg Multi cable laser crop.jpg Multi cable photogate crop.jpg

At the step-motor end, the multi-cable has 4 pin connector. This is the only 4 pin connector and therefore it is not identified as the remaining ones. See figure below for illustration.

Multi cable step motor crop.jpg

The start button and temperature sensor are directly connected to the DB25 connector, so no need for intermediate connectors.

Push button crop.jpg Temp sensor 2 crop.jpg

Photo-gate and laser alignment

The photo-gate and laser alignment can only be performed once the micro-controller has been turned on and it is communicating with a console. See subsection Interface console to micro-controller on how to power on the micro-controller and how to control the laser. The alignment consists of pointing the laser into the hole of the photo-gate structure, as shown below in the figure on the left. The laser orientation can be adjusted using the 3 screws from its holding support structure, figure on the middle.

The procedure for the alignment consists of the following:

  1. Turn on the laser using the "laser on" command
  2. If necessary, adjust the laser orientation so that its light goes into the photo-gate structure hole (figure on the left). An example of misalignment is shown in the figure on the right.
  3. Perform the Laser and photo-gate test
Laser in photogate crop.jpg Laser structure 3 screws crop.jpg Laser out photogate crop.jpg

Electric tests

  • Test the micro-switch with the help of a multi-meter (ohmmeter). When released it should present a very high impedance (order of MOhm) and when pressed it should present a very low impedance (like a shunt, ~0 Ohm). Perform the measurement at the micro-switch and at the DB25 pins: between pins no. 3 and 4.
  • Check voltage of step-motor power supply to ensure that it is not higher than +12 V.