Close

Brushless DC Motor Controller

A project log for Open Source CPAP Machine

A Open Source Approach to a CPAP machine to address the current issues of affordability and access

cdankocsikcdankocsik 01/07/2023 at 17:070 Comments

One of the main functionalities of the CPAP machine will be to control a Brushless DC motor as they are able to generate high amounts of torque necessary to create the desired air pressures for the treatment. To address this I am making a motor driver board which will additionally be open source as well. I currently have the phase diagrams mapped out indicating the position of the shaft at a given position and a basic 3 Phase motor driver working as well. (Note this setup utilizes Hall effect sensors for indicating the shaft position and not back EMF, though in the future I plan on making one for that type of setup as well)


 Now all that's left is to synchronize the two so the motor can know when to activate the proper coils at the proper times and additionally allow our control algorithm once its developed to control the machine's air pressure.


I'm currently utilizing the ESP32 for hardware control and utilizing the Project IO dev environment in visual studio code for doing all my software development. All the code is still completely usable in the Arduino IDE if that's your preference though the necessary libraries will need to be added.

Phase Diagram
Basic Layout of what Coil arragnment needs to be turned on at each appropate sensor readout. Will upload something more comprehensive once fully completed
CPAP Motor
3 Phase Motor Driver V1
Havent added the comparators for the Hall effect sensors yet but will upload a photo when I get that done along with a schmeatic
3 Phaes Motor driver Breadboard Prototyping
CPAP Motor Insides

Discussions