Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
Baitboat
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenSource
Baitboat
Commits
7e411f5f
Commit
7e411f5f
authored
13 years ago
by
Jason Short
Browse files
Options
Downloads
Patches
Plain Diff
This allows users to test the Auto_throttle hold or cruise value
parent
3879e798
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
ArduCopter/APM_Config.h
+6
-0
6 additions, 0 deletions
ArduCopter/APM_Config.h
ArduCopter/ArduCopter.pde
+9
-3
9 additions, 3 deletions
ArduCopter/ArduCopter.pde
ArduCopter/motors.pde
+2
-0
2 additions, 0 deletions
ArduCopter/motors.pde
ArduCopter/system.pde
+2
-0
2 additions, 0 deletions
ArduCopter/system.pde
with
19 additions
and
3 deletions
ArduCopter/APM_Config.h
+
6
−
0
View file @
7e411f5f
...
...
@@ -64,4 +64,10 @@
#define USERHOOK_VARIABLES "UserVariables.h"
// to enable, set to 1
// to disable, set to 0
#define AUTO_THROTTLE_HOLD 1
//# define LOGGING_ENABLED DISABLED
\ No newline at end of file
This diff is collapsed.
Click to expand it.
ArduCopter/ArduCopter.pde
+
9
−
3
View file @
7e411f5f
...
...
@@ -1494,6 +1494,10 @@ void update_throttle_mode(void)
{
int16_t
throttle_out
;
#if AUTO_THROTTLE_HOLD != 0
static
float
throttle_avg
=
THROTTLE_CRUISE
;
#endif
switch
(
throttle_mode
){
case
THROTTLE_MANUAL
:
if
(
g
.
rc_3
.
control_in
>
0
){
...
...
@@ -1508,11 +1512,13 @@ void update_throttle_mode(void)
}
#endif
#if AUTO_THROTTLE_HOLD != 0
// calc average throttle
if
((
g
.
rc_3
.
control_in
>
MINIMUM_THROTTLE
)){
//
throttle_avg = throttle_avg * .98 + rc_3.control_in * .02;
//
g.throttle_cruise = throttle_avg;
if
((
g
.
rc_3
.
control_in
>
MINIMUM_THROTTLE
)
&&
abs
(
climb_rate
)
<
60
){
throttle_avg
=
throttle_avg
*
.98
+
(
float
)
g
.
rc_3
.
control_in
*
.02
;
g
.
throttle_cruise
=
throttle_avg
;
}
#endif
// Code to manage the Copter state
if
((
millis
()
-
takeoff_timer
)
>
5000
){
...
...
This diff is collapsed.
Click to expand it.
ArduCopter/motors.pde
+
2
−
0
View file @
7e411f5f
...
...
@@ -121,6 +121,8 @@ static void init_disarm_motors()
motor_armed
=
false
;
compass
.
save_offsets
();
g
.
throttle_cruise
.
save
();
// we are not in the air
takeoff_complete
=
false
;
...
...
This diff is collapsed.
Click to expand it.
ArduCopter/system.pde
+
2
−
0
View file @
7e411f5f
...
...
@@ -616,12 +616,14 @@ static void update_throttle_cruise()
static
void
init_throttle_cruise
()
{
#if AUTO_THROTTLE_HOLD == 0
// are we moving from manual throttle to auto_throttle?
if
((
old_control_mode
<=
STABILIZE
)
&&
(
g
.
rc_3
.
control_in
>
MINIMUM_THROTTLE
)){
g
.
pi_throttle
.
reset_I
();
g
.
pi_alt_hold
.
reset_I
();
g
.
throttle_cruise
.
set_and_save
(
g
.
rc_3
.
control_in
);
}
#endif
}
#if CLI_SLIDER_ENABLED == ENABLED && CLI_ENABLED == ENABLED
...
...
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