Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alberto Ruiz Garcia
Firmware
Commits
220bd82b
Commit
220bd82b
authored
7 years ago
by
sanderux
Committed by
Lorenz Meier
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Per channel PWM disarmed values
parent
462f1346
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ROMFS/px4fmu_common/init.d/rc.interface
+22
-0
22 additions, 0 deletions
ROMFS/px4fmu_common/init.d/rc.interface
src/modules/sensors/sensor_params.c
+210
-21
210 additions, 21 deletions
src/modules/sensors/sensor_params.c
src/systemcmds/pwm/pwm.cpp
+4
-0
4 additions, 0 deletions
src/systemcmds/pwm/pwm.cpp
with
236 additions
and
21 deletions
ROMFS/px4fmu_common/init.d/rc.interface
+
22
−
0
View file @
220bd82b
...
@@ -102,6 +102,18 @@ then
...
@@ -102,6 +102,18 @@ then
fi
fi
fi
fi
#
# Per channel disarmed settings
#
pwm disarmed -c 1 -p p:PWM_MAIN_DIS1
pwm disarmed -c 2 -p p:PWM_MAIN_DIS2
pwm disarmed -c 3 -p p:PWM_MAIN_DIS3
pwm disarmed -c 4 -p p:PWM_MAIN_DIS4
pwm disarmed -c 5 -p p:PWM_MAIN_DIS5
pwm disarmed -c 6 -p p:PWM_MAIN_DIS6
pwm disarmed -c 7 -p p:PWM_MAIN_DIS7
pwm disarmed -c 8 -p p:PWM_MAIN_DIS8
if [ $FAILSAFE != none ]
if [ $FAILSAFE != none ]
then
then
pwm failsafe -d ${OUTPUT_DEV} ${FAILSAFE}
pwm failsafe -d ${OUTPUT_DEV} ${FAILSAFE}
...
@@ -228,6 +240,16 @@ then
...
@@ -228,6 +240,16 @@ then
pwm disarmed -c ${PWM_ACHDIS} -p ${PWM_AUX_DISARMED} -d ${OUTPUT_AUX_DEV}
pwm disarmed -c ${PWM_ACHDIS} -p ${PWM_AUX_DISARMED} -d ${OUTPUT_AUX_DEV}
fi
fi
#
# Per channel disarmed settings
#
pwm disarmed -c 1 -p p:PWM_AUX_DIS1 -d ${OUTPUT_AUX_DEV}
pwm disarmed -c 2 -p p:PWM_AUX_DIS2 -d ${OUTPUT_AUX_DEV}
pwm disarmed -c 3 -p p:PWM_AUX_DIS3 -d ${OUTPUT_AUX_DEV}
pwm disarmed -c 4 -p p:PWM_AUX_DIS4 -d ${OUTPUT_AUX_DEV}
pwm disarmed -c 5 -p p:PWM_AUX_DIS5 -d ${OUTPUT_AUX_DEV}
pwm disarmed -c 6 -p p:PWM_AUX_DIS6 -d ${OUTPUT_AUX_DEV}
if [ $FAILSAFE_AUX != none ]
if [ $FAILSAFE_AUX != none ]
then
then
pwm failsafe -d ${OUTPUT_AUX_DEV} ${FAILSAFE}
pwm failsafe -d ${OUTPUT_AUX_DEV} ${FAILSAFE}
...
...
This diff is collapsed.
Click to expand it.
src/modules/sensors/sensor_params.c
+
210
−
21
View file @
220bd82b
...
@@ -3375,9 +3375,6 @@ PARAM_DEFINE_INT32(SENS_EN_THERMAL, -1);
...
@@ -3375,9 +3375,6 @@ PARAM_DEFINE_INT32(SENS_EN_THERMAL, -1);
/**
/**
* Set the PWM output frequency for the main outputs
* Set the PWM output frequency for the main outputs
*
*
* IMPORTANT: CHANGING THIS PARAMETER REQUIRES A COMPLETE SYSTEM
* REBOOT IN ORDER TO APPLY THE CHANGES.
*
* Set to 400 for industry default or 1000 for high frequency ESCs.
* Set to 400 for industry default or 1000 for high frequency ESCs.
*
*
* Set to 0 for Oneshot125.
* Set to 0 for Oneshot125.
...
@@ -3394,9 +3391,6 @@ PARAM_DEFINE_INT32(PWM_RATE, 400);
...
@@ -3394,9 +3391,6 @@ PARAM_DEFINE_INT32(PWM_RATE, 400);
/**
/**
* Set the minimum PWM for the main outputs
* Set the minimum PWM for the main outputs
*
*
* IMPORTANT: CHANGING THIS PARAMETER REQUIRES A COMPLETE SYSTEM
* REBOOT IN ORDER TO APPLY THE CHANGES.
*
* Set to 1000 for industry default or 900 to increase servo travel.
* Set to 1000 for industry default or 900 to increase servo travel.
*
*
* @reboot_required true
* @reboot_required true
...
@@ -3411,9 +3405,6 @@ PARAM_DEFINE_INT32(PWM_MIN, 1000);
...
@@ -3411,9 +3405,6 @@ PARAM_DEFINE_INT32(PWM_MIN, 1000);
/**
/**
* Set the maximum PWM for the main outputs
* Set the maximum PWM for the main outputs
*
*
* IMPORTANT: CHANGING THIS PARAMETER REQUIRES A COMPLETE SYSTEM
* REBOOT IN ORDER TO APPLY THE CHANGES.
*
* Set to 2000 for industry default or 2100 to increase servo travel.
* Set to 2000 for industry default or 2100 to increase servo travel.
*
*
* @reboot_required true
* @reboot_required true
...
@@ -3428,9 +3419,6 @@ PARAM_DEFINE_INT32(PWM_MAX, 2000);
...
@@ -3428,9 +3419,6 @@ PARAM_DEFINE_INT32(PWM_MAX, 2000);
/**
/**
* Set the disarmed PWM for the main outputs
* Set the disarmed PWM for the main outputs
*
*
* IMPORTANT: CHANGING THIS PARAMETER REQUIRES A COMPLETE SYSTEM
* REBOOT IN ORDER TO APPLY THE CHANGES.
*
* This is the PWM pulse the autopilot is outputting if not armed.
* This is the PWM pulse the autopilot is outputting if not armed.
* The main use of this parameter is to silence ESCs when they are disarmed.
* The main use of this parameter is to silence ESCs when they are disarmed.
*
*
...
@@ -3444,10 +3432,217 @@ PARAM_DEFINE_INT32(PWM_MAX, 2000);
...
@@ -3444,10 +3432,217 @@ PARAM_DEFINE_INT32(PWM_MAX, 2000);
PARAM_DEFINE_INT32
(
PWM_DISARMED
,
900
);
PARAM_DEFINE_INT32
(
PWM_DISARMED
,
900
);
/**
/**
* Set the minimum PWM for the auxiliary outputs
* Set the disarmed PWM for the main 1 output
*
* This is the PWM pulse the autopilot is outputting if not armed.
* When set to -1 the value for PWM_DISARMED will be used
*
* @reboot_required true
*
* @min -1
* @max 2200
* @unit us
* @group PWM Outputs
*/
PARAM_DEFINE_INT32
(
PWM_MAIN_DIS1
,
-
1
);
/**
* Set the disarmed PWM for the main 2 output
*
* This is the PWM pulse the autopilot is outputting if not armed.
* When set to -1 the value for PWM_DISARMED will be used
*
* @reboot_required true
*
* @min -1
* @max 2200
* @unit us
* @group PWM Outputs
*/
PARAM_DEFINE_INT32
(
PWM_MAIN_DIS2
,
-
1
);
/**
* Set the disarmed PWM for the main 3 output
*
* This is the PWM pulse the autopilot is outputting if not armed.
* When set to -1 the value for PWM_DISARMED will be used
*
* @reboot_required true
*
* @min -1
* @max 2200
* @unit us
* @group PWM Outputs
*/
PARAM_DEFINE_INT32
(
PWM_MAIN_DIS3
,
-
1
);
/**
* Set the disarmed PWM for the main 4 output
*
* This is the PWM pulse the autopilot is outputting if not armed.
* When set to -1 the value for PWM_DISARMED will be used
*
* @reboot_required true
*
* @min -1
* @max 2200
* @unit us
* @group PWM Outputs
*/
PARAM_DEFINE_INT32
(
PWM_MAIN_DIS4
,
-
1
);
/**
* Set the disarmed PWM for the main 5 output
*
* This is the PWM pulse the autopilot is outputting if not armed.
* When set to -1 the value for PWM_DISARMED will be used
*
* @reboot_required true
*
* @min -1
* @max 2200
* @unit us
* @group PWM Outputs
*/
PARAM_DEFINE_INT32
(
PWM_MAIN_DIS5
,
-
1
);
/**
* Set the disarmed PWM for the main 6 output
*
* This is the PWM pulse the autopilot is outputting if not armed.
* When set to -1 the value for PWM_DISARMED will be used
*
* @reboot_required true
*
* @min -1
* @max 2200
* @unit us
* @group PWM Outputs
*/
PARAM_DEFINE_INT32
(
PWM_MAIN_DIS6
,
-
1
);
/**
* Set the disarmed PWM for the main 7 output
*
*
* IMPORTANT: CHANGING THIS PARAMETER REQUIRES A COMPLETE SYSTEM
* This is the PWM pulse the autopilot is outputting if not armed.
* REBOOT IN ORDER TO APPLY THE CHANGES.
* When set to -1 the value for PWM_DISARMED will be used
*
* @reboot_required true
*
* @min -1
* @max 2200
* @unit us
* @group PWM Outputs
*/
PARAM_DEFINE_INT32
(
PWM_MAIN_DIS7
,
-
1
);
/**
* Set the disarmed PWM for the main 8 output
*
* This is the PWM pulse the autopilot is outputting if not armed.
* When set to -1 the value for PWM_DISARMED will be used
*
* @reboot_required true
*
* @min -1
* @max 2200
* @unit us
* @group PWM Outputs
*/
PARAM_DEFINE_INT32
(
PWM_MAIN_DIS8
,
-
1
);
/**
* Set the disarmed PWM for the AUX 1 output
*
* This is the PWM pulse the autopilot is outputting if not armed.
* When set to -1 the value for PWM_AUX_DISARMED will be used
*
* @reboot_required true
*
* @min -1
* @max 2200
* @unit us
* @group PWM Outputs
*/
PARAM_DEFINE_INT32
(
PWM_AUX_DIS1
,
-
1
);
/**
* Set the disarmed PWM for the AUX 2 output
*
* This is the PWM pulse the autopilot is outputting if not armed.
* When set to -1 the value for PWM_AUX_DISARMED will be used
*
* @reboot_required true
*
* @min -1
* @max 2200
* @unit us
* @group PWM Outputs
*/
PARAM_DEFINE_INT32
(
PWM_AUX_DIS2
,
-
1
);
/**
* Set the disarmed PWM for the AUX 3 output
*
* This is the PWM pulse the autopilot is outputting if not armed.
* When set to -1 the value for PWM_AUX_DISARMED will be used
*
* @reboot_required true
*
* @min -1
* @max 2200
* @unit us
* @group PWM Outputs
*/
PARAM_DEFINE_INT32
(
PWM_AUX_DIS3
,
-
1
);
/**
* Set the disarmed PWM for the AUX 4 output
*
* This is the PWM pulse the autopilot is outputting if not armed.
* When set to -1 the value for PWM_AUX_DISARMED will be used
*
* @reboot_required true
*
* @min -1
* @max 2200
* @unit us
* @group PWM Outputs
*/
PARAM_DEFINE_INT32
(
PWM_AUX_DIS4
,
-
1
);
/**
* Set the disarmed PWM for the AUX 5 output
*
* This is the PWM pulse the autopilot is outputting if not armed.
* When set to -1 the value for PWM_AUX_DISARMED will be used
*
* @reboot_required true
*
* @min -1
* @max 2200
* @unit us
* @group PWM Outputs
*/
PARAM_DEFINE_INT32
(
PWM_AUX_DIS5
,
-
1
);
/**
* Set the disarmed PWM for the AUX 6 output
*
* This is the PWM pulse the autopilot is outputting if not armed.
* When set to -1 the value for PWM_AUX_DISARMED will be used
*
* @reboot_required true
*
* @min -1
* @max 2200
* @unit us
* @group PWM Outputs
*/
PARAM_DEFINE_INT32
(
PWM_AUX_DIS6
,
-
1
);
/**
* Set the minimum PWM for the auxiliary outputs
*
*
* Set to 1000 for default or 900 to increase servo travel
* Set to 1000 for default or 900 to increase servo travel
*
*
...
@@ -3463,9 +3658,6 @@ PARAM_DEFINE_INT32(PWM_AUX_MIN, 1000);
...
@@ -3463,9 +3658,6 @@ PARAM_DEFINE_INT32(PWM_AUX_MIN, 1000);
/**
/**
* Set the maximum PWM for the auxiliary outputs
* Set the maximum PWM for the auxiliary outputs
*
*
* IMPORTANT: CHANGING THIS PARAMETER REQUIRES A COMPLETE SYSTEM
* REBOOT IN ORDER TO APPLY THE CHANGES.
*
* Set to 2000 for default or 2100 to increase servo travel
* Set to 2000 for default or 2100 to increase servo travel
*
*
* @reboot_required true
* @reboot_required true
...
@@ -3480,9 +3672,6 @@ PARAM_DEFINE_INT32(PWM_AUX_MAX, 2000);
...
@@ -3480,9 +3672,6 @@ PARAM_DEFINE_INT32(PWM_AUX_MAX, 2000);
/**
/**
* Set the disarmed PWM for auxiliary outputs
* Set the disarmed PWM for auxiliary outputs
*
*
* IMPORTANT: CHANGING THIS PARAMETER REQUIRES A COMPLETE SYSTEM
* REBOOT IN ORDER TO APPLY THE CHANGES.
*
* This is the PWM pulse the autopilot is outputting if not armed.
* This is the PWM pulse the autopilot is outputting if not armed.
* The main use of this parameter is to silence ESCs when they are disarmed.
* The main use of this parameter is to silence ESCs when they are disarmed.
*
*
...
...
This diff is collapsed.
Click to expand it.
src/systemcmds/pwm/pwm.cpp
+
4
−
0
View file @
220bd82b
...
@@ -543,6 +543,10 @@ pwm_main(int argc, char *argv[])
...
@@ -543,6 +543,10 @@ pwm_main(int argc, char *argv[])
return
1
;
return
1
;
}
}
if
(
pwm_value
<
0
)
{
return
0
;
}
if
(
pwm_value
==
0
)
{
if
(
pwm_value
==
0
)
{
PX4_WARN
(
"reading disarmed value of zero, disabling disarmed PWM"
);
PX4_WARN
(
"reading disarmed value of zero, disabling disarmed PWM"
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment