Commit graph

130 commits

Author SHA1 Message Date
Dominic Clifton
e6733b4dfc Cleanup status indicator code.
This primarily is to avaoid stalling the main loop when beeping and
flashing.

This is needed because oneshot ESCs do not receive updates when the main
loop is stalled.

Additionally the beeper code for sticks held in disarm position is
changed since it also clashed with profile selection.  Now profile
selections can be seen and heard clearly.

Other subsections of the system that changed the LED0 state while the
main loop is running have been updated to use the status indicator API
instead of blindly hitting the hardware which previously caused lots of
odd LED flashing behaviour - now it is consistent.
2015-05-29 23:37:33 +01:00
Dominic Clifton
0c1a6c5c2f Merge branch 'lock_active_features' of https://github.com/ProDrone/cleanflight into ProDrone-lock_active_features
Conflicts:
	src/test/unit/rc_controls_unittest.cc
2015-05-29 20:05:25 +01:00
Dominic Clifton
41d737e29a Merge pull request #869 from SteveAmor/remove_tricopter_yaw_gyro_smoothing
Remove tricopter yaw gyro smoothing from imuUpdate
2015-05-29 15:39:02 +01:00
ProDrone
bbb86b30fa Delayed motor PWM enable when using Oneshot 2015-05-22 00:30:29 +02:00
borisbstyle
4ec28b8cce Removed TPA from Yaw axis and Changed variable name
PIDscaler changed to PIDweight as it suits better and is more
understandable as it is percentage of the PID's used.
Yaw TPA is removed as I don't find it necessary after more testing
2015-05-11 09:18:05 +02:00
Steveis
318592b063 Removed tricopter yaw gyro smoothing from imuUpdate 2015-05-10 11:02:44 +01:00
borisbstyle
573146788b PID1 and PID2 TPA Implementation
PIDscaler is used to scale down the pids conforming TPA calculation
2015-05-09 00:52:18 +02:00
borisbstyle
7f69537f86 PID1 TPA Implementation 2015-05-08 15:20:53 +02:00
borisbstyle
da8bb6f6fc Yaw Expo Feature 2015-05-06 22:23:40 +01:00
Nicholas Sherlock
766f409bac Allow yaw at low throttle for airplane mixes
Fixes #824
2015-04-29 16:39:08 +12:00
Dominic Clifton
6360aa0dca Cleanup new beeper code. Decreases code-size, removes unneeded state BEEPER_STOP, reduces needs for some comments, removes some magic numbers, simplifies logic and improves maintainability. 2015-04-24 23:10:35 +02:00
Dominic Clifton
519586a5ce Merge branch 'refactoredBeeperCode_181_1' of
git://github.com/ethomas997/cleanflight into
ethomas997-refactoredBeeperCode_181_1

Conflicts:
	src/main/flight/failsafe.c
	src/main/io/beeper.c
	src/main/mw.c
2015-04-23 01:21:27 +02:00
Dominic Clifton
b2710b215e Fix typo in comment 2015-04-22 23:19:42 +02:00
Dominic Clifton
407f71ce6e Merge branch 'rework-failsafe' 2015-04-22 21:25:07 +02:00
Dominic Clifton
c085b2c61d Fix CJMCU build (broken in 08efc2e) 2015-04-22 20:24:23 +01:00
Nicholas Sherlock
08efc2e66d Fix tri_unarmed_servo (was broken by pid_at_min_throttle changes) 2015-04-19 21:37:51 +12:00
Dominic Clifton
c8c0c85656 First-cut of a refactored failsafe system.
* fixes issue where indicators would flash when SBus RX entered failsafe
mode.
* fixes bug where turning off a TX for an SBus RX would instantly disarm
when using a switch to arm when the channel went outside the arming
range.
* introduces failsafe phases to make the system more understandable.
* allows the system to ask if rxSignalIsBeing received for all RX
systems: PPM/PWM/SerialRX/MSP.  Also works when a serial data signal is
still being received but the data stream indicates a failsafe condition
- e.g.  SBus failsafe flags.
* failsafe settings are no-longer per-profile.

Untested: Sumd/Sumh/XBus/MSP (!)
Tested: SBus X8R, Lemon RX Sat, X8R in PWM, Spektrum PPM.
2015-04-16 01:31:12 +01:00
Dominic Clifton
f28158a5a7 Cleanup debug code. 2015-04-14 13:59:11 +01:00
E Thomas
f02d7403af Port of refactored beeper code 181_1
This the "Port of refactored beeper code #669" modification applied to
version 1.8.1 (4/4/2015) of the code.
2015-04-04 17:54:44 -04:00
pinkywafer
7220365575 RPM_Motor_Stop_Bugfix
using calculateThrottleStatus, send 0 as RPM when THROTTLE_LOW and
MOTOR_STOP
2015-03-31 19:06:15 +01:00
Jenny
40cc7697fe Update to Virtual Current Meter fix
now using rc_controls/calculateThrottleStatus()
unneeded dependencies removed.
2015-03-11 20:03:25 +00:00
Dominic Clifton
bc8e53a9d8 Rename some PID controller methods.
See #461.
2015-03-09 23:26:52 +00:00
Dominic Clifton
c0c2f8e285 Remove a suprious newline. 2015-03-09 23:04:54 +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
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
e40a3663d2 Remove failsafe vtable usage. 2015-03-09 23:19:21 +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
946f65601f Cleanup some enum values - using topic_type instead of type_topic. 2015-03-03 22:35:40 +00:00
Dominic Clifton
b6509dd1eb Merge branch 'master' into serial-cleanup
Conflicts:
	src/main/blackbox/blackbox_io.c
	src/main/config/config.c
2015-02-26 22:43:29 +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
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
5163bef0b2 Refactor serial port configuration, stage 1.
Tested and working:
* multiple MSP ports at different baud rates.
* cli on any MSP port.
* GPS
* gps passthough on currently active cli port.

Example config used for testing:

feature SOFTSERIAL
feature GPS
feature RX_PPM
serial_port_1_functions = 1
serial_port_1_baudrate = 115200
serial_port_2_functions = 128
serial_port_2_baudrate = 115200
serial_port_3_functions = 1
serial_port_3_baudrate = 19200
serial_port_4_functions = 0
serial_port_4_baudrate = 0

Known broken:
* Telemetry and shared serial ports
* Telemetry when unarmed.

Probably broken:
* Blackbox on shared port.

Untested.
* Serial RX.
* Blackbox.
2015-02-12 01:28:53 +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
Dominic Clifton
01b2ce0b36 IMU naming cleanup. 2015-01-31 22:23:38 +01:00
Joel Fuster
ec946ea7d5 Split filter into separate file for future reuse 2015-01-31 11:46:44 -05:00
Dominic Clifton
f77a762b48 Allow inflight adjustments for floating-point based PID controllers. 2015-01-30 20:54:34 +01:00
Krzysztof Rosinski
34cd8f466e MSP command for sonar altitude 2015-01-29 15:17:15 +01:00
Nicholas Sherlock
ec3d85ae92 Fix bug that allowed arming craft before gyro calibration completed 2015-01-26 16:56:23 +13:00
Pierre Hugo
be03ed95fa Renamed min, max and abs macros to MIN MAX and ABS. 2015-01-23 22:40:00 -08:00
Dominic Clifton
b64c71264c Renaming getRcStickPosition to getRcStickDeflection and moving to
rc_controls.c.
2015-01-16 01:00:40 +00:00
Dominic Clifton
b7462c0b3d Merge pull request #351 from nebbian/baseflight-pid-horizon-mode-tuneup_a
Baseflight pid (pid_controller=2) horizon mode tuneup
2015-01-16 00:50:12 +00:00
Nicholas Sherlock
a61f7eeddf Clean shutdown of blackbox (allows us to write "log completed" event) 2015-01-16 10:52:35 +13:00
Dominic Clifton
a981ac5103 Replace some tabs with spaces. 2015-01-07 23:04:29 +00:00
Ben Hitchcock
69d94c81e1 Second draft of the tuneup.
This uses ints for the sensitivity instead of mapping floats back and forth.
 Also the stick position is read directly, without the RC_Rate affecting this value.
2015-01-07 21:54:13 +08:00
Nicholas Sherlock
321fc717ab Merge remote-tracking branch 'upstream/master' 2014-12-27 20:00:45 +13:00
Dominic Clifton
347b156727 Avoid calling mwDisarm() when due to having auto_disarm_delay when using
switch to arm().
2014-12-26 20:22:13 +00:00
Dominic Clifton
bbf9e6db23 Rename disarmTime to disarmAt for clarity. 2014-12-26 20:02:10 +00:00
Dominic Clifton
84b197d5f8 Merge branch 'feature-autodisarm' of https://github.com/ledvinap/cleanflight into ledvinap-feature-autodisarm 2014-12-26 19:01:24 +00:00
Nicholas Sherlock
dfd8e5b2b0 Merge branch 'master' of https://github.com/cleanflight/cleanflight 2014-12-26 11:56:00 +13:00