EE Bootcamp

Introduction

Welcome to the WARG EE Bootcamp! As our new teammate, you will be involved with designing lots of custom hardware to support the desired features of our UAV systems. The bootcamp is designed to help you develop a basic foundation of knowledge in the industry of electronics and to gain experience working with Altium Designer, our preferred choice of PCB CAD software.

In this bootcamp, you will be designing a basic 4s 3A brushed DC motor controller with a few additional features using Altium Designer.

Additionally as a new teammate working through this bootcamp, you will be able to contribute to the quality of this exercise through feedback. Please contact your co-leads Ethan Abraham or Daniel Puratich if you have any feedback for us. As members who are well versed in various PCB CAD software, we may have overlooked crucial concepts/topics to address for your learning.

Getting Started

Retrieving the EE Bootcamp Files

To get started, please visit our GitHub repo. Clicking on the green button labelled “Code”, a drop-down menu should appear. Please clone our repo onto your device with your preferred method. Once cloned, navigate to our repo in your file explorer.

Create a copy of “WARG EE Bootcamp” and save it elsewhere in your device locally. Once done, open the folder and take a look at the various files present within.

As you can see, we have the following files:

  • History: Altium Designer saves a compressed version of your project into this folder every time you save it. This folder is typically irrelevant and does not ever need to be tinkered with.

  • WARG EE Bootcamp Libraries: This folder contains both the schematic symbol and PCB footprint libraries of our project. These libraries define every component you will ever place on a PCB. In Altium Designer, each component has a schematic symbol with an associated PCB footprint. The schematic symbol represents a given component on a schematic document and the PCB footprint represents a given component on a PCB document. You will learn more about this later.

  • WARG EE Bootcamp.OutJob: This folder contains the output job files of a project. Any files required for manufacturing or component purchasing can be found here.

  • WARG EE Bootcamp.PcbDoc: The PCB document. This file is where your PCB is designed. Whatever is created in this file will be what your PCB exactly looks like

  • WARG EE Bootcamp.SchDoc: A schematic document. This file is where you define connections between parts on your PCB. These documents visually show how components are connected together. A project can have multiple schematic documents/sheets. The need for multiple schematic documents is simply for organizational clarity.

  • WARG EE Bootcamp.PrjPcb: This file defines the structure of the project itself

  • WARG EE Bootcamp.PrjPcbStructure: I have no idea what this does. It seems important, so don’t delete it.

Setting up Altium Designer (License and Installation)

As a university student, you have the power to acquire an Altium Designer license for free! Please visit the Altium Education page and fill in the required details to get your license.

Now that you have obtained an Altium Designer license, you can install Altium Designer with their installer. Follow through with the hyperlink labelled “download the free trial”. Click “Yes” and then “I need the latest Altium Designer installer”. This should prompt you to download their installation wizard. Install Altium Designer and I’ll see you in the next section.

Opening Projects and Project Files

Once you have Altium Designer, please open it. Your application should look something like this:

You may be prompted to activate a license before seeing the snapshot above. If this is the case, please activate the license you have just applied for. Note that as a student, once you license expires, you may retrieve a new one, so long as you are still officially registered as a student.

Clicking File->Open Project->Browse… you can then navigate to the project file you are looking for in your file explorer. Find where you have saved the EE bootcamp locally and open the Altium PCB Project file (.PrjPcb). Your application should now look something like this:

Notice the newly appeared file structure under the “Projects” tab. This tab allows you to navigate between the various files within a project, and even between projects themselves. You can open multiple projects at once and they will all appear under the “Projects” tab , separated from one another.

Have a go at opening all the relevant project files (WARG EE Bootcamp.SchDoc, WARG EE Bootcamp.PcbDoc, and the SchLib and PcbLib files found within Libraries). Do not tinker with the other files (Settings, Components, Nets). These files are implicitly modified based on what you do elsewhere in your project (they might not even show up for you).

Familiarizing Yourself With Each File

Now that you have opened each file, they should appear along the top of your application window horizontally. You can switch between files in this way as well.

Schematic Document

Let us first take a look at the schematic document we have available. Your screen should look something like this:

Zooming in, you can see various circuit topologies organized separately. If we wanted to, we could separate certain circuits onto multiple documents/sheets (I typically prefer to use the term sheets). This is particularly important to do for much more complicated PCB designs. Fortunately, you need not to worry about such a thing. In particular, we have the following groups of circuits present on this sheet:

  • Bus Connector & RPP

  • Bus Current Sense

  • 4S-3V3 @ 2A Max. Buck Converter

  • Bus Voltage Sense

We will go into further detail on each of these sub-circuits later.

PCB Document

Let’s now take a look at the PCB document. Your application window should look something like this:

That’s strange, why is there just a black box? Well, that’s because you’ll have to do all of the PCB design work. In fact, I absolutely ruined some of the circuits present in your schematic, so you’ll have to figure out what’s wrong in order to fix them.

The PCB document is where you’ll connect all your components together with traces, polygons, etc. This document absolutely describes the physical construction of your design.

PCBs, short for “Printed Circuit Boards” can be made up of multiple layers. Often for low complexity PCB designs, 2-layer or 4-layer boards are used. The composition of the various layers of a PCB are together referred to as the Layer Stackup. Here’s an example of a common 2-layer stackup:

As you can see, there are various layers to a board. When you order a PCB to be manufactured, the manufacturing company typically has multiple layer stackup presets with associated thicknesses available for you. All you have to worry about is ensuring all these layers are present within your PCB document, and arranged or defined correctly. For this bootcamp, you will be designing a 4-layer PCB. When describing the layer stackup of a board, the layers which are not any of the copper layers are typically not spoken of explicitly (they are still there). Hence, a 2-layer PCB has two copper layers, and a 4-layer PCB has four copper layers.

For our application, the 4-layer PCB will have copper layers assigned to the following purposes:

  1. Top Signal Layer

  2. GND

  3. VCC (or Power)

  4. Bottom Signal Layer

Pausing with the bootcamp for a moment, research briefly on the following topics to gain a better understanding of layer stackups, and in particular, common 4-layer stackups. You should be able to understand what each of the following purposes listed above mean roughly (with experience, you’ll develop a stronger foundation of understanding).

Schematic Library

Let’s take a look at the schematic library next. Your application window should look like this:

Do not stress if you do not see the same component. At the bottom left corner, you should see a tab called “SCH Library”. Switching to this tab will reveal all the various schematic symbols for each component we have in this particular bootcamp library. Take a look around different components and pay attention to how they are organized and presented in our library.

Let’s focus our attention to a particular component, say the C0603C103J5RAC7867 MLCC capacitor. Your application window should look like this:

On the right corner of the application window, you should see a button called “Panels”. This button is your best friend. If you ever accidentally close a tab (ie. SCH Library, Properties. etc.), you can reopen them through the Panels button. Taking a look at the Properties tab, you should be able to see multiple characteristics describing the component at hand. They are described as follows:

  • Design Item ID: This is what Altium Designer uses to reference a particular component of a library. When a component is placed on a schematic document, it will be referenced to a Design Item ID of a particular schematic library. The same can be roughly said for a PCB document. Typically, we will use a component’s manufacturer part number (MPN) as it’s Design Item ID.

  • Designator: This is what Altium Designer uses to reference a component (ie. C1, Q3, R3, etc.). In our schematic libraries, we will always use a ? suffix so that Altium Designer can auto-assign a number to the component when annotating the schematic.

  • Comment: A comment describing the characteristics of the component briefly. This is typically taken from a component’s “Description” on Digi-Key

  • Part: For large enough components, it may be necessary to split the schematic symbol into multiple parts. This allows you to switch between those parts.

  • Description: We will put the same as what we put into the Comment property.

  • Parameters: Clicking “Show More”, you can view all the parameters defined for a specific component. All components listed in the schematic library MUST at least have the following parameters:

    • Manufacturer 1

    • Manufacturer Part Number 1

    • Supplier 1

    • Supplier Part Number 1

  • Footprint: This is how we link PCB footprints from our PCB library to components in our schematic library. You can have multiple components defined in the schematic library link to the same PCB footprint. This is commonly seen among chip resistors/capacitors.

In our sub-team, we like to manage our libraries with detailed clarity and organization. Whenever you add a new component to our libraries, please mimic how we have defined pre-existing components. Writing parameters word for word with proper capitalization, including units, etc. These all must be consistent from component to component.

PCB Library

Let’s take a look at the PCB library. Opening it up, your screen should look like this:

As you can see, the PCB Library tab holds a list of the various PCB footprints defined in our libraries. Take a look around at the different components we have in the EE bootcamp PCB library currently.

Returning to the 8-SOIC PCB footprint (8-SOIC is the name of this particular package), we can take a look at the various things which define a component’s makeup on a PCB.

  • Top Layer: This is where any conductive copper is defined on the top layer for a given component. In this particular case, we have 8 copper pads defined on the top layer. Use Shift+S to cycle between different ways to view a particular layer.

  • Bottom Layer: This is where any conductive copper is defined on the bottom layer for a given component.

  • Mechanical 1: This layer defines the 3D model of the component. Typically, we will import 3D packages from the internet into our Mechanical 1 layer. Press 3 to switch to 3D view, and 2 to switch to 2D view.

    • To add a 3D model, go to Place->3D Body->Select your 3D model in file explorer.

    • The component may not be oriented correctly, to reorient, in 3D view, go to Tools->3D Body Placement->Align Face with Board->Click the 3D model of the component you want to align->Click the surface of the 3D model of the component you want to align. This will orient the 3D model to touch the surface of the PCB footprint at the surface of the component you selected. (Hold Shift + Right Click to rotate around in 3D view.

  • Top Overlay: This defines the top layer silkscreen of the component. It is nonconductive and is used to essentially draw outlines, define pin 1 assignments, and other things (you can upload memes to your PCB on a silkscreen layer if you wanted to).

  • Bottom Overlay: Same thing as the Top Overlay except it is on the bottom.

  • Top Solder: Defines the solder paste cutout for a given component. This is typically used for stencils, sheets of metals with cutouts defined by the solder paste layers so that you can apply solder paste to your board for components to be placed on. Look up solder paste, stencil, and PCB oven videos on YouTube, this is an alternative and much more efficient method to assembling PCBs in bulk as opposed to hand soldering.

  • Bottom Solder: Same thing as the Top Solder except it is on the bottom.

Two layers which are not defined here explicitly are the top and bottom solder mask layers. Solder mask defines where copper should not be placed on a board. Without solder mask and the ability to change their sizes, we could accidentally short traces together. Solder masks of copper in PCB footprints are typically defined by each pad or through hole themselves. If you select a pad, you will be able to see this under Solder Mask Expansion. In other PCB CAD software, you might need to define the solder mask separately, as required in Autodesk’s PCB CAD software EAGLE.

Fixing the Schematic

Now that you have taken a look at all these different files, we can start fixing the schematic. You do not have to work on these sub-circuits in any order.

Bus Connector & RPP

This circuit contains a screw terminal connector for which the terminals of the battery are connected to. Let us note that this PCB is supplied power using a 4s2p LiPo battery. Research and answer the following questions:

  • What is a LiPo battery?

  • What does 4S and 2P mean?

  • What is the nominal voltage of a 4s LiPo battery? How about the minimum and maximum voltage?

  • What is state of charge (SoC)?

  • How does the voltage of a LiPo battery vary based on it’s state of charge?

RPP stands for Reverse Polarity Protection. For this circuit, reverse polarity protection is implemented using a P-channel MOSFET. Research and answer the following questions:

  • What is reverse polarity protection?

  • What are basic ways of implementing reverse polarity protection?

  • What is a MOSFET?

  • What is a P-channel MOSFET? How about an N-channel MOSFET?

  • Symbolically, how does a P-channel MOSFET differ from an N-channel MOSFET?

Is the MOSFET present in this circuit a P-channel MOSFET? If not, is there a MOSFET you can use from our schematic library? If so, use it. Research and answer the following questions:

  • In the circuit which you now fixed, what happens when you connect the terminals of the battery correctly? That is, what happens when the battery’s positive terminal connects to BUS_UNPROTECTED and when its negative terminal connects to GND?

  • In the circuit which you now fixed, what happens when you connect the terminals of the battery incorrectly? That is, what happens when the battery’s positive terminal connects to GND and when its negative terminal connects to BUS_UNPROTECTED?

  • Does the behavior of this circuit in the two cases above support the implementation of reverse polarity protection?

  • Enrichment: For applications with higher battery voltages, it may be difficult to find good P-channel MOSFETs with a high enough maximum gate-to-source voltage. What can be done to modify this circuit using this exact P-channel MOSFET so that it can support a 12s LiPo battery? (Hint: An answer lies in the use of Zener diodes)

Reverse polarity protection is great, when you accidentally connect your battery incorrectly, your PCB won’t set aflame and smoke away. Not all embedded systems will need reverse polarity protection if there is no need to protect a circuit from being connected incorrectly. You may ask, why not just implement it incase?

The answer lies in issues of power losses and more specifically, efficiency. Research and answer the following questions:

  • What is the drain-to-source on-state resistance of a MOSFET?

  • What type of power loss does this characteristic contribute to? (conduction or switching loss)

  • For the P-channel MOSFET you have implemented in your circuit, what is it’s drain-to-source on-state resistance? Use the closest value for Vgs to our application.

  • If the entire system draws 3A, how much power is lost through this P-channel MOSFET? What about 40A? (Note the equation below)

  • Perhaps my selection of a P-channel MOSFET is subpar in terms of power loss. Source a better one on Digi-Key and replace it with mine. Do not forget to also create it’s PCB footprint. Calculate the new value of conduction loss.

  • Enrichment: How can you calculate the corresponding temperature rise given an amount of power loss? Visit the datasheet of the component to find these characteristics.

Bus Current Sense

Current sense circuits are implemented whenever an embedded system wishes to use current consumption as a metric for analysis. For example, current sense may be useful for estimating battery state of charge if the capacity of a battery is known. This circuit contains a current sense resistor, a current sense amplifier, and a low-pass filter to attenuate noise along the output of this analog signal.

Before approaching this sub-circuit, research and answer the following questions regarding op-amps:

  • What is an op-amp?

  • What is the gain of an op-amp? How large is the open-loop gain of an op-amp typically?

  • What two terminals of an op-amp are typically not shown on a schematic? How do they impact output saturation voltages?

  • What happens when the calculated output voltage of an op-amp exceeds the upper and lower saturation voltages?

  • What is a differential amplifier? What is it’s gain?

Current Sense Resistor

Research and answer the following questions:

  • How large should the value of current sense resistors generally be? What is wrong with the resistance of the given current sense resistor? Fix it accordingly.

  • With your fixed current sense resistor, calculate the amount of conduction loss generated from sensing 3A of current.

Current Sense Amplifier

Continuing onwards, research and answer the following questions:

  • What is current sense and how is it implemented?

  • What is a current sense amplifier (CSA)? What two types of op-amp circuits does it embody?

  • What is the MPN of the IC used for this current sense amplifier? What are pins 2 and 5 for?

  • The datasheet recommends the placement of a decoupling capacitor across pins 2 and 5. What is a decoupling capacitor and why do you think it is needed here? Is the decoupling capacitor implemented correctly? Fix it accordingly. From a PCB design perspective, how should decoupling capacitors be placed?

Let us now verify that terminals of the current sense resistor are connected to the CSA appropriately. Answer the following questions:

  • Which way does current flow across the current sense resistor? In what direction is the voltage drop subjected across the resistor pointed in?

  • The calculated output voltage of the CSA is given by:

What is the calculated op-amp voltage if the current flowing through the current sense resistor is 3A? (use Ohm’s law). Does the output voltage saturate to any of the voltage rails? If so, which one? Reconnect the CSA to the terminals of the resistor correctly.

Let us take a step back and analyze what is happening in this circuit. Current flows through the current sense resistor, inducing a voltage difference across it. The voltage difference is sensed by the non-inverting and inverting terminals of the CSA and then scaled by a gain value given in the CSA’s datasheet. The output voltage of the CSA is thus proportional to the sensed voltage difference, but within the bounds of the upper and lower saturation voltages.

This output voltage is analog and is intended to be connected to an analog input of an MCU. Research and answer the following questions:

  • What is an ADC and how does it work?

  • What does the bit resolution of an ADC specify? If an ADC pin has a resolution of 8-bits, how many different values can the input voltage to the ADC take on?

  • If the ADC has 8-bit resolution and a voltage range between 0V and 3.3V, what would the expected value digital value for 3A of sensed current if 0A maps to a digital value of 0?

  • Enrichment: How can this circuit be improved in terms of precision? Implement a CSA under the same family of products from TI which improves this precision issue.

  • Enrichment: What are the tradeoffs between selecting a larger or smaller current sense resistor and a CSA with larger or smaller gain.

RC Low-Pass Filter

Let us now take a look at the low-pass filter along the output of the CSA. Note that mathematically, a single signal can be constructed from multiple components with difference frequencies. In practical applications of circuits, signals are riddled with noise which may affect precision if relevant. Research and answer the following questions:

  • What is signal noise? What frequencies of signals are typically associated with noise?

  • In what ways are signal noises increased?

  • What is EMI?

  • How can signal noise be improved from a hardware implementation standpoint? What about a PCB design standpoint?

A first-order RC low-pass filter generally looks like this:

Is the low-pass filter implemented correctly? If not, fix it accordingly. Research and answer the following questions:

  • What is impedance? (Note that the angular frequency of a signal is related to it’s frequency by the following relationship:

  • What is the equation for the impedance of a capacitor?

  • Assuming the lower node of the circuit above is connected to ground, what is the output of the circuit if the input signal is at DC steady-state? What about if the input signal is at an infinitely high frequency? How does this behavior coin the name low-pass filter?

  • What is the cutoff frequency of a low-pass filter? For the RC low-pass filter above, what is the equation for the cutoff frequency in terms of R and C?

  • For the RC low-pass filter, what happens to signals with frequencies lower than the cutoff frequency? What happens to signals with frequencies higher than the cutoff frequency?

  • What is the cutoff frequency of the RC low-pass filter above? Does it eliminate noise? If not, tweak the values of the resistor so that it does.

Let us take a step back and analyze what is happening with the RC low-pass filter. Any signal components with frequencies less than the specified cut-off frequency will happily pass through to the output. Any signal components with frequencies greater than the specified cut-off frequency will be attenuated. By creating an RC low-pass filter with a cutoff frequency slightly lower than the frequency signature of noise, any noise along the signal will be attenuated when passed through the low-pass filter.

Voltage Sense

Voltage sensing is implemented using a voltage divider. For this particular case, it is used to sense the input battery voltage.

The equation for a voltage divider is given by:

As with the current sense circuit, the output of this circuit is an analog signal which is connected to an analog input pin of the MCU. Note that the analog input pins of the MCU have a range of 0V to 3.3V. The battery voltage is thus scaled down with the voltage divider so that it can be connected to the MCU. This circuit is intended to scale the maximum 4s voltage of approximately 14.8V to roughly 3V.

  • Determine the output voltage given the resistors present in the circuit. Is the output roughly 3V? If not, use appropriate top and bottom resistors to achieve this goal.

  • Enrichment: Voltage dividers are susceptible to loading. What is the loading effect? How should loading be considered when using a voltage divider?

4s-3.3V @ 2A Max. Buck Converter

Voltage regulators are used to provide power to different devices in an embedded system with different source voltage requirements. In this PCB, a step-down converter known as a buck converter is used to convert the LiPo battery voltage to 3.3V with a given amount of current to power the MCU and current sense amplifier. Buck converters are arguably one of the most used circuits in embedded electronics. The use of voltage regulators allows us to define the power architecture of an embedded system.

It appears that there is something wrong with the header. Please answer the following questions:

  • What is a voltage regulator? What are the two main types of voltage regulators?

  • What type of voltage regulator is a buck converter?

  • What is an asynchronous buck converter? What is a synchronous buck converter? How do they differ?

  • How should the header be changed to reflect the actual intended circuit being used?

Buck converters are a very dense topic, please watch the following resources to become semi-acquainted with the workings of a buck converter:

Find the datasheet for the buck converter being used. With attention and care, try to correct the design of this circuit yourself (this means doing calculations and sourcing the best components). As aspiring electrical engineers, an important skill is being able to read datasheets in order to implement your own design. The Typical Application selection will provide great insight into what calculations you will need to perform in order to construct your buck converter.

Remember to make note of the following parameters:

  • Input Voltage: 4s LiPo battery voltage (dependent on state of charge and therefore has a range)

  • Output Voltage: 3.3V

  • Max Output Current: 2A

 

If you made it to this point, you are now finished with the current version of the Bootcamp. Ping Daniel Puratich and Ethan Abraham on Discord to have it reviewed. Then, you will be able to get started with your first electrical task!

Altium Designer Keybinds/Shortcuts/Helpful Tips

Here is a list of useful keybinds, shortcuts, and tips for navigating and using Altium Designer. Existing members are highly encouraged to contribute to this list!

  • Ctrl + Mousewheel: Zoom in and out of various files