**1 Generate motor control code from MBDT**
This issue is also part of the MBDT (Model-Based Design Tools) Getting Started section, which focuses on advanced motor control algorithms. Motor control is very suitable for model-based design (MBD) exercises.
MBDT has many motor control example models, which can generate code directly, and provides a configured FreeMASTER project, which can view Hall signals, current, voltage and other information. As shown in the figure below, double-click to open and view the model.
Example Models for Motor Control Provided by MBDT - From autoMBD
In order not to damage the original model, it is not recommended to open the model from the library. The following takes the MBDT sample project BLDC_ClosedLoop_s32k144.mdl as an example to show how to use MBDT to generate and run the motor control algorithm. The hardware used is MCSPTE1AK144.
Find the directory location of the example model BLDC_ClosedLoop_s32k144.mdl and copy the entire directory to a suitable location. By default, the location of the example model is in this directory:
MBDT example model location path - From autoMBD
The first part of the path may be different due to the different installation locations and computer configurations, so be careful to distinguish. Then put the MATLAB workspace to the location you copied, and open the BLDC_ClosedLoop_s32k144.mdl model:
Open the example model - From autoMBD
It is important to note that the original MBDT BLDC_ClosedLoop_s32k144.mdl model configuration is a bit wrong and needs to be modified. The pin configuration of Hall A and Hall B in the original model needs to be modified to the following configuration:
-
Hall A: PTD11 changed to PTA15
-
Hall B: PTD10 changed to PTA16
Modify Hall A/B reference - From autoMBD
The specific modification basis can be found in the schematic diagram of S324144EVB. Here is a screenshot for readers' reference:
Hall A/B Circuit Diagram - From autoMBD
It can be seen that PTD11 and PTD10 are in DNP (Do Not Populate) status and cannot be used. PTA15 and PTA16 can be used.
At this point, the basics of MBDT are complete. Readers can also view other example models and try to generate code and run them themselves, which will give them a deeper understanding of MBD.
The motor control model has a certain degree of complexity and richness. Carefully reading how the model is built can help you understand many MBD development methods, including the construction of state machines, event control, algorithm implementation, etc.
2 Use of MC DevKits
NXP also provides a pure code motor control solution, which is briefly introduced here as a comparison with MBDT.
You can download the software for MCSPTE1AK144 for free on the NXP official website, or you can find it in the resources of the official account. Reply to the keyword "MBDT" in the dialog box to receive resource information.
MC DevKits - From autoMBD
Double-click to start the installation. If you use the default installation (default installation is strongly recommended), you can find four projects in this location:
Four projects of MC DevKits - From autoMBD
These four projects can be directly compiled and downloaded in S32 Design Studio for ARM Version 2.2 (S32DS). At the same time, the project also provides the MCAT real-time debugging tool based on FreeMASTER, which is more powerful than the motor control model of MBDT and can be used for sensorless algorithms or motor control algorithms with FreeRTOS.
Take MCSPTE1AK144_PMSM_FOC_2Sh as an example
If you are not a computer major and have never been exposed to embedded development, it may take a long time to understand how these projects work. In comparison, MBDT is much simpler. If you can understand the model, you can know how the motor control algorithm is implemented.
Of course, these two methods are very different in implementation and have their own advantages, so they cannot be generalized. I think only by mastering both methods can the greatest advantages of MBD be brought into play.
Previous article:Position-free closed-loop control of brushless DC motor BLDC based on Simulink
Next article:Solution for the full life cycle management system of CNC machine tools based on identification resolution technology
- Popular Resources
- Popular amplifiers
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Can you please help me analyze the specific working mode of TL431?
- [Serial] [Starlight Lightning STM32F407 Development Board] Chapter 14 Low Power Consumption Experiment
- 【AT-START-F425 Review】RT_Thread Studio Project Construction and Unboxing
- Turntable Control System Based on TMS320F2812
- It is an adapter board for STC microcontroller download
- DSP IIR digital filter implementation program source code
- Live broadcast registration with prizes | Microchip Security Solutions Seminar Series is restarted!
- Classical Analysis of Capacitance and Capacitor
- Does the NOP instruction in 430 execute one instruction cycle?
- Summary of Bluetooth stickers in 2021---wonderful---pay attention to check--learn value--wish you steady improvement