Question
Brushless DC Motor Control, Simulator Use 2.1 Overview This laboratory introduces the use of the debugger/simulator within Microchip Studio and covers certain aspects of driving
Brushless DC Motor Control, Simulator Use
2.1 Overview
This laboratory introduces the use of the debugger/simulator within Microchip Studio and
covers certain aspects of driving brushless dc motors (BLDC). A C program will be designed
for the ATmega328P microcontroller to accept a three-bit binary number representing the
state of the BLDC motor controller and output a three-bit output that is designed to smoothly
drive a BLDC motor. Simulations will be performed, showing each input possibility and the
corresponding output.
2.2 Objectives
At the conclusion of this lab, the student should be able to:
1. Demonstrate proficiency in the use of the debugger/simulator tool within the
Microchip Studio software package.
2. Create a design based on the requirements.
3. Use general-purpose input/output (GPIO) pins of the microcontroller.
4. Present the results from the use of the debugger/simulator in an understandable
fashion, which demonstrate the design's adherence to strict requirements.
2.3 Background
2.3.1 BLDC motors
A typical brushless dc motor (electronically commutated motor, ECM) consists of three
electromagnetic coils. The rotor of this motor contains a permanent magnet, which is either
attracted to or repelled from the coils depending on whether or not they are energized. In this
motor configuration, the rotor spins, while the coils remain stationary. A highly simplified
diagram of the motor coils is given in Fig. 2.1.
Figure 2.1: Simplified BLDC motor configuration diagram.
ELCE 300 • MICROPROCESSOR SYSTEMS LABORATORY MANUAL SPRING 2021
2
By pulsing each of the coils in sequence (i.e., 1, 2, 3, 1, etc), it is possible to make the
permanent magnet of the rotor spin. The higher the frequency of the transitions, the higher
the number of revolutions per minute (RPM).
Electrically, the coils are connected in a fashion similar to Fig. 2.2. The common terminal
provides a connection to one side of the coil, while the other three terminals are connected to
the individual coils.
Figure 2.2: Circuit diagram of coil connections.
Each coil has an impedance Z (which can be thought of as the resistance). Suppose that the
impedance of the connection between Coil 1 and Common is Z. If the impedance between
the terminals for Coil 1 and Coil 2 were to be measured, the total measured impedance would
be 2Z. This is one way of determining the function of each pin of the BLDC motor:
exhaustively measure the resistance between each pin and the connections with the least
resistance would indicate a common-to-coil connection).
The signals output by the control board of a hard drive are shown in Fig. 2.3. These signals
are used to drive the hard drive BLDC motor.
Figure 2.3: BLDC controller board signals.
Overlapping pulses make the BLDC motor vibrate less, as the permanent rotor magnet does
not have to make huge jumps from one coil to the next—the transition is gradual. In addition,
this gives the motor the ability to self-start, without outside intervention.
The high-frequency transitions from 0 to 1 and back are implemented as a power-saving
measure—the inertia of the motor rotor will keep the motor spinning, allowing the control
board to deliver the least power possible.
BLDC motors are also used to propel electrically-powered RC aircraft (along with a PWM
controller, which translates the PWM signal into the pulses required to spin the motor).
ELCE 300 • MICROPROCESSOR SYSTEMS LABORATORY MANUAL SPRING 2021
3
2.4 Laboratory
Assume that Fig. 2.4 represents the output signals in a six-state motor controller for brushless
dc motors. The laboratory design will be based on this figure.
Figure 2.4: BLDC controller states.
The motor controller will have a three-bit input (the ``state''), where a binary 000 will
correspond to State 0, whereas 101 will correspond to State 5. In addition, there will be a
three-bit output. As an example, the output in State 2 will be 110 (refer to the figure above).
Given this information, complete the table below (please include the completed table as part
of your deliverables).
Table 2.1: BLDC controller states (input vs. output).
Controller
State
Input Output
[2] [1] [0] [2] [1] [0]
State 0 0 0 0 1 0 1
State 1 0 0 1
State 2
State 3
State 4
State 5
Now, knowing what you know, design a controller (by writing a microcontroller program in
the C language) using the ATmega328P device that will use PORTD for the input and
output. Note that pins PORTD7, PORTD6, and PORTD5 should be used for inputs [2], [1],
and [0], respectively, while pins PORTD4, PORTD3, and PORT2 will be used for outputs
[2], [1], and [0], respectively.
Note that the functionality of the device should be as follows: if 000 is input, the outputs
should show 101 across the output pins. Design your controller based on the table above.
ELCE 300 • MICROPROCESSOR SYSTEMS LABORATORY MANUAL SPRING 2021
4
The pinout diagram of the ATmega328P is given in Fig. 2.5, for reference purposes.
Figure 2.5: Pinout for the ATmega328P evaluation board.
Note the location of PORTD (PD7..0).
Remember, you have to set the DDRD (the data direction register for PORTD) to the
appropriate values, in order to treat certain pins as outputs or inputs! Also, you may want to
experiment with the ``if'' statement and the concepts that were covered in Lecture 03 of the
class (bit masking, etc.).
Provide screenshots of the debugger/simulation of the input/output functionality for every
combination in Table 2.1.
2.5 Deliverables
At the conclusion of the laboratory, please turn in the following as a single PDF file in
Moodle:
• Completed Table 2.1.
• Microcontroller code that is properly annotated with descriptive comments. The code
should contain enough comments that would make your code understandable to
someone is who is not familiar with it. Please don't forget to include the header with
your name, ID number, class, and due date (don't forget the comments sheet!).
• Screenshots of the debugger running the code (and the input/output window showing
the values of PORTD). There should be at least six screenshots – one for each state –
that demonstrate the functionality of the device.
coils[2] coils[1] coils[0] State 0 SI S2 83 S4 Figure 2.4: BLDC controller states. GENE STRZES S5 The pinout diagram of the ATmega328P is given in Fig. 2.5, for reference purposes. Atmel AVR Jessel 00-0 O at CLETAD GETULES B CUCES Figure 2.5: Pinout for the ATmega328P evaluation board. Note the location of PORTD (PD7.0). Table 2.1: BLDC controller states (input vs. output). Input Output [2] [1] [0] [2] [1] [0] 0 1 0 0 1 Controller State State 0 State 1 State 2 State 3 State 4 State 5 0 01
Step by Step Solution
3.44 Rating (160 Votes )
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started