Difference between revisions of "Precision Pendulum Assembly: Electrical interfaces"
(→Layout) |
|||
(37 intermediate revisions by 4 users not shown) | |||
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 ( | + | * complementary electrical components: laser, micro-switch, photo-gate (aka photo-diode), light bulb, temperature sensor and 7-digits display. |
+ | see [[#Parts|Parts]] for detailed description. These components are 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. | ||
− | The photo-gate/photo-diode and laser alignment is described in subsection [[#Photo-gate and laser alignment|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|Interface console to micro-controller]] first. | + | [[File:ComparisonPhotodiodeLDR.png|thum|Comparison in the dispersion error between a photo-diode (StDev=0.002) or LDR (StDev=0.006) photodetector due to slew rate.|right|border|180px]] |
+ | |||
+ | The photo-gate/photo-diode and laser alignment is described in subsection [[#Photo-gate and laser alignment|Photo-gate and laser alignment]]. In particular, photo-diodes have been chosen due to their faster transition characteristics, reducing the overall jitter on the photo-gate and consequently the random error. | ||
+ | |||
+ | This is to be performed only after the micro-controller has been powered up, read section [[#Interface console to micro-controller|Interface console to micro-controller]] first. | ||
===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 | + | * '''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. The Raspberry Pi is used as well to power the micro-controller, as such a +5 V power supply with at least 2.5 A should be used. |
− | * '''SD card''': The SD card comes with Linux operating system and all necessary additional programs. | + | {| |
− | * ''' | + | |[[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. This should be an Industrial card with robust specs. |
− | * ''' | + | * '''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/Raspberry source). The board contains 4 LEDs: 2 red, 1 blue and 1 green. The red LEDs indicate if power is connected to the board. Looking to the figures bellow, the red LED on the left corresponds to the +5 V that powers the micro-controller board. The red LED on the right corresponds to the +12 V power that is used to feed the step-motor. The blue and green LEDs (LEDs at the top on the figure) are used for run-time information output by the micro-controller. The blue (left) LED turns on when the micro-switch is pressed, i.e., when the shovel is at the origin. The green (right) LED turns on when the photo-gate is active (conducting), i.e., when it is lit by the laser. The blue and green LEDs are also used for two other cases: (i) at boot and (ii) to indicate that the micro-controller is in an error state. At boot, the LEDs blink 5 times with a period of 400 ms and with alternate states (when the blue LED is ON the green LED is OFF and vice-versa). To indicate an error state, the LEDs blink with a period of about 2 s. |
− | * ''' | + | {| |
− | * ''' | + | |[[File:dspic_board_closed.png|x100px]] |
− | * ''' | + | |[[File:dspic_board_open.png|x100px]] |
− | * ''' | + | |[[File:dspic_board_closed_LEDs.jpg|x100px]] |
− | * ''' | + | |[[File:dspic_board_LEDs_blue.jpg|x100px]] |
+ | |[[File:dspic_board_LEDs_green.jpg|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. | ||
+ | {| | ||
+ | |[[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 for the displacement of the shovel. | ||
+ | {| | ||
+ | |[[File:step_motor_1.png|x100px]] | ||
+ | |[[File:step_motor_2.png|x100px]] | ||
+ | |} | ||
+ | * '''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). | ||
+ | {| | ||
+ | |[[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. This laser have a regulation for the focus, can be adjusted by rotating the lens. | ||
+ | {| | ||
+ | |[[File:laser_1_crop.jpg|x100px]] | ||
+ | |[[File:Laser_2_crop.jpeg|x100px]] | ||
+ | |[[File:Laser_3_crop.jpeg|x100px]] | ||
+ | |} | ||
+ | * '''Photo-gate (aka photo-diode)''': The photo-gate is located in front of the laser. The bob travels in-between them interrupting the laser light 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 and the bob velocity by knowing in advance it's diameter. ''NOTE'': Avoid direct sun-light or extreme luminous areas in front of it. | ||
+ | {| | ||
+ | |[[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 for high precision measurements. | ||
+ | {| | ||
+ | |[[File:temp_sensor_1.jpg|x100px]] | ||
+ | |[[File:temp_sensor_2_crop.jpg|x100px]] | ||
+ | |} | ||
+ | * '''Display''': The 7-digits 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 an external +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, 20 oscillations). An external stopwatch as to be use in complement to provide time. | ||
+ | {| | ||
+ | |[[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 lays down the connection between the micro-controller (dsPic) board, the RPi and the 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 has 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, see 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 138: | ||
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 procedure for the alignment consists of the following: | |
− | |||
− | |||
− | The procedure for the alignment consists | ||
# Turn on the laser using the "laser on" command | # Turn on the laser using the "laser on" command | ||
+ | # Verify with the help of a white sheet if the Laser focus dimension is below 1mm by the photo-diode; if not, it as to be adjusted by screwing the laser. | ||
# 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. | ||
# Perform the [[#Laser and photo-gate test|Laser and photo-gate test]] | # Perform the [[#Laser and photo-gate test|Laser and photo-gate test]] | ||
Line 46: | Line 151: | ||
===Electric tests=== | ===Electric tests=== | ||
− | * Test the micro-switch with the help of a | + | * 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. | ||
+ | |||
+ | ==Micro-controller (dsPic) board== | ||
+ | ===Overview=== | ||
+ | [[Media:DsPic_board_overview.pdf|DsPic_board_overview.pdf]] | ||
+ | |||
+ | ===Schematic=== | ||
+ | [[Media:SBOARD_4L_FULL_V6.pdf|DsPic_board_schematic.pdf]] | ||
+ | |||
+ | ===Layout=== | ||
+ | The dsPic board consists of a 4 layer PCB. The layouts follow below: | ||
+ | |||
+ | [[Media:TOP.pdf|TOP.pdf]] | ||
+ | |||
+ | [[Media:TOP2.pdf|TOP2.pdf]] | ||
+ | |||
+ | [[Media:INNER1.pdf|INNER1.pdf]] | ||
+ | |||
+ | [[Media:INNER2.pdf|INNER2.pdf]] | ||
+ | |||
+ | [[Media:BOT_NonMirrored.pdf|BOT_NonMirrored.pdf]] | ||
+ | |||
+ | [[Media:BOT2_NonMirrored.pdf|BOT2_NonMirrored.pdf]] | ||
+ | |||
+ | [[Media:BOT_Mirrored.pdf|BOT_Mirrored.pdf]] | ||
+ | |||
+ | [[Media:BOT2_Mirrored.pdf|BOT2_Mirrored.pdf]] | ||
+ | |||
+ | |||
+ | {| | ||
+ | |[[Precision Pendulum Assembly: Mechanical assembly| Previous Page (Mechanical assembly)]] | ||
+ | |} | ||
+ | {| | ||
+ | |[[Precision Pendulum Assembly: Software management| Next Page (Software management)]] | ||
+ | |} | ||
+ | |||
+ | ==Links== | ||
+ | |||
+ | *[[Montagem do Pêndulo de Precisão: Interfaces elétricas | Portuguese Version (Versão em português)]] | ||
+ | *[[Conjunto de péndulo de precisión: Interfaces eléctricas | Spanish Version (Versión en español)]] |
Latest revision as of 22:50, 28 July 2022
Contents
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.
- complementary electrical components: laser, micro-switch, photo-gate (aka photo-diode), light bulb, temperature sensor and 7-digits display.
see Parts for detailed description. These components are 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. In particular, photo-diodes have been chosen due to their faster transition characteristics, reducing the overall jitter on the photo-gate and consequently the random error.
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. The Raspberry Pi is used as well to power the micro-controller, as such a +5 V power supply with at least 2.5 A should be used.
- SD card: The SD card comes with Linux operating system and all necessary additional programs. This should be an Industrial card with robust specs.
- 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/Raspberry source). The board contains 4 LEDs: 2 red, 1 blue and 1 green. The red LEDs indicate if power is connected to the board. Looking to the figures bellow, the red LED on the left corresponds to the +5 V that powers the micro-controller board. The red LED on the right corresponds to the +12 V power that is used to feed the step-motor. The blue and green LEDs (LEDs at the top on the figure) are used for run-time information output by the micro-controller. The blue (left) LED turns on when the micro-switch is pressed, i.e., when the shovel is at the origin. The green (right) LED turns on when the photo-gate is active (conducting), i.e., when it is lit by the laser. The blue and green LEDs are also used for two other cases: (i) at boot and (ii) to indicate that the micro-controller is in an error state. At boot, the LEDs blink 5 times with a period of 400 ms and with alternate states (when the blue LED is ON the green LED is OFF and vice-versa). To indicate an error state, the LEDs blink with a period of about 2 s.
- 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 (specially useful if the experiment is performed during night).
- 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 for 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 is 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. This laser have a regulation for the focus, can be adjusted by rotating the lens.
- Photo-gate (aka photo-diode): The photo-gate is located in front of the laser. The bob travels in-between them interrupting the laser light 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 and the bob velocity by knowing in advance it's diameter. NOTE: Avoid direct sun-light or extreme luminous areas in front of it.
- 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 for high precision measurements.
- Display: The 7-digits 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.
- Power supply: The step-motor requires an external +12 V power supply capable of providing 2 A.
- Start button: The start button allows to locally start an experiment with a predefined configuration (initial displacement of 10 cm, 20 oscillations). An external stopwatch as to be use in complement to provide time.
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)
- Dedicated flat-cable: This cable lays down the connection between the micro-controller (dsPic) board, the RPi and the display. At the micro-controller side, the cable has a DB25 connector.
At the RPi side, the cable has a 2x20 pin connector to ensure a correct connection, see figures below.
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, see figure below.
- 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)
- 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.
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:
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.
The start button and temperature sensor are directly connected to the DB25 connector, so no need for intermediate connectors.
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:
- Turn on the laser using the "laser on" command
- Verify with the help of a white sheet if the Laser focus dimension is below 1mm by the photo-diode; if not, it as to be adjusted by screwing the laser.
- 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.
- Perform the Laser and photo-gate test
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.
Micro-controller (dsPic) board
Overview
Schematic
Layout
The dsPic board consists of a 4 layer PCB. The layouts follow below:
Previous Page (Mechanical assembly) |
Next Page (Software management) |