Загрузка...

The TU705 final project

Project Description – PMDC Motor Control System Using STM32 and Python HMI

This project involved the design and implementation of a closed-loop and open-loop control system for a permanent magnet DC (PMDC) motor using an STM32G491RE microcontroller and a BTS7960 high-power motor driver. The system was developed as a compact motor control and automation platform demonstrating embedded control, feedback processing, and human-machine interaction similar to a small-scale industrial automation system.

The motor used in the project is a 24V, 200W PMDC motor rated at 2750 RPM and 10.9 A. The motor assembly was mounted onto a movable display case to create a portable demonstration platform suitable for testing and presentation purposes. The entire system connects directly to a laptop through USB communication, allowing live monitoring and control.

The STM32G491RE microcontroller acted as the main controller or PLC substitute within the system. The controller was programmed using bare-metal C within STM32CubeIDE, allowing low-level access to timers, GPIO, interrupts, PWM generation, and encoder processing. A Python-based Human Machine Interface (HMI) was developed to communicate with the STM32 through serial communication. This interface functioned similarly to a SCADA system by allowing the operator to start and stop the motor, monitor operating conditions, and adjust reference values in real time.

Two operating modes were implemented and tested:

Open-Loop Testing

The open-loop control system performed reliably and consistently during testing. PWM duty cycle values generated by the STM32 were applied directly to the BTS7960 driver, controlling the motor speed without feedback correction. The motor responded smoothly across a wide operating range, demonstrating stable speed control and predictable operation. LED indicators mounted on a breadboard visually displayed system states such as active operation and PWM pulsing, improving troubleshooting and system visibility.

Closed-Loop Testing

The closed-loop control system used feedback from a TCRT5000 reflective optical sensor configured as a basic encoder to measure rotational speed. The measured speed was compared against a reference setpoint within the controller. An integral-style control approach was implemented to gradually correct speed error and improve speed regulation.

The closed-loop system was successfully demonstrated and generally operated correctly; however, the motor occasionally stalled under certain operating conditions and still requires fine tuning for optimal performance. Simulation models developed in Simulink produced smoother and more ideal responses compared to the real hardware implementation. In practice, limitations associated with sensor resolution, signal noise, processing timing, and bare-metal embedded code reduced the achievable control precision. Although the controller behaves similarly to an integral controller in operation, achieving extremely fine incremental adjustments proved difficult in the physical system compared to the simulation environment.

One of the largest technical challenges encountered during development was learning and configuring the STM32 embedded environment, including timer peripherals, PWM generation, interrupt handling, and serial communication. Considerable effort was required to overcome low-level programming issues and integrate reliable communication between the STM32 firmware and the Python HMI.

Another major obstacle involved the TCRT5000 sensor used as an encoder. The feedback signal contained significant electrical and optical noise, resulting in unstable pulse readings and inaccurate RPM calculations at times. Signal filtering and software conditioning techniques were required to improve measurement reliability. The noisy encoder feedback directly affected the stability of the closed-loop control system and contributed to occasional stalling behaviour.

Overall, the project successfully demonstrated the practical implementation of an embedded motor control system combining power electronics, feedback control, embedded programming, and PC-based supervisory control. The project also highlighted the differences between ideal simulated control systems and real-world embedded hardware implementations.

Видео The TU705 final project канала Daryl Sweeney
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять