-
Motor Controller Software and Circuit for Dyson Vacuum Cleaner Motors
03/13/2024 at 16:43 • 0 comments
Dyson V6 Setup and Running SystemDyson handheld vacuum cleaners utilize high RPM brushless DC motors. Specifications indicate that some models can reach as high as 125000 RPM. I’ve disassembled DC56(V2), V6, and V10 models. Each has a brushless single-phase motor, with differing number of poles: two for the DC56, four for the V6, and eight for the V10. An earlier article about their DC56(V2) motor hinted that besides the mechanical design, the controlling software is the key. The electronics are relatively straightforward, including an H-bridge driver, microcontroller, and hall effect sensor. I’ve taken up the task and developed my own software to match Dyson’s factory performance. My software could potentially be used with all their brushless motors. The components I utilized include an Arduino Uno (8-bit ATmega328P microcontroller), H-bridge controller, and a hall effect sensor. Despite Dyson V10 employing a 32-bit ARM micro-controller, I managed to control it using an 8-bit Arduino, which is cheaper component.
V6 Setup
V10 Setup
1. Hall Effect Sensor
I reused the hall effect sensor from the original control board, but it can also be sourced from retailers such as Digikey, Adafruit, or Sparkfun. This sensor requires a pull-up resistor (~5k ohm) at the output pin.
Hall Effect Sensor Pinout
2. H-Bridge Driver
Several H-Bridge options are available on the market, but considering these beasts can consume ~500 watts, it’s preferable to choose robust ones. I bought H-Bridge with BTN8982TA from Digikey and BTS7960B 43A in Amazon. The former proved more reliable and also comes as an Arduino shield, making wiring simpler. The user manual for BTN8982TA board is here.
3. Powersupply
A power supply capable of delivering 25V at a minimum of 600 watts is necessary.
4. Control Software
The software consists of one GPIO interrupt for the hall effect sensor and two timer interrupts for control loop and pulse length measurement. My initial approach was straightforward: each time the hall effect sensor detected a rising or falling edge, I switched the current direction on the H-bridge driver. This approach allowed me to achieve 60000 RPM with no issues, but higher RPMs were unattainable. Here is my scope capture of V6 motor with this approach.H-Bridge Forward and Backward Current Control
The Scope Capture of the Simple Controlling Approach
Upon observing that enabling the H-bridge before the hall effect sensor’s rising/falling edge boosted speed, this is because the hall effect sensor’s location with respect to the coils. I introduced an adjustable time offset from the previous hall effect sensor edge and enabled H-bridge after this offset. The system remains a closed-loop controlled by the hall effect sensor, however the pulse width control loop is phase-shifted. Now, it is time to reduce pulse width to achieve higher RPMs. A new challenge emerged in getting the minimum pulse width, the timer interrupt service routine measuring pulse durations couldn’t be reduced after some point even when I set the minimum timer period. The problem was the Arduino library digitalWrite(.)/digitalRead(.) functions, which take tens of instruction cycles. I switched to direct GPIO port access to minimize latency in setting GPIOs.
Direct GPIO Port Access Compiled Assembly Code:
PORTD |= 0b00001000; 4ae: 5b 9a sbi 0x0b, 3 ; 11
Arduino Library digitalWrite(.) Compiled Assembly Code:
void digitalWrite(uint8_t pin, uint8_t val) { uint8_t timer = digitalPinToTimer(pin); 476: e5 e7 ldi r30, 0x75 ; 117 478: f0 e0 ldi r31, 0x00 ; 0 47a: 84 91 lpm r24, Z uint8_t bit = digitalPinToBitMask(pin); 47c: e1 eb ldi r30, 0xB1 ; 177 47e: f0 e0 ldi r31, 0x00 ; 0 480: d4 91 lpm r29, Z uint8_t port = digitalPinToPort(pin); 482: ed e9 ldi r30, 0x9D ; 157 484: f0 e0 ldi r31, 0x00 ; 0 486: c4 91 lpm r28, Z volatile uint8_t *out; if (port == NOT_A_PIN) return; 488: cc 23 and r28, r28 48a:...
Read more