PCB

From Bike Wiki
Jump to navigation Jump to search

The Printed Circuit Board (PCB) acts as the “brain” of the bicycle. It lets us connect sensors and actuators (e.g. front motor, rear motor) to the Arduino microcontroller in an organized way. Understanding the components and layout of the PCB improves our ability to diagnose issues with the bike. There are multiple design iterations of the PCB as of Spring 2020 (a.k.a. awakening of the Corona). Please visit our GitHub page to download and view the schematic and board files. The purpose of this page is to provide an outline for training new team members to effectively debug PCB issues as well as work on future PCB design iterations.

Design Software (EAGLE)

The current software used within team to develop and design PCBs is Autodesk EAGLE. EAGLE is a scriptable electronic design automation application with schematic capture, printed circuit board layout, auto-router and computer-aided manufacturing features. To download the software visit their download [1]. Youtuber Jeremy Blum gives a relatively extensive video series on EAGLE tutorials ([2]).

Current design of the PCB (particularly the input/output terminals) uses a specific EAGLE library that needs to be downloaded externally from the standard libraries that comes with the EAGLE download. This is a [3] to the download page for the library. Other libraries that may be useful are the Adafruit [4]. To learn how to download and add libraries, please visit this [5].

The EAGLE interface can be roughly organized into four components: Project, Schematic, Board, and Libraries.

Project

The Project interface contains files of schematics and board layout designs for one project. It is useful when we want to design multiple boards for one single project. In our design, since we only have one circuit board to design, we could include only two files under our project: the schematic and the board layout, although previous design versions are kept as well. We can add them to the current project by simply adding new files when we created the files in the first place.

Schematic

The Schematic interface is where we create the schematics of our design. It shows the high-level idea of the project. When we create the schematics, all we need to do is to show the basic principles of the PCB, such as which two components should be connected and where their pins should connect to. The schematics does not have to be correct in terms of scales, because they are not the actual blueprints of the circuit. They only show the connectivity of components on the circuit board.

Board

The Board interface is where we deal directly with the board itself. It is completely in scale, which means the area a component takes on the grid of the board layout is the same as the area a real component would take on a real PCB, unlike the schematics. In this interface, we are able to place components anywhere we wish on the board, and we can connect them by placing wires between designated pins. In the real PCB, the wires should be internally built. However, there is one thing that we need to keep an eye on: we should minimize the occurrences of jumper wires; we should try our best to clear them out. A jumper wire is still a wire that connects two pins, but it is placed outside the board. It appears when the design fails to arrange a normal internal wire to connect the pins. Jumpers should be minimized (if not eliminated), because they are exposed to the outside and they are not as secure as internal wires. It is also feasible for us to eliminate the jumper wires, because we actually have two layers in the PCB, a top layer and a bottom layer that enable two wires to cross, but placed in two layers vertically. If we manage the design carefully enough, there should be a layout solution that does not include any jumper wire. A built-in tool, named Autorouter, could help us build up a number of layout solutions while following all the preset design rules, such as not having un-wired ports or un-determined values for components like capacitors. We could simply pick one of the solutions, although it could include some jumper wires that are possible to be fixed manually.

Library

The Library interface enables us to create or edit a library. A library in Eagle CAD contains one or multiple components, each with different sub-models and technologies, such as through-hole and surface-mount technology (SMT). Those components have three sub-interfaces: Package, Symbol, and Device. Package is the part that displays the actual, in-scale component model. For a component, what we see in Package is the same as what we deal with in the board layout design. Symbol, on the other hand, is the part that is not necessarily in-scale, and when we create schematics we place the Symbols of components. Device is the part that combines Package and Symbol – it connects pins defined in Package to pins declared in Symbol. We don’t interact with Device when we create the schematics or board layouts, but we do when we create a custom component in a library. For some of the components that we are using, such as the line receiver and the connectors, we can simply utilize existing libraries that are either built-in in the Eagle CAD or somewhere online. Although Eagle CAD already comes with hundreds of components, it also happens that the component we want to use is not included. In that case, we will have to build our own libraries. Here is [6] more on the details of EAGLE libraries and how to build your libraries.

Board Overview

Currently, the board is a two-layer PCB, where the bottom and top layer are ground (GND) and Vsignal. In addition, the bottom layer of the PCB is divided into regions, where one region is for operating voltages of 3.3V and the other for 5V. In other words, the components on the 3.3V area, for example, operate on supply voltages of 3.3V. The purpose behind this is to avoid the risk of short-circuit on the board.

Integrated Chips and Other Components

  • Differential Line Receiver (LR1/LR2):
    • There are two differential line receivers (labeled as LR1 and LR2 on EAGLE). The purpose of these ICs is to sense small differential signals in the presence of large common-mode noise. LR1 is currently being used for the front-motor encoder, whereas LR2 is not being used. However, LR2 can be used for a secondary encoder, if desired.
  • Operational Amplifier (Op-Amp):
    • There is one operational amplifier on the board that is labeled as op-amp. We use an op-amp (MCP6041) to process the propulsion motor control signal. The opamp, along with resistors and capacitors that work with it, transforms the Arduino's original square wave signals into sinusoidal wave signals. The reason behind is that the motor controller only recognizes sinusoidal signals, and it would not function properly if we connect it directly to the arduino.
  • Isolators (Isolator 1/Isolator 2):
    • Some circuits may be damaged if they try to talk to each other, and digital isolators are devices that make it possible for them to communicate without blowing each other up. Currently, there are two isolators on the board (labeled as Isolator 1 and Isolator 2). The current isolators we use are two-channel digital isolators with part number IL711. Isolator 1 isolates the DIGITOUT and PWM channels for the front motor. Isolator 2 isolates the TIMER and PWM channels for the rear motor.
  • Voltage Regulator (VRegulator):
    • A voltage regulator is a system designed to automatically maintain a constant voltage level. Voltage regulators work by converting a an input to (in our case) a lower, stabilized voltage by dissipating the extra voltage via heat (explaining why many voltage regulators have a small heat sink attached). The current voltage regulator on the board (labeled as VREGULATOR) is a 7818DT. It converts the voltage supplied by the battery (24V) to a regulated 5V.
  • DC-DC Converter (DC-CONV):
    • A DC-to-DC converter is an electronic circuit or electromechanical device that converts a source of direct current (DC) from one voltage level to another. Note that voltage regulators are a type of DC-DC converters. Specifically, the DC-DC converter that is on the board converts the battery's power supply (24V) to 12V (net wire labeled as BIKE_IN) and provides required voltage to power the Arduino DUE.
  • Isolation Amplifier:
    • Isolation amplifiers are a form of differential amplifier that allow measurement of small signals in the presence of a high common mode voltage by providing electrical isolation and an electrical safety barrier.

Inputs and Outputs

The PCB serves as a platform to connect different embedded systems to the Arduino. Below is a current list of inputs and outputs on the board.

  • Inertial Measurement Unit (IMU):
    • The IMU (Inertial Measurement Unit) is a sensor used to provide information regarding the bike's current angle and angular rates. The IMU is connected to the board using a six pin-out terminal. Because the IMU communicates with the DUE using SPI, the pin-out terminal requires MISO, MOSI, and SCK connections to the DUE. The pin-out terminal has a pin called IMU-CS and it is believed to be the designated SS (Slave Select) for the IMU. Additionally, two pins (5V and GND) supplies power to the IMU.
  • (RS):
    • Similarly, the RS communicates to the DUE using SPI and thus requires the same terminals, MISO, MOSI, SCK, and (in this case) RS-CS. The RS is connected to the board through a six pin-out terminal, two terminals being GND and 3.3V. Initially, the RS terminal was used for the BeagleBone Black that is a micro-controller. The motivation behind the BeagleBone was that the DUE would communicate with the IMU through the BeagleBone. However, the BeagleBone is no longer used and the DUE directly communicates with the IMU directly via SPI. Currently, the pin-put terminal for RS is not used but serves as an extra SPI communication port and thus may be used for any future microcontrollers or peripherals (e.g. Raspberry Pi).
  • Bike Power Supply (BIKE-PWR):
    • The bike power supply is a simple power supply terminal (i.e. Vcc and GND) where the potential supplied across the terminals is around 24 V (i.e. external battery).
  • (RE1/RE2):
    • The four-by-two pin headers RE1 and RE2 are meant to receive the six outputs (AIN1, AIN2, BIN1, BIN2, CIN1, CIN2) from the encoder and supply 5V power supply. To learn more about encoder outputs and their function, check Fundamental Concepts. Currently, only RE1 is used for the front motor encoder. Although RE2 is not being used, it was decided to keep it because of the potential benefit of having a secondary encoder. This includes differential measurements (i.e. minimizing error) for the front motor or simply another encoder for a new motor that may be used (e.g. landing gear).
  • (RC):
  • Actuators (BIKEMOTOR):
  • (APINS):
    • 6 pins directly connected to the DUE. Believed to be input pins that serve as analog input signals and are currently not being used.
  • (SPINS):
    • Used for communication between the Arduino board and a computer or other devices. Serial communication on pins TX/RX uses TTL logic levels (5V or 3.3V depending on the board). Don’t connect these pins directly to an RS232 serial port; they operate at +/- 12V and can damage your Arduino board. To use these extra serial ports to communicate with your personal computer, you will need an additional USB-to-serial adaptor, as they are not connected to the Mega’s USB-to-serial adaptor. To use them to communicate with an external TTL serial device, connect the TX pin to your device’s RX pin, the RX to your device’s TX pin, and the ground of your Mega to your device’s ground.
  • (DPINS):
    • Believed to be input pins that serve as digital input signals and are currently not being used.
  • Relay Switch (RELAY):
    • 6 pins (two connected to 5V and GND), where 4 pins are for the four individual relays on the relay module. Currently not being used, but can be implemented for future landing gear design.
  • GPS:
  • Remote Control Power (RC_PWR):
    • 2 pins that provide 5V and GND to the RC module.
  • Front Motor and Rear Motor Ground (FM_RM_BGND):
    • 2 pins that provide battery ground BGND to both the rear and front motor.

Testing and Debugging