Skip to content
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

INAV Configurator with Helicopter support #1819

Draft
wants to merge 30 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
e4525e7
Merge pull request #3 from iNavFlight/master
Woga65 Aug 7, 2023
8b55319
enable rc-channel remapping for the first eight rc-channels
Woga65 Aug 7, 2023
419ebaf
add collective pitch related stuff
Woga65 Aug 7, 2023
2b49a19
load variable pitch (pre)releases fron the online repository
Woga65 Aug 7, 2023
89d0a47
Fix url to the author + commit message
Woga65 Aug 8, 2023
c3df811
package.json - correct version number
Woga65 Aug 8, 2023
19cee9b
Correct the accepted firmware version
Woga65 Aug 8, 2023
7dd0639
Downgrade nw-builder for compatibility reasons
Woga65 Aug 8, 2023
c1ec66b
add default settings for Heli-Quad
Woga65 Aug 9, 2023
a749f4b
heli_bicopter.svg: Corrected representation rotation direction for mo…
Woga65 Aug 11, 2023
172d7d2
3D Model for Twin-Rotor Heli (Chinook)
Woga65 Aug 12, 2023
eb657f3
show collective-pitch platforms only if suitable firmware is selected
Woga65 Aug 14, 2023
39f089c
Advanced Tuning: Add helicopter specific captions + help texts
Woga65 Aug 14, 2023
7b0edf5
implement dedicated timer usage heli motor+servo
Woga65 Aug 17, 2023
7dda9b8
receive full 32 bit timer usage flags from the FC (has been the first…
Woga65 Aug 18, 2023
71eaf03
suitable PID defaults for Heli-Quad
Woga65 Aug 18, 2023
a2222f5
move reception of full 32 bit timer usage flags to a new MSP2 API end…
Woga65 Aug 19, 2023
cf6fe3e
Get RC-channel remapping capabilities from the FC.
Woga65 Aug 20, 2023
60c6b07
translate generic RC-channel letters to collective-pitch letters when…
Woga65 Aug 20, 2023
fc3b9d8
Add helicopter flight modes (headspeeds). For switching those flight …
Woga65 Aug 26, 2023
443084b
Merge pull request #4 from iNavFlight/master
Woga65 Sep 1, 2023
2577424
Bumped version No. Added RPM display in Outputs tab.
Woga65 Sep 1, 2023
4bc9650
Merge pull request #5 from Woga65/woga65_6.1.0_vari-pitch
Woga65 Sep 1, 2023
e0fb642
Commented out code that is used for testing (different repo for relea…
Woga65 Sep 1, 2023
ef80a53
Bump versions of accepted releases
Woga65 Sep 1, 2023
b57dc64
Changed channel remapping from the AUX scheme to the channel number s…
Woga65 Sep 1, 2023
2684707
Default to stable releases. Removed comments (firmware flasher).
Woga65 Sep 1, 2023
11bcb29
Prepare getting + setting collective-pitch values for the IDLE-UP mod…
Woga65 Sep 1, 2023
8fa18f6
Added support for collective pitch hover settings. For flight mode NO…
Woga65 Sep 2, 2023
f154d48
Changed default RC-channel order. Read/write MSPV2 collective pitch h…
Woga65 Sep 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 34 additions & 1 deletion _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,9 @@
"fcInfoReceived": {
"message": "Flight controller info, identifier: <strong>$1</strong>, version: <strong>$2</strong>"
},
"targetInfoReceived": {
"message": "Target variant: <strong>$1</strong>, is variable pitch: <strong>$2</strong>"
},

"notifications_app_just_updated_to_version": {
"message": "Application just updated to version: $1"
Expand Down Expand Up @@ -2455,6 +2458,12 @@
"controlAxisThrottle": {
"message": "Throttle [T]"
},
"controlAxisCollective": {
"message": "Collective [C]"
},
"controlGyroGain": {
"message": "Gyro gain [G]"
},
"controlAxisMotor": {
"message": "Motor"
},
Expand Down Expand Up @@ -2890,6 +2899,9 @@
},
"tabAdvancedTuningMultirotorTuningTitle": {
"message": ": Multirotors"
},
"tabAdvancedTuningHelicopterTuningTitle": {
"message": ": Helicopters"
},
"tabAdvancedTuningGenericTitle": {
"message": "Generic settings"
Expand Down Expand Up @@ -2936,6 +2948,9 @@
"multiRotorNavigationConfiguration": {
"message": "Multirotor Navigation Settings"
},
"helicopterNavigationConfiguration": {
"message": "Helicopter Navigation Settings"
},
"userControlMode": {
"message": "User Control Mode"
},
Expand Down Expand Up @@ -2963,15 +2978,30 @@
"posholdMaxBankAngle": {
"message": "Multirotor max. banking angle"
},
"posholdMaxBankAngleHeli": {
"message": "Helicopter max. banking angle"
},
"posholdMaxBankAngleHelp": {
"message": "Maximum banking angle in navigation modes. Constrained by maximum ROLL angle in PID tuning tab."
"message": "Maximum banking angle in navigation modes. Constrained by maximum ROLL angle in PID tuning tab. CLI setting for multirotor and helicopter: nav_mc_bank_angle"
},
"posholdHoverThrottle": {
"message": "Hover throttle"
},
"posholdHoverThrottleHelp": {
"message": "Throttle at which the multirotor hovers. Used as a starting point for altitude hold. CLI: nav_mc_hover_thr"
},
"posholdHoverMidThrottle": {
"message": "Use mid. throttle for ALTHOLD"
},
"posholdHoverCollective": {
"message": "Hover collective pitch for normal headspeed"
},
"posholdHoverCollectiveHelp": {
"message": "Collective pitch at which the helicopter hovers with the headspeed set to normal. Used as a starting point for altitude hold. For the IDLE_UP settings use the CLI: nav_hc_hover_collective_normal | nav_hc_hover_collective_idleup_1 | nav_hc_hover_collective_idleup_2"
},
"posholdHoverMidCollective": {
"message": "Use mid. collective pitch for ALTHOLD"
},
"mcWpSlowdown": {
"message": "Slow down when approaching waypoint"
},
Expand Down Expand Up @@ -4568,6 +4598,9 @@
"multirotorBrakingConfiguration": {
"message": "Multirotor braking mode configuration"
},
"helicopterBrakingConfiguration": {
"message": "Helicopter braking mode configuration"
},
"mapProvider": {
"message": "Map Provider"
},
Expand Down
206 changes: 206 additions & 0 deletions js/defaults_dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,210 @@ helper.defaultsDialog = (function () {
}
]
},
{
"title": 'HeliQuad - Variable Pitch Quadcopter',
"id": 7,
"collectivePitch": true,
"notRecommended": false,
"reboot": true,
"mixerToApply": 35,
"settings": [
{
key: "model_preview_type",
value: 35
},
/*
System
*/
{
key: "gyro_hardware_lpf",
value: "256HZ"
},
{
key: "looptime",
value: 500
},
{
key: "motor_pwm_protocol",
value: "DSHOT300"
},
{
key: "servo_pwm_rate",
value: 330
},
{
key: "throttle_idle",
value: 0
},
{
key: "motor_poles",
value: 24
},
/*
Filtering
*/
{
key: "gyro_main_lpf_hz",
value: 110
},
{
key: "gyro_main_lpf_type",
value: "PT1"
},
{
key: "dterm_lpf_hz",
value: 110
},
{
key: "dterm_lpf_type",
value: "PT3"
},
{
key: "dterm_lpf2_hz",
value: 0
},
{
key: "dterm_lpf2_type",
value: "PT1"
},
{
key: "dynamic_gyro_notch_enabled",
value: "ON"
},
{
key: "dynamic_gyro_notch_q",
value: 250
},
{
key: "dynamic_gyro_notch_min_hz",
value: 120
},
{
key: "setpoint_kalman_enabled",
value: "ON"
},
{
key: "setpoint_kalman_q",
value: 200
},
{
key: "smith_predictor_delay", // Enable Smith Predictor
value: 1.5
},
/*
Mechanics
*/
{
key: "airmode_type",
value: "STICK_CENTER"
},
{
key: "airmode_throttle_threshold",
value: 1150
},
{
key: "mc_iterm_relax",
value: "RP"
},
{
key: "d_boost_min",
value: 0.8
},
{
key: "d_boost_max",
value: 1.2
},
{
key: "antigravity_gain",
value: 2
},
{
key: "antigravity_accelerator",
value: 5
},
/*
Rates
*/
{
key: "rc_yaw_expo",
value: 75
},
{
key: "rc_expo",
value: 75
},
{
key: "roll_rate",
value: 70
},
{
key: "pitch_rate",
value: 70
},
{
key: "yaw_rate",
value: 60
},
/*
PIDs
*/
{
key: "mc_p_pitch",
value: 41
},
{
key: "mc_i_pitch",
value: 20
},
{
key: "mc_d_pitch",
value: 1
},
{
key: "mc_p_roll",
value: 41
},
{
key: "mc_i_roll",
value: 20
},
{
key: "mc_d_roll",
value: 1
},
{
key: "mc_p_yaw",
value: 80
},
{
key: "mc_i_yaw",
value: 35
},
/*
* TPA
*/
{
key: "tpa_rate",
value: 20
},
{
key: "tpa_breakpoint",
value: 2000
},
{
key: "platform_type",
value: "HELICOPTER"
},
{
key: "applied_defaults",
value: 7
},
{
key: "failsafe_procedure",
value: "DROP"
}
]
},
{
"title": 'Airplane with a Tail',
"notRecommended": false,
Expand Down Expand Up @@ -1315,6 +1519,8 @@ helper.defaultsDialog = (function () {
return; //Defaults were applied, we can just ignore
}

data = TARGET.isVariablePitch ? data : data.filter(d => !(d.collectivePitch || false));

privateScope.render();
$container.show();
}
Expand Down
26 changes: 21 additions & 5 deletions js/fc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
'use strict';

// define all the global variables that are uses to hold FC state
// define all the global variables that are used to hold FC state
const TARGET = { // woga65: info about the target variant
fullIdentifier: "",
isVariablePitch: false,
}

var CONFIG,
LED_STRIP,
LED_COLORS,
Expand Down Expand Up @@ -64,7 +69,8 @@ var CONFIG,
SAFEHOMES,
BOARD_ALIGNMENT,
CURRENT_METER_CONFIG,
FEATURES;
FEATURES,
ESC_RPMS; // woga65:

var FC = {
restartRequired: false,
Expand All @@ -76,6 +82,9 @@ var FC = {
isMultirotor: function () {
return (MIXER_CONFIG.platformType == PLATFORM_MULTIROTOR || MIXER_CONFIG.platformType == PLATFORM_TRICOPTER);
},
isHelicopter: function () {
return (MIXER_CONFIG.platformType == PLATFORM_HELICOPTER);
},
isRpyFfComponentUsed: function () {
return true; // Currently all planes have roll, pitch and yaw FF
},
Expand Down Expand Up @@ -539,6 +548,8 @@ var FC = {

SETTINGS = {};

ESC_RPMS = []; // woga65:

SAFEHOMES = new SafehomeCollection();
},
getOutputUsages: function() {
Expand Down Expand Up @@ -818,7 +829,12 @@ var FC = {
}
},
getRcMapLetters: function () {
return ['A', 'E', 'R', 'T'];
if (RC_MAP.length === 8 || TARGET.isVariablePitch) {
return MIXER_CONFIG.platformType === PLATFORM_HELICOPTER // woga65: rc-channel remapping
? ['A', 'E', 'R', 'T', '5', 'C', 'G', '8'] // if variable pitch, map collective + gyro gain
: ['A', 'E', 'R', 'T', '5', '6', '7', '8']; // else map AUX2/CH6 + AUX3/CH7
}
return ['A', 'E', 'R', 'T']; // FC firmware restricted to 4-channel mapping
},
isRcMapValid: function (val) {
var strBuffer = val.split(''),
Expand Down Expand Up @@ -851,8 +867,8 @@ var FC = {
'RC Yaw', // 6
'RC Throttle', // 7
'RC Channel 5', // 8
'RC Channel 6', // 9
'RC Channel 7', // 10
TARGET.isVariablePitch ? 'RC Collective Pitch' : 'RC Channel 6', // 9 // woga65: channel naming for either
TARGET.isVariablePitch ? 'RC Gyro Gain' : 'RC Channel 7', // 10 // variable pitch or regular aircraft
'RC Channel 8', // 11
'Gimbal Pitch', // 12
'Gimbal Roll', // 13
Expand Down
Loading