Commit Graph

38 Commits

Author SHA1 Message Date
Oleg Kalachev 06e2047097 Make motor testing signal 0.2 instead of full power
Testing with full power is too dangerous and inconvenient.
2026-05-08 00:53:19 +03:00
Oleg Kalachev a687303062 Make motor parameters apply without reboot
Add callback to parameter definition to call after parameter is changed.
2026-02-19 04:56:12 +03:00
Oleg Kalachev 40bdaacedb Make motor subsystem configurable using parameters
Motor pins: MOT_PIN_FL, MOT_PIN_FR, MOT_PIN_RL, MOT_PIN_RR.
PWM configuration: MOT_PWM_FREQ, MOT_PWM_RES, MOT_PWM_STOP, MOT_PWM_MIN, MOT_PWM_MAX.
MOT_PWM_MAX = -1 chooses duty cycle mode for brushed motors (default).
2026-01-27 08:40:52 +03:00
Oleg Kalachev c8e5e08b03 Move all global variable declarations to the appropriate subsystems
As it makes the subsystems code easier to understand.
Declare the most used variables in main sketch file as forward declarations.
Make all control input zero by default (except controlMode).
Minor changes.
2026-01-03 13:28:18 +03:00
Oleg Kalachev 1a017ccb97 Keep only one floating point version of map function
Two variants are redundant
2025-11-02 00:02:28 +03:00
Oleg Kalachev 121b50d896 Increase motors pwm frequency to 78Khz
1000 Hz is too low frequency considering the update loop for motors signal is also 1000 Hz.
Decrease resolution as it's required to set larger pwm frequencies.
This change should vastly improve control jitter and remove audible motors noise.
2025-07-03 03:46:11 +03:00
Oleg Kalachev 9c8c0e2578 Minor code updates 2025-05-15 09:22:17 +03:00
Oleg Kalachev 3fdebf39d8 Fix mavlink disconnection in pauses in cli commands
Implement pause function that proceeds processing mavlink.
Use temporal workaround for simulation, as micros function gives the same result on the same simulation step.
2025-02-28 19:25:41 +03:00
Oleg Kalachev d60628e14d Support MAVLink console
Implement receiving and sending SERIAL_CONTROL message
Use global defined print function instead of Serial.printf
2025-02-18 10:33:01 +03:00
Oleg Kalachev 149c62568f Refactor CLI submodule
Move command parsing to doCommand
Parse command with splitString instead of stringToken
Trim commands
Move cliTestMotor to the bottom
Rename parseInput to handleInput, which is more clear
Move motor test function to motors.ino
2025-02-17 15:51:58 +03:00
Oleg Kalachev f456e10177 Increase motors PWM frequency to 1000
To match the main loop frequency
2025-01-12 15:35:05 +03:00
Oleg Kalachev b9e30be98c Better support for ESCs, add PWM_STOP parameter 2025-01-10 10:49:40 +03:00
Oleg Kalachev 85172cdcc8 Make util module header instead of .ino-file 2025-01-10 06:51:14 +03:00
Oleg Kalachev 0a45614751 Move motorsActive function to motors.ino 2025-01-09 11:30:04 +03:00
Oleg Kalachev 404ceed851 Make motor indexes definition const int and move them to motors.ino
Remove motor indexes definitions from flix.ino
Add motors.ino to simulation code and implement required mocks
2025-01-09 11:14:18 +03:00
Oleg Kalachev 72033cdd75 Increase motors PWM resolution to 12 bits 2025-01-09 11:02:38 +03:00
Oleg Kalachev 3088ade743 Fix getDutyCycle return type to make it possible to increase resolution 2025-01-09 11:02:21 +03:00
Oleg Kalachev 5d10446aaf Bring back possibility to use ESCs for motors 2025-01-09 07:43:49 +03:00
Oleg Kalachev acc0274175 Minor fix 2024-12-25 02:21:17 +03:00
Oleg Kalachev edd249566e Increase motors output frequency 2024-12-25 02:13:57 +03:00
Oleg Kalachev ca355e0162 Simplify motors duty cycle computation 2024-12-25 02:13:33 +03:00
Oleg Kalachev 2efae82177 Minor fixes 2024-12-25 01:41:45 +03:00
Oleg Kalachev b015c15a7e Remove non-working fullmot command 2024-11-24 00:10:37 +03:00
Oleg Kalachev 23f3295439 Remove ESC support and add MOSFET support in motors code
The new version uses MOSFETs
2024-10-23 09:27:54 +03:00
Oleg Kalachev bed5d79db8 Add comments to motor pins 2024-07-30 07:49:21 +03:00
Oleg Kalachev e993dde355 Update ESP32 Arduino Core to v3.0.3 2024-07-25 02:45:59 +03:00
Oleg Kalachev 94d24cbd28 Fix PWM values for reverse rotations 2024-05-21 10:51:45 +03:00
Oleg Kalachev 34a81536c2 Fix reverse motors pwm 2024-03-02 15:37:38 +03:00
Oleg Kalachev 31d382dd86 Simplify motors pwm calculation using unified value for all motors 2024-02-06 10:49:48 +03:00
Oleg Kalachev d2296fea76 Change C++ code style: put curly brace on the same line 2023-12-29 18:56:25 +03:00
Oleg Kalachev a174d5cd7d Headers cleanups 2023-12-19 05:06:19 +03:00
Oleg Kalachev 94b483cda6 Transfer fullMotorTest function to motors.ino 2023-12-03 20:43:55 +03:00
Oleg Kalachev 9eaa45c1d9 Consistently use defines to set parameters 2023-05-31 20:16:43 +03:00
Oleg Kalachev f84d1e95dd More cleanups 2023-05-26 16:46:22 +03:00
Oleg Kalachev 88cc792287 Cleanups 2023-05-26 16:24:19 +03:00
Oleg Kalachev aaa8f70166 Enable Serial input and output in simulator, refactor 2023-05-24 10:23:12 +03:00
Oleg Kalachev fca6c27a16 Add some links 2023-03-26 11:20:36 +03:00
Oleg Kalachev e039055c8e Initial commit 2023-03-26 10:23:30 +03:00