Commit Graph

45 Commits

Author SHA1 Message Date
Oleg Kalachev 2f4b1423e6 Typo and minor code style changes 2026-05-28 18:39:44 +03:00
Oleg Kalachev 35e94f6ea6 Support ESP32-C3
User Serial1 for rc instead of Serial2, as ESP32-C3 has only 2 Serials.
Add CI build for ESP32-C3.
2026-05-10 21:07:20 +03:00
Oleg Kalachev 1f48e379e3 Improve the rc calibration code
More convenient steps order.
Improve the readability a bit.
2026-05-10 19:05:27 +03:00
Oleg Kalachev c434107eaf Add parameter for configuring sbus pin number, disable sbus by default 2026-03-27 00:56:34 +03:00
Oleg Kalachev 3e49d41986 Make rc channel numbers and calibration params use int instead of float
As parameter subsystems supports int now, and int is much more natural here.
2026-02-02 20:36:22 +03:00
Oleg Kalachev 6d01cd2e79 Make failsafe configurable using parameters
SF_RC_LOSS_TIME - time without rc to activate failsafe.
SD_DESCEND_TIME - total time to decrease the throttle to zero.
Make controlTime nan on the start to simplify the logic.
2026-01-22 23:57:52 +03:00
Oleg Kalachev 0abb18c616 Make parameter names case-insensitive
+ minor fix
2026-01-22 23:11:47 +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 e50a9d5fea Revert t variable type to float instead of double
For the sake of simplicity and consistency.
2025-10-19 20:46:38 +03:00
Oleg Kalachev 253aae2220 Lowercase imu and rc variables
To make it more obvious these are variables, not classes.
2025-10-19 20:45:56 +03:00
Oleg Kalachev e88888baeb Fix rc calibration steps enumeration again 2025-09-11 11:47:28 +03:00
Oleg Kalachev de69b228ff Fix rc calibration steps enumeration 2025-09-02 11:03:44 +03:00
Oleg Kalachev c1788e2c75 Refactor arming logic
Arm and disarm with gestures only: left stick right/down for arming, left/down for disarming.
Remove arming switch as it complicates arming gestures logic.
Remove MAV_CTRL_SCALE parameter as it complicates arming gestures logic, advise to decrease TILT_MAX when controlling with a smartphone.
Put some minimal thrust to motors to indicate armed state.
Rename build article to usage article, add flight instructions.
2025-08-27 03:19:26 +03:00
Oleg Kalachev 8418723ccc Refactor control subsystem
Add interpretControls function to convert pilot commands and mode into control targets and make control functions independent from the mode.
Add ratesExtra target for rates feed-forward; remove yawMode.
Rename controlRate to controlRates to reflect rates variable name.
Remove USER mode.
2025-08-26 01:00:56 +03:00
Oleg Kalachev 32874b92fd Minor fixes 2025-07-14 12:05:16 +03:00
Oleg Kalachev 52819e403b Major rework of rc subsystem
Implement channels mapping calibration.
Store mapping in parameters.
Get rid of `controls` array and store control inputs in `controlRoll`, `controlPitch`, ... variables.
Move `channels` variable to rc.ino, channels are not involved when controled using mavlink.
'Neutral' values are renamed to 'zero' - more precise naming.
`controlsTime` is renamed to `controlTime`.
Use unsigned values for channels.
Make channel values in simulation more alike to real world: unsigned values in range [1000, 2000].
Send RC_CHANNELS_RAW instead of RC_CHANNELS_SCALED via mavlink
Don't send channels data via mavlink if rc is not used
2025-07-14 12:01:29 +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 bfef7bd26a Remove non-nessesary printArray function 2025-02-18 10:26:59 +03:00
Oleg Kalachev 083db659c6 Improve RC reading in calibration process 2025-02-12 10:15:13 +03:00
Oleg Kalachev dcfe39f8c9 Move SBUS RC declaration to the top 2025-01-24 12:10:48 +03:00
Oleg Kalachev 70f5186c1b Use double for storing time instead of float
Float precision may be not enough after some time of operating
2025-01-12 19:58:36 +03:00
Oleg Kalachev 9e4a2c5ffc Move controlsTime variable to rc.ino 2025-01-11 00:28:31 +03:00
Oleg Kalachev 821e6b105e Make channels definition to rc.ino
It's also planned to parametrize them later
2025-01-10 09:37:48 +03:00
Oleg Kalachev 568f9dd5b1 Minor code improvements 2025-01-10 08:59:09 +03:00
Oleg Kalachev 85172cdcc8 Make util module header instead of .ino-file 2025-01-10 06:51:14 +03:00
Oleg Kalachev 299c8a6a02 Various minor fixes 2024-12-27 21:52:21 +03:00
Oleg Kalachev ae349fb73c Implement parameters subsystem
* Unified parameters storage.
* Store parameters in flash on the hardware.
* Store parameters in text file in simulation.
* Work with parameters in command line.
* Support parameters in MAVLink for working with parameters in QGC.
2024-12-23 13:00:02 +03:00
Oleg Kalachev 048a3c6375 Use the new UART2 pins for RC by default
To make it consistent with the documentation
2024-11-27 23:02:20 +03:00
Oleg Kalachev ec832d4e37 Implement RC fail-safe 2024-11-04 11:51:17 +03:00
Oleg Kalachev f46460e53d Make RC_CHANNELS=16 corresponding the number of SBUS channels 2024-10-23 09:28:09 +03:00
Oleg Kalachev e993dde355 Update ESP32 Arduino Core to v3.0.3 2024-07-25 02:45:59 +03:00
Oleg Kalachev 646fa46f6b Use FlixPeriph library for SBUS 2024-03-17 02:29:37 +03:00
Oleg Kalachev ba6e63b50b Correctly set output parameters of simulated SBUS::read, minor name fix 2024-02-06 21:02:20 +03:00
Oleg Kalachev 0661aecccf Remove unneeded INVERT_SERIAL define 2024-02-04 14:42:57 +03:00
Oleg Kalachev 69cfc9e5fa Utilize internal ESP32 UART invertor for SBUS 2024-01-26 13:46:13 +03:00
Oleg Kalachev 7a62229125 Minor cleanups 2024-01-05 15:11:07 +03:00
Oleg Kalachev f520b57abe Implement RC calibration, common for the real drone and the simulation 2024-01-02 11:54:09 +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 3207fdb43c Minor changes 2023-12-29 18:43:34 +03:00
Oleg Kalachev a174d5cd7d Headers cleanups 2023-12-19 05:06:19 +03:00
Oleg Kalachev 39875cafb9 Remove non-effective statics 2023-05-31 20:12:45 +03:00
Oleg Kalachev f84d1e95dd More cleanups 2023-05-26 16:46:22 +03:00
Oleg Kalachev 147eef0af7 Cleanups 2023-05-25 11:42:13 +03:00
Oleg Kalachev e039055c8e Initial commit 2023-03-26 10:23:30 +03:00