Skip to content

7 ‐ Hardware Guide

cbarkows edited this page Aug 28, 2023 · 6 revisions

This page contains hardware information gathered and compiled by Logan Barkowsky.

Throughout ECE 3311, many basic circuit elements will be used to interface sensors with the supplied FPGA, convert signals, and create circuits that will allow the student to complete the assigned project. Among the most common electronic components used in Project Lab to create proprietary circuits are the comparator, optocoupler, voltage regulator, and the resistor. Along with creating circuits and basic electronic PCBs, the students will use some supplied electronics, mainly a Digilent BASYS 3 FPGA Board and the TTU H-Bridge circuit. This section will cover how to use some basic electronic components, how to create basic prototype circuit boards, how the supplied materials work, along with some basic concepts that will help the student create a more polished and powerful project through their semester in the ECE Robotics Project Lab.

Contents:

  1. Supplied Components
    1. Basic Motor Control
    2. TTU H-Bridge Circuit
    3. Digilent BASYS 3 FPGA
  2. Basic Circuit Components
    1. Comparators
    2. Optocouplers
    3. Resistors, Fuses, and Overcurrent Protection

Supplied Components

For project lab 1, Texas Tech will supply the student with 2 major components that will be inspected in depth here at the hardware level for them to be utilized effectively. Those two components are a TTU Dual H-Bridge circuit that allows you to facilitate the speed and direction of two DC motors and the Digilent BASYS 3 FPGA Board that will serve as the controller to all peripheral devices included in each student group’s solution to their assigned project. We will first discuss the H-Bridge and its role in facilitating motor operation.

HBRIDGE BASYS3

Digilentinc.com. “Basys 3 FPGA Board Reference Manual,” https://digilent.com/reference/_media/reference/programmable-logic/basys-3/basys3_rm.pdf, July 10, 2019.

Basic Motor Control

Within ECE 3311, motor control is an essential skill that every other facet of the project depends upon. There are several basic components to motor control in project lab 1 that must be addressed before the student dives headfirst into their attempts at making the rover move. There is also an ever-present danger of blowing the motors if too much voltage is supplied, so there must be caution applied when driving the motors with a DC power supply, or a signal generator. To be safe, limit the maximum voltage applied to the motors to 13 V, this is comparable to a fully charged 11.1 V lithium-ion battery being wired directly to the motors. In reality, the TTU H-Bridge has protections against overvoltage that will be discussed later.

The supplied rover chassis has two DC motors integrated with a protective inductor in series between each DC motor and the H-Bridge. When a DC motor makes any change in direction or speed, or is rotated by the user without power, it generates a return current that can harm the electronics controlling it. The inductor in series resists that return current and protects the controlling electronics. There is no need to worry about the inductor resisting the current being sent to the motor, as it is in its steady state after a very small amount of time, and acts much like a straight wire. There is also a small coupling capacitor wired in parallel between the H-Bridge and each motor that serves to smooth the signal applied to the DC motor. This capacitor holds a very small amount of electric potential that can be rapidly discharged upon an inconsistency in the signal. This makes the motor run smoother, consistently, and with slight delays in signal input. Despite this delay in signal input, there is not any true compensation that must be made to speed up the signal in the context of ECE 3311. Within the supplied rover chassis, the inductor is visible as a small black cylinder that is spliced into one of the two wires leading to the DC motor housing. The coupling capacitor is not visible, as it is small enough to be tucked into the motor housing.

The direction a DC motor spins is dependent on the polarity of the signal applied. Most DC motors have pigtails or leads extending from their contact points that are different colors, in the case of ECE 3311, they are red and black. When the power is applied to the red wire, and ground is applied to the black wire, this will spin the motor and drive the rover forward. To reverse the rover, the polarity can be switched. The facilitator of this is the TTU L298 Dual H-Bridge Circuit that interfaces with the BASYS 3 FPGA and allows the polarity of the signal to be changed based upon which input pins are made high.

image
Photo Reference: https://www.sparkfun.com/datasheets/Robotics/L298_H_Bridge.pdf

To effectively control the speed of a DC motor, a concept called pulse width modulation (PWM) (also known as pulse duration modulation (PDM)) must be understood and applied. When applying a constant DC signal to a DC motor, a smaller voltage applied will result in a slower speed, but it also results in the motor’s torque capabilities being neutered as speed and voltage decrease, making voltage or power modulation an ineffective method in motor control. To counteract this, PWM is applied, which allows the speed of the motor to be modulated while maintaining most of the torque capabilities of the motor. Simply, PWM is rapidly switching the signal from 100% to 0% at a certain switching frequency. This signal, when visualized, is a square wave with a period spanning an amount of time set by the user. Within this period, a duty cycle is applied, which is the proportion of the period that the signal is high. This duty cycle controls the speed of the motor. At 100% duty cycle, there is not any low point in the signal, and the signal being sent to the motor is a constant high, whereas at 0% duty cycle, there is not any high point in the signal, and the signal being sent is a constant low. In the middle, at 50%, the signal is high for half of the period, and low for the rest of the period. Since the BASYS 3 FPGA can only output a 3.3V signal, the h-bridge circuit is used to facilitate a stronger PWM signal and change direction of the motor.

Picture1
Photo Reference: https://www.globalspec.com/reference/8272/348308/3-8-3-pulse-width-modulation

TTU Dual H-Bridge Circuit

The TTU H-Bridge Circuit is a system that allows comprehensive control, quick diagnosis, and simple operation of two DC motors using the Digilent BASYS 3 FPGA Board. To begin understanding the TTU H-Bridge Circuit, the fundamental h-bridge motor driver circuit must be explained. The simplest h-bridge motor driver is a circuit that consists of 4 switching elements, 4 catch diodes, and a single DC motor. The job of an h-bridge is to facilitate the delivery of a PWM signal to a DC motor to vary its speed and direction. It does this by controlling the path of the current through the motor. A clear circuit diagram and graphic of the traces on the PCB will be released later. For more information on general h-bridge circuits, see this article.

Pictured below is a simple setup with a Digilent Basys 3 board connected to the Dual H-Bridge Driver supplied by Texas Tech ECE. It is configured to run a single motor with the control pins wired to the JA PMOD header on the Basys. SNS A and GND, which are current monitoring outputs from the L298 (featured in the second photo), are connected to the JX PMOD header to monitor the current flowing through the motor for current control purposes. See the tutorial on setting up the Basys's onboard ADC for current control if you want more information on those pins.

PXL_20230205_211451287 PXL_20230206_005229792

Digilent Basys 3 FPGA

The Digilent BASYS 3 falls into the class of field programmable gate arrays, more commonly referred to as FPGAs, and allows the user to use a hardware description language to configure the board to perform the desired functions. FPGAs contain an array of programmable logic blocks as well as a hierarchy of reconfigurable interconnections that allow these blocks to be strung together. If you would like to read more about what an FPGA is or how they are used, visit the Wikipedia Page. The Basys 3 Reference Manual by Digilent is the main resource for understanding the Basys 3.

Nautilus Team

More About This Group

Logan Barkowsky

Brett Fiscbuch

Clone this wiki locally