1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-17 05:15:25 +03:00
Commit graph

386 commits

Author SHA1 Message Date
Dominic Clifton
edeaf37031 Add throttle servo for internal combustion powered airplanes to default
airplane servo mixes.

Also corrects names for BICOPTER; BIPLANE was mistakenly used.
2015-07-08 17:17:59 +01:00
Dominic Clifton
7b91524ba2 Replace gimbal_flags with FEATURE_CHANNEL_FORWARDING and gimbal_mode.
Gimbals are only one use of channel forwarding, PWM video switchers and
PWM buzzers are others.
2015-07-08 16:41:29 +01:00
Dominic Clifton
4ead898f6f Minor mixer cleanup. 2015-07-08 15:39:00 +01:00
Dominic Clifton
1431dfad7c Allow servo rules to use stabilised controlled throttle (e.g. for I.C
planes).

Note: The code ported from baseflight appears broken.
2015-07-08 15:25:12 +01:00
Dominic Clifton
774a36a2d5 Avoid print smix table header multiple times. 2015-07-08 14:48:23 +01:00
Dominic Clifton
99e0e55e17 Rename and re-order servo rule input sources 2015-07-08 13:59:52 +01:00
Dominic Clifton
7e12711763 Fix missing fixed wing throttle control. 2015-07-08 13:59:51 +01:00
Dominic Clifton
763c75873e Use 0 based index for motor and servo mix in CLI. Update
MSP_SERVO_MIX_RULES, MSP_SET_SERVO_MIX_RULE, MSP_SERVO_CONFIGURATIONS,
MSP_SET_SERVO_CONFIGURATION.  Delete MSP_CHANNEL_FORWARDING,
MSP_SET_CHANNEL_FORWARDING.
2015-07-08 12:54:09 +01:00
codepox
a76d956358 Fixed a bug: in 3D mode to stop the motors, send neutral3d value to the ESCs instead of mincommand.
This was causing the motors to go full negative for a short time everytime I left the CLI mode tab in the Configurator GUI.
2015-07-07 18:53:11 -04:00
Chris Campbell
1a0fdead4e Corrected default mixer values for octo flat X 2015-07-07 15:43:38 +09:00
Dominic Clifton
b5e18a90a2 Cleanup CLI
* optimize for code size.
* consolidate error message handling.
* replace similar error messages with identical ones.
* shorten all strings where possible.
* made less verbose.

This was required for the CC3D OPBL build.
2015-06-29 03:30:17 +01:00
Dominic Clifton
7a1d071efb Add support for custom tricopter mixer.
See #606.
2015-06-28 23:11:47 +01:00
Dominic Clifton
ea6a6ccb3d First cut of custom servo mixers.
Main rule logic and MSP commands ported from baseflight.

Gimbal mixer updated to use rules.  This allows us to remove more
conditional logic.  Operation of gimbal servos is now different.
2015-06-28 23:06:56 +01:00
Dominic Clifton
c142e3dfe9 Rename minLimit/maxLimit to angleAtMin and angleAtMax. Remove unneeded
MSP_SET_SERVO_LIMIT.  Bump MSP API version.  Add basic sanity checks to
MSP_SET_SERVO_CONF, reset all servos and adhere to the msp packet's data
size.
2015-06-28 12:22:14 +01:00
Dominic Clifton
0608601644 Ensure that all AUX channels are forwarded to any available unused servo
output.

Fixes #1051.
2015-06-26 17:22:47 +01:00
Dominic Clifton
7db626747d Allow all models to use servo tilt.
See #1006
2015-06-10 15:31:47 +01:00
Dominic Clifton
889b14df5f Support pan and tilt on fixed wing. Fixes #1006
The general idea is that nothing calls pwmWriteServo except for
writeServos() and that writeServos() knows which servos it has used.
2015-06-10 14:30:45 +01:00
Dominic Clifton
78b52c53d5 Calculate maxThrottleDifference before use.
* Easier to understand.
* Reduces code size by 32 bytes.
2015-06-10 12:15:50 +01:00
Dominic Clifton
bad3b11e28 Replace servo magic numbers and comments with constants. 2015-06-04 22:30:44 +01:00
ProDrone
b75de91f35 Instead of trying to latch the desired features...
...and apply them after a soft reset (which also required an additional
write to flash), it is now such that features and settings are modified
and stored in flash as before.

After initialisation completes, the active features are latched and are
not to be modified until the next startup. This guarantees that all
saved modifications are persistent even when power is switched of
(without a reset in between).

When a soft reset is required, the active features and the currently
configured features are used to detect if the oneshot feature has
changed state, in which case motor PWM outputs are stopped and soft
reset is done after a 1.5 second delay.

During normal operation the active features will not change and all
changes to features ordered via MSP commands or the CLI are applied to
the configuration that gets saved to flash.

The required effect of modifying features without changing the actions
in the running mainloop is achieved. The user needs to be aware that
changes to features are not applied immidiatly.
2015-05-21 01:27:45 +02:00
Dominic Clifton
22bf890cf0 Allow mixer to use failsafe throttle value that is less than
minthrottle.
2015-05-19 23:45:27 +01:00
Dominic Clifton
43a74f0d46 Merge pull request #917 from MJ666/yaw_jump_updates
Flight - Yaw jump updates
2015-05-19 21:20:48 +01:00
Dominic Clifton
cc5c736362 Fix failsafe_throttle being ignored if it was less than min_check
when MOTOR_STOP was enabled.
2015-05-19 21:16:24 +01:00
Michael Jakob
42218f1ea5 The yaw_p_limit minimum is now set to 100 to prevent misconfigurations.
Maximum value of 500 is now removing the limit (same as for
yaw_jump_prevention_limit)
Moving defines for PID controllers to headerfiles.
Some general code cleanup.
Documentation update
2015-05-19 17:42:03 +02:00
borisbstyle
16faced65a Update mixer.c
Make it possible to still be able to disable the jump protection at all by configuring the highest configurable value.
2015-05-01 17:23:29 +02:00
BorisB
c3522882f2 yaw_fix default values
Pull request #802 has by default disabled yaw jump. That is fine on the
most of the configurations, but one of my multirotors had an angled
motor due to crash and this was causing weird behaviour.
It is also possible to configure very low values, which can even cause a
craft to not be able to stop after yaw and I am talking about the values
below 100 like 1.

Anyway this fix provides only valid configurable values what can't cause
any danger. Also default parameter is not unlimited anymore and is
configured to 200, which is a safe value to anybody who does the
upgrade.
cli.md is also edited
2015-05-01 13:45:22 +02:00
Michael Jakob
2fd79a7aa2 This fix is for avoiding yaw overshoot and bounce back for some
configurations
The hardcoded limit in the mixer and PID controllers 3-5 would be
removed
by default and will be configurable by CLI variables:

yaw_jump_prevention_limit, global setting (original fixed value was 100)
yaw_p_limit, per profile setting (fixed value was 300)
2015-04-23 17:30:20 +02:00
Dominic Clifton
f28158a5a7 Cleanup debug code. 2015-04-14 13:59:11 +01:00
Dominic Clifton
4154afcb63 Adding a unit test for quad X motor mixers. 2015-03-21 11:30:03 +01:00
Dominic Clifton
8e6570754c Add the first unit test for the mixer.
See #16
2015-03-16 22:56:14 +01:00
Dominic Clifton
4a12d00d1e Moving mixer config out of the profile. It doesn't really make sense. 2015-03-09 23:00:44 +00:00
Dominic Clifton
ed434fe47b Use a positive named setting and variable instead of a negative one to
simplify the logic and aid understanding.
2015-03-09 22:50:27 +00:00
Dominic Clifton
acabbf41db Previously, at minimum throttle, the quad would do absolutely no self-leveling
and simply run the motors at constant minthrottle.  This allowed the chance
for the quad to lose control during flight if the throttle was set to minimum,
say, to drop from a high altitude to a lower one.

With this edit, the quad will still self-level at minimum throttle when armed,
allowing for safe decents from altitude.  To prevent motors spinning when
arming/disarming, the yaw input is ignored if the throttle is at minimum and
we're using the sticks to arm/disarm.

Conflicts:
	src/main/flight/mixer.c
2015-03-09 23:44:53 +01:00
Dominic Clifton
1b1163da10 Previously, at minimum throttle, the quad would do absolutely no self-leveling
and simply run the motors at constant minthrottle.  This allowed the chance
for the quad to lose control during flight if the throttle was set to minimum,
say, to drop from a high altitude to a lower one.

With this edit, the quad will still self-level at minimum throttle when armed,
allowing for safe decents from altitude.  To prevent motors spinning when
arming/disarming, the yaw input is ignored if the throttle is at minimum and
we're using the sticks to arm/disarm.

Conflicts:
	src/main/flight/mixer.c

added cli command disable_pid_at_min_throttle

(same as previous)
2015-03-09 23:42:42 +01:00
Dominic Clifton
5e3734946e # This is a combination of 2 commits.
# The first commit's message is:

Previously, at minimum throttle, the quad would do absolutely no self-leveling
and simply run the motors at constant minthrottle.  This allowed the chance
for the quad to lose control during flight if the throttle was set to minimum,
say, to drop from a high altitude to a lower one.

With this edit, the quad will still self-level at minimum throttle when armed,
allowing for safe decents from altitude.  To prevent motors spinning when
arming/disarming, the yaw input is ignored if the throttle is at minimum and
we're using the sticks to arm/disarm.

Conflicts:
	src/main/flight/mixer.c

# This is the 2nd commit message:

added cli command disable_pid_at_min_throttle
2015-03-09 23:36:54 +01:00
Dominic Clifton
b595b49ca8 Decouple roll and pitch rates. MSP clients take note of updated
MSP_RC_TUNING/MSP_SET_RC_TUNING commands.
2015-03-07 15:11:20 +00:00
Dominic Clifton
26bb86898e Updating comment in mixer.c 2015-03-07 14:15:38 +00:00
Ben Hitchcock
97fae94053 Bugfix for 3D inverted flight using a tricopter. The yaw servo now should reverse when the throttle is lower than the midpoint. 2015-03-03 11:47:35 +08:00
Dominic Clifton
05b1b5a9b2 Ensure motor[0] is used, see 46a0054d78 2015-02-26 12:15:15 +00:00
Dominic Clifton
8282bc76d2 Mixer code readability and code size improvement.
Naze target size before: 113412, after: 113388

Closes #551
2015-02-26 12:05:03 +00:00
Dominic Clifton
b9e1283809 Ensure motors are stopped before a reboot. Ensure hard fault handler
doesn't use potentially unitialised data to update the motors.  Pause
for 50ms before rebooting after updating disabling the motors to ensure
the timer hardware and ESCs havea chance to react.

This commit might help with #123
2015-02-23 14:02:47 +00:00
Dominic Clifton
9057d70410 Allow excluding of servo code at compilation time.
This is in preparation for backbox on CJMCU/64k.

Flight tested on CJMCU.
2015-02-22 16:21:03 +00:00
Dominic Clifton
debd72485b Avoid updating servos to servo middle every loop iteration. 2015-02-22 15:21:21 +00:00
Dominic Clifton
a1b01807cf Merge branch 'lowpass' of https://github.com/fusterjj/cleanflight into fusterjj-lowpass
Conflicts:
	src/main/flight/mixer.c
2015-02-22 14:55:04 +00:00
Dominic Clifton
55cac2bdeb Finally rename flight.c/.h to pid.c/.h. Cleanup some dependencies.
Relocate more code.
2015-02-01 00:39:38 +01:00
Dominic Clifton
53406a7ac7 Relocate some structures and code to the right places.
This cleans up the include file order somewhat and fixes a couple of
dependencies.

The goal of this is to rename flight.c/flight.h to pid.c/pid.h.
2015-01-31 23:47:51 +01:00
Joel Fuster
ec946ea7d5 Split filter into separate file for future reuse 2015-01-31 11:46:44 -05:00
Joel Fuster
4f0af41e79 Merge remote-tracking branch 'upstream/master' into lowpass 2015-01-31 10:47:39 -05:00
Dominic Clifton
a2b232e805 Detach midrc (input) from servo center (output).
This fixes incorrect servo center position when midrc was not 1500.
Most likely only experienced by futaba plane or servo/tilt users.
2015-01-27 23:04:41 +01:00
Pierre Hugo
be03ed95fa Renamed min, max and abs macros to MIN MAX and ABS. 2015-01-23 22:40:00 -08:00