NEVC-MCTRL-100-t01: Trapezoidal control of brushless DC (BLDC) motors using hall effect sensors firmware for NEVB-MCTRL-100
This project is focused on the implementation of motor control, specifically designed for Brushless DC (BLDC) motors using Hall Effect sensors on the LEONARDO board or the ATMEGA32u4 micro controller, platforms widely recognized under the Arduino Leonardo nomenclature when operated through the Arduino IDE.
This code is compatible with Nexperia's Motor evaluation kit NEVB-MCTRL-100-01-3INV-001-01, which includes the following components:
- Motor Controller Board (NEVB-MCTRL-001-01): The central unit for motor control operations.
- 3-Phase Inverter Board (NEVB-3INV-001-01): Facilitates the conversion of DC to AC power for the motor.
- Leonardo R3 Development Board: Acts as the core micro controller platform for the system.
- 3-Phase BLDC Motor with Hall Sensors (42BLS40-24-01): The motor that is directly controlled by the system.
- Additional screws, plugs, and tools necessary for setup and operation.
To fully understand the system's capabilities and limitations, and for detailed instructions on setting up the kit, please refer to the accompanying user manual. This repository focuses on providing the code documentation and the essential software to be uploaded to the Leonardo development board for use with the above-mentioned hardware.
To adapt and utilize this code for specific requirements, please review the 'todo' section of the documentation. This section outlines the expected user modifications to tailor the software to individual needs. The default settings in the code are optimized for the motor included in the kit, ensuring a smooth start-up and operation for new users.
The code is dependent on SCPI Parser Arduino
Library which is a port by
Scott Feister to the Arduino platform of the SCPI Parser Library
v2 by Jan Breuer. This
dependency is provided in the source code underneath the main/src/
directory
accompanied with its own license (BSD 2-Clause License). Please read through the
LICENSE file in the dependency directory for more information. The library has
also been modified to specifically support the needs of this project.
The official documentation is hosted on https://nexperia.github.io/NEVC-MCTRL-100-t01/.
Download and install Doxygen (1.9.7 or newer) or use package managers like apt or brew for Linux or macOS.
# For Ubuntu/Debian
sudo apt-get install doxygen
# For macOS
brew install doxygen
Optionally, download Graphviz or use package manager
commands to install. Doxygen can generate graphical class hierarchy diagrams if
Graphviz is installed. Alternatively, you can disable the use of dot tool for
generating graphs in the Doxyfile
by setting the option HAVE_DOT
.
HAVE_DOT = NO
The theme for the documentation is in the docs/theme/
directory but is it
not in the file tree, then need to be cloned from the git repository as a
submodule by using the commands:
git submodule init
git submodule update
Once the Doxygen is installed, run the following command to generate the documentation:
doxygen ./Doxyfile
This command will process the source code based on the configurations in the
Doxyfile and generate documentation files in the specified output directory
which should be docs/html/
.
To use this project, Arduino drivers need to be installed. They can be installed separately or together with the installation of Arduino IDE v1 or v2.
If using Visual Studio Code, please bear in mind the Arduino extension must also
be installed and the .vscode/c_cpp_properties.json
configuration file must be
set up correctly for Intellisense to work properly. If Arduino v1 is installed,
run the PowerShell script create_cpp_properties.ps1
(for Windows) or Bash
script create_cpp_properties.sh
(for Linux) and this takes care of setting up
the configuration file.
-
Upload main.ino:
- Open file in the editor of choice and upload main.ino to a compatible micro controller.
- This code is optimized for the Arduino Leonardo (LEONARDO board or ATMEGA32u4 micro controller), but it might be customized to be compatible with other Arduino boards.
-
Refer to the User Manual for setting up the kit:
- Before powering on the system, it's essential to refer to the user manual for specific setup instructions related to the Nexperia's Motor evaluation kit.
- The manual provides critical information on how to properly configure and prepare the system for operation.
-
Power On the System:
- After ensuring that the setup is in accordance with the manual, power on the system.
- The motor control program will start, enabling the control and operation of the BLDC motor using the Hall Effect sensors.
-
Motor Handling: Ensure that the motor is securely clamped down and cannot move unexpectedly during operation. This is crucial to prevent any accidents or damage to the system.
-
Operating Ranges: Verify that the motor's intended operating ranges (voltage, current, speed, etc.) are supported by your setup. Operating the motor outside its specified limits can lead to malfunction or damage.
-
Power Isolation: Implement appropriate measures to quickly and safely isolate the power to the system if needed. This might include emergency stop mechanisms or easily accessible power switches.
-
General Safety: Always take reasonable safety precautions when handling electronic components. This includes wearing protective gear as necessary, ensuring a tidy and organized workspace, and being cautious of potential electrical hazards.
Contributions to this project are welcome. To contribute:
- Fork the repository.
- Create a new branch for your feature or fix.
- Commit your changes.
- Push to your branch and submit a pull request.
This project is licensed under the MIT/X Consortium License, a permissive free software license. For more details on the MIT/X Consortium License, please refer to the LICENSE file included in this repository.