![]() |
ACwing FC firmware
STM32WB55: attitude IEKF, altitude Kalman filter, flight core, protocol v2
|
PWM for 4 brushed coreless motors (8520, 1S) - PREPARED, unused in phase 1. More...
#include <stdint.h>Go to the source code of this file.
Macros | |
| #define | MOTORS_ENABLE 0 |
| 1 only with the power stage connected | |
| #define | MOTORS_PWM_TOP 1999u |
Functions | |
| void | motors_init (void) |
| void | motors_arm (uint8_t armed) |
| disarmed: duty forced to 0 | |
| void | motors_set (const float duty[4]) |
| 0..1, saturated | |
| void | motors_test (uint8_t motor, float duty) |
| MOTOR_TEST (props off, disarmed): motor 1..4 at duty, the others off; motor 0 = all off. | |
PWM for 4 brushed coreless motors (8520, 1S) - PREPARED, unused in phase 1.
TIM1 CH1..CH4, 64 MHz timer clock, ARR = 1999 -> 32 kHz, 2000 levels. The WB55 pins can NOT drive the motors: a power stage is required (low-side logic-level N-MOSFET + freewheeling diode per motor), see 03 - Docs/firmware/architecture.md. Check in CubeMX that the TIM1 pins do not clash with those used by the IKS4A1 on the Arduino connector.
Definition in file motors.h.
| #define MOTORS_ENABLE 0 |
| void motors_init | ( | void | ) |
Definition at line 13 of file motors.c.
References s_armed.
Referenced by app_start().
| void motors_arm | ( | uint8_t | armed | ) |
disarmed: duty forced to 0
Definition at line 24 of file motors.c.
References motors_set(), and s_armed.
Referenced by app_start().
| void motors_set | ( | const float | duty[4] | ) |
0..1, saturated
Definition at line 30 of file motors.c.
References MOTORS_PWM_TOP, and s_armed.
Referenced by motors_arm().
| void motors_test | ( | uint8_t | motor, |
| float | duty | ||
| ) |
MOTOR_TEST (props off, disarmed): motor 1..4 at duty, the others off; motor 0 = all off.
Does nothing with MOTORS_ENABLE = 0.
Definition at line 44 of file motors.c.
References MOTORS_PWM_TOP, and s_armed.
Referenced by motor_test_hook().