-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hwdef: CarbonixCubeOrange - added cx_built_in_test.lua #122
Conversation
libraries/AP_HAL_ChibiOS/hwdef/CarbonixCubeOrange/scripts/cx_built_in_test.lua
Outdated
Show resolved
Hide resolved
libraries/AP_HAL_ChibiOS/hwdef/CarbonixCubeOrange/scripts/cx_built_in_test.lua
Show resolved
Hide resolved
The script should be part of the firmware, in ROMFS. This check should be redundant at that point.
This should be part of the existing ArduPilot pre-arm checks, rather than in a custom script.
Seems reasonable, allowing you to share the script across aircraft. But do consider separate-firmware-per-aircraft.
Again, ESC telemetry checks where the ESC is actively telling you that there's something wrong should be in the normal firmware. If you're adding heuristics (e.g. voltage-and-current-and-temperature is roughly the same for all ESCs), that's a good use of a script. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably also want to have some autotests to make sure this LUA script continues to work.
Some are trivial to test - set EFI_TYPE to 17 and make sure prearms fail with a specific error string.
libraries/AP_HAL_ChibiOS/hwdef/CarbonixCubeOrange/scripts/cx_built_in_test.lua
Outdated
Show resolved
Hide resolved
libraries/AP_HAL_ChibiOS/hwdef/CarbonixCubeOrange/scripts/cx_built_in_test.lua
Outdated
Show resolved
Hide resolved
libraries/AP_HAL_ChibiOS/hwdef/CarbonixCubeOrange/scripts/cx_built_in_test.lua
Outdated
Show resolved
Hide resolved
libraries/AP_HAL_ChibiOS/hwdef/CarbonixCubeOrange/scripts/cx_built_in_test.lua
Outdated
Show resolved
Hide resolved
libraries/AP_HAL_ChibiOS/hwdef/CarbonixCubeOrange/scripts/cx_built_in_test.lua
Outdated
Show resolved
Hide resolved
end | ||
|
||
local function vtol_failure_check() | ||
local lost_index = MotorsMatrix:get_thrust_boost() and MotorsMatrix:get_lost_motor() or -1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice check. Result should be persistently failing to pre-arm until the problem is addressed. ArduPilot main firmware has trouble enforcing such a thing (we fly on all sorts of garbage), but for Ottano and Vollanti this would be a significant problem.
local last_fail_msg_time = 0 | ||
local telem_failure = false | ||
|
||
local function during_arm_check_loop() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not well named in that ArduPilot has "arming checks", which are often refered to as "arm checks". i.e. checks when you do when the user tries to arm the aircraft, not checks done while the aircraft is armed.
So perhaps "
while_armed_check_loop
This was done so legacy aircraft where we are not doing firmware update and just want the lua script would have helped, but now we have decide to upgrade all aircraft so it is good idea to remove that check. |
agreed |
agreed |
e6bd8b3
to
bdc25e9
Compare
For now we will keep the pre Arm check of ESC telem in LUA and will wait for merging of TAKE_OFF_MIN RPM to be merged in Plane |
This code was tested on dev/Volanti and V37 flights., |
bdc25e9
to
e7994a6
Compare
Added MotorsMatrix:get_lost_motor() MotorsMatrix:get_thrust_boost() esc_telem:get_last_telem_data_ms(esc_index) SW-61
e7994a6
to
376f266
Compare
libraries/AP_HAL_ChibiOS/hwdef/CarbonixCubeOrange/scripts/cx_built_in_test.lua
Outdated
Show resolved
Hide resolved
libraries/AP_HAL_ChibiOS/hwdef/CarbonixCubeOrange/scripts/cx_built_in_test.lua
Outdated
Show resolved
Hide resolved
libraries/AP_HAL_ChibiOS/hwdef/CarbonixCubeOrange/scripts/cx_built_in_test.lua
Outdated
Show resolved
Hide resolved
libraries/AP_HAL_ChibiOS/hwdef/CarbonixCubeOrange/scripts/cx_built_in_test.lua
Show resolved
Hide resolved
libraries/AP_HAL_ChibiOS/hwdef/CarbonixCubeOrange/scripts/cx_built_in_test.lua
Show resolved
Hide resolved
This commit introduces a Lua script, cx_built_in_test.lua, which serves as a Continuous Built-In Test (BIT) for Carbonix Aircrafts. The script checks multiple functionalities and provides the following features: Firmware version check: The script ensures that the firmware version is at least 5.0. ESC Status Check and Fault Detection: The script continuously checks the status of the ESC and detects any faults. Aircraft type detection: The script automatically detects the type of aircraft (either Ottano or Volanti) based on the EFI type. Pre-arm checks: The script performs several pre-arm checks, including checking the firmware version, initializing parameters, and checking the aircraft type. During-arm checks: The script performs checks while the aircraft is armed, including checking ESC telemetry and VTOL failure checks. This script is designed to enhance the safety and reliability of Carbonix Aircrafts by continuously monitoring their status and detecting any potential issues. SW-61
376f266
to
8dd57f9
Compare
This commit introduces a Lua script, cx_built_in_test.lua, which serves as a Continuous Built-In Test (BIT) for Carbonix Aircrafts. The script checks multiple functionalities and provides the following features:
Firmware version check: The script ensures that the firmware version is at least 5.0.
ESC Status Check and Fault Detection: The script continuously checks the status of the ESC and detects any faults.
Aircraft type detection: The script automatically detects the type of aircraft (either Ottano or Volanti) based on the EFI type.
Pre-arm checks: The script performs several pre-arm checks, including checking the firmware version, initializing parameters, and checking the aircraft type.
During-arm checks: The script performs checks while the aircraft is armed, including checking ESC telemetry and VTOL failure checks.
This script is designed to enhance the safety and reliability of Carbonix Aircrafts by continuously monitoring their status and detecting any potential issues.
SW-61