1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 00:35:39 +03:00
Commit graph

107 commits

Author SHA1 Message Date
borisbstyle
10809ba6b6 Add Mixer quad1234 2016-01-13 23:08:14 +01:00
borisbstyle
83e932d3a3 Rework maxing out motors 2015-12-16 17:27:36 +01:00
borisbstyle
fdd984bc32 Increase Allowed Error to the mixer // Fix for uncontrollable roll when one motor is cogging 2015-12-15 23:56:21 +01:00
borisbstyle
6d51ab6e53 Better Clearing when toggling inbetween modes 2015-12-09 23:16:22 +01:00
borisbstyle
9ec26626b7 Accumulation Prevention in Saturation for AIR Mode // Refactoring
Adjust shrink threshold for errorRatio
2015-12-09 13:33:36 +01:00
borisbstyle
763ff23ede Further AIR MODE enhancements // Motor stop overules AIR MODE low throttle
reset iterm for motor stop

fix luxfloat
2015-12-07 10:16:32 +01:00
borisbstyle
400fe14e30 AIR MODE Optimalisations // Disable retarded arm
enable level modes
2015-12-06 23:58:18 +01:00
borisbstyle
83d186057f AIR MODE implementation 2015-12-06 02:19:35 +01:00
borisbstyle
eafa631a32 IDLE UP switch // Remove pid_at_min_throttle 2015-12-04 16:17:44 +01:00
Konstantin Sharlaimov (DigitalEntity)
5df8ca926c Quaternion-based DCM IMU (original code my S.Madgwick)
Restore binaries from merge
2015-10-22 10:45:36 +02:00
Dominic Clifton
8402f4512a Merge pull request #1276 from sherlockflight/3d-pid-at-min-throttle
Add support for pid_at_min_throttle = 0 for 3D flight
2015-10-12 20:27:53 +01:00
Dominic Clifton
28aad588cb Fix vtail mixer defaults. Closes #988
Previously the vtail mixer was a copy of the atail mixer which was
incorrect.

The new defaults cater for frames like the Armattan Morphling Vtail.
2015-09-05 18:03:02 +01:00
Nicholas Sherlock
be815ec070 Support pid_at_min_throttle = 0 for 3D flight 2015-09-01 01:46:44 +12:00
Dominic Clifton
5be2276b6b First cut of custom motor and servo mixer test.
Note: The test is rather heavyweight, more like an integration test than
a unit test, but will allow for the underlying code to be refactored.
2015-07-17 01:05:14 -07:00
Dominic Clifton
cc06113c8f Rename yaw_direction to yaw_motor_direction to avoid confusion
between `yaw_control_direction` and yaw servo configuration.
2015-07-13 01:54:45 +01:00
Dominic Clifton
9d4dbb4871 Merge branch 'octomixer' of https://github.com/iforce2d/cleanflight into iforce2d-octomixer
Conflicts:
	src/main/config/config.c
2015-07-10 00:47:22 +01:00
Dominic Clifton
783a4c4bfa Merge pull request #1066 from cleanflight/custom-servo-mixers
Custom servo mixers
2015-07-09 23:48:53 +01:00
Dominic Clifton
eb53855cd1 Fix CJMCU build - caused by a missed rename of mixerResetMotors to
mixerResetDisarmedMotors
2015-07-09 22:52:04 +01:00
Dominic Clifton
c9f5ca3faf Deleted code specific to fixed wing that set motors to mincommand when
disarmed.

Ensure that servo mixes that use calculated throttle output (motor 0)
adhere to the armed/disarmed state, this is achieved by ensuring that
motor outputs, including the effects of MOTOR_STOP are calculated BEFORE
using motor 0 as an input source for the servo mixer.
2015-07-09 20:23:37 +01:00
Dominic Clifton
84773a8c91 Fix vectored thrust code, flying wing != vectored thrust.
vectored thrust is too generic a term.  examples:
1) fixed wing with ailerons and fixed motors on each wing, yaw the plane
by changing the speeds of the motors 
2) fixed wing with ailerons and single motor at rear, yaw the plane by
pivoting the motor left or right

Both of the above scenarios are possible using MIXER_CUSTOM_AIRPLANE.

In baseflight vectored thrust was added in:
e3585df3a3 (diff-2c11cf77e56a7a330caeccadfc1d8bcdR448)

then broken in:
ce0300a344 (diff-2c11cf77e56a7a330caeccadfc1d8bcdL449)

see:
https://github.com/multiwii/baseflight/blob/master/src/mixer.c#L153
https://github.com/multiwii/baseflight/blob/master/src/mixer.c#L328-L329
https://github.com/multiwii/baseflight/blob/master/src/mixer.c#L546-L555
2015-07-09 19:53:37 +01:00
Dominic Clifton
c88a33495f Fix incorrect default flying wing servo mixer.
Baseflight code made both surfaces respond in the SAME direction when
using pitch OR roll.

Behaviour should be: 
apply pitch causes the control surfaces move in the SAME direction.
apply roll causes the control surfaces should move in the OPPOSITE
direction.
2015-07-09 18:10:52 +01:00
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