Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: FastPWM mbed FastIO MODSERIAL
main.cpp File Reference
Basic DC motor control test, rpm feedback by simple impulse signal, PID speed control. More...
Go to the source code of this file.
Functions | |
| static void | tskImpSens (void) |
| RPM calculation. | |
| static void | tskLEDBlink (void) |
| User LED flashing. | |
| static void | tskPWMWrite (void) |
| Writes new duty cycle value into PWM generator. | |
| static void | tskRPMSetpoint (void) |
| Implementation of periodic change of RPM Setpoint. | |
| static void | tskBackground (void) |
| Implementation of background task. | |
| static void | setup (void) |
| System initialization - called at the prologue of main(). | |
Detailed Description
Basic DC motor control test, rpm feedback by simple impulse signal, PID speed control.
Test application for STM32F4 for small DC motor control. Main specifications:
- DC motor controlled by PWM
- Motor driver used L298N
- RPM evaluated via simple impulse sensor
- Speed (RPM) controlled by PID controller
Definition in file main.cpp.
Function Documentation
| void setup | ( | void | ) | [static] |
| void tskBackground | ( | void | ) | [static] |
Implementation of background task.
Periodically called from main loop without delay.
- Note:
- These actions are candidates for refactoring to event based implementation.
- Warning:
- Initial implementation. Simple and easy.
This function implements actions, which needs to be processed with high priority. Is intended to be called in every pass of main loop.
| void tskImpSens | ( | void | ) | [static] |
| void tskLEDBlink | ( | void | ) | [static] |
| void tskPWMWrite | ( | void | ) | [static] |
Generated on Tue Jul 12 2022 18:19:34 by
1.7.2