Week 9
Group Assignment
For the group assignment this week, I worked with Sara to measure the power consumption of a stepper motor and a DC motor. Our work is documented on the section page.
Goal
This week is the first week I have a final project idea that I’m excited to work towards.
A key part of this project will be 2 motors.
Motors are not something I have a ton of experience with yet,
so this is the week to learn how to make something with motors.
In particular, I decided to learn about Brushless DC Motors (BLDCs)
using the QWinOut A2212 1000KV Brushless Outrunner Motor 13T
and the A4949 Three Phase Sensorless Sinusoidal Fan Driver from the inventory.
(I addressed two other kinds in the group assignment.)
Board design
The boards I had in hand so far were:
qpad-xiaofrom Week 3qpad21from Week 3AVRXXDUXX_eval_boardfrom Weeks 5 and 6mini_qpadfrom Week 8
I could’ve made a board with just the A4949 and plugged it into one of the board above. But after burning most of Week 8 on connectors, I had lost my appetite for hacking connections together - especially with higher voltages at play. So, I made a new board. To try something new, I used the SP32S3 XIAO this time around.
For the schematic,
I worked off of the 4949 application note.
I added VREF to one of the ADC pins just to monitor if needed.
My design is shown below:

Figure 1
I did not want to do anything fancy with connectors this time. My layout is shown below:

Figure 2
Board fabrication
Board fabrication was totally painless. The only hitch was that we had initially ran out of single-sided FR1. I tried the double-sided stock we had, but it seems that the copper was a little thicker, and the default mods settings didn’t cut all the way through:

Figure 3
I unfortunately did not find time to debug this issue further. Quentin delivered new one-sided FR1 stock, and that worked right away.

Figure 4
Without any fancy connectors, assembly was no problem at all.
Testing Setup
I wrote and uploaded a simple program to let me set the duty cycle:
void setup() {
Serial.begin(115200);
pinMode(D10, OUTPUT);
pinMode(LED_BUILTIN, OUTPUT);
pinMode(D8, INPUT);
pinMode(D9, INPUT);
}
void loop() {
int value;
while (Serial.available() > 0) {
value = Serial.parseInt();
if (Serial.read() == '\n') {
value = constrain(value, 0, 255);
analogWrite(D10, value);
analogWrite(LED_BUILTIN, value);
Serial.println(value);
}
}
}(tracked here: https://gitlab.cba.mit.edu/dimitar/kitchen-sink/-/blob/main/bldc_tester_script/bldc_tester_script.ino.)
I connected the motor and a benchtop power supply using E-Z-Hooks:

Figure 5
Results
I then played with both the PWM duty cycle and the voltage. As expected, both a higher voltage and a higher duty cycle result in a higher motor speed:
The A4949 supports up to 18V, but (at maximum duty cycle), the motor seizes up at about 9V (though it is rated to 10V):
The A4949 reports operation by toggling the state of the FG pin on and off each motor cycle. (It’s an open drain pin, so it actually toggles between ground and floating; I added a pullup to VREF, as recommended, which I confirmed to be 3.3V.) I set the voltage to 6V and varied the duty cycles in steps of 12.5%, recording the waveform both into the PWM pin and out of the FB pin. I then extracted duty cycle and RPM from the waveforms. The results are shown below:

Figure 7
The noise at the start is an effect of 1) the motor not starting up at low duty cycles and 2) me touching the test setup. After that, the RPM is proportional to the duty cycle. I also monitored the voltage at VREF during the test, and found it to be very stable (within 60mV):

Figure 8