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

135 commits

Author SHA1 Message Date
Dominic Clifton
daa823ddba AltHold cleanup.
* Renamed several methods and variables so they make more sense.
* Move more altitude hold related code out of imu.c/h into
altitudehold.c/h.
* Fixed a unsigned integer being using instead of an signed integer in
the throttle calculation code.
2014-09-29 01:34:15 +01:00
Dominic Clifton
3eb8bcb3e5 Merge branch 'feature-sonar-flight-mode-no-baro' of dclifton-github.com:nebbian/cleanflight into nebbian-feature-sonar-flight-mode-no-baro
Fixed tabs, kept old references to VARIO.  Made SONAR mode a new option so that aux settings could be preserved.

Conflicts:
	src/main/config/runtime_config.h
	src/main/flight/altitudehold.h
	src/main/flight/imu.c
	src/main/io/rc_controls.h
	src/main/mw.c
	src/main/sensors/initialisation.c
2014-09-26 13:36:19 +01:00
Dominic Clifton
d60183d91d Normalize all the line endings 2014-09-15 23:40:17 +01:00
Ben Hitchcock
66fce423bb Code allowing the use of sonar without requiring a barometer.
This code has been flight tested on a Naze32 acro, with no barometer onboard.  It also works when the target doesn't have BARO defined.
2014-09-05 11:28:55 +08:00
Dominic Clifton
f5d9589f0a Disable debug output. 2014-08-24 22:53:06 +01:00
Dominic Clifton
3f0754d295 Replace global flags with stateFlags, flightModeFlags and armingFlags.
Each flag was previously a whole byte, now all of the flags only take up
4 bytes as they are represented by bit masks.

This is cleaner because the different kind of flags are now separated.

Additionally this changes the behaviour of arming slightly.  When using
a switch to arm the aircraft will not arm unless the switch has been in
the off state once.  This prevents arming if you power the aircraft with
a low throttle and the switch in the on position.
2014-08-24 12:11:30 +01:00
luggi
7917e44293 slow change althold now controls velocity directly
The throttle stick input now directly sets the vertical velocity
setpoint of the copter. (alt_hold_fast_change = 0)

Conflicts:

	src/imu.c
	src/mw.c
	src/mw.h
2014-08-01 22:52:08 +01:00
Dominic Clifton
ff82839f89 Fixing alt hold constraints to be 8192 instead of 8196.
The previous code before 5b1de9cce966c033ae7b01d9318161e0e40e08a8 was
using (x / 8) and then constraining using +/- 1024.  Removing the / 8 in
commit 5b1de9cce966c033ae7b01d9318161e0e40e08a8 should have meant the
new constraint values were (1024 * 8) = 8192.
2014-08-01 22:43:01 +01:00
luggi
75f94aa11b althold constants updated
baro velocity now limited to 15m/s
d-term is now smaller

Conflicts:

	src/imu.c
2014-08-01 22:39:23 +01:00
luggi
1bf806f54c make the accZ lpf used for althold configurable
set the variable accz_lpf_cutoff to the desired cutoff frequency
this can help to make althold smoother on copters with lots of
vibrations

Conflicts:

	src/cli.c
	src/config.c
	src/imu.c
	src/mw.h
2014-08-01 22:31:22 +01:00
Dominic Clifton
38cbe28e0f Apply accz pt1 element fixes.
See:
f7132b9d33211a55b8bd2c92f14da59f35b715a4
b1f58bc01fcf1632b3c3947a5ed0e807c2763a30
5832e2f67fcd2ee93044b300fda37a420c595813
a5961aeda657225fa843a115a94229313db4b2db
2014-08-01 21:10:26 +01:00
Dominic Clifton
9f1a0fcb4c Cleanup line endings. 2014-07-31 23:53:34 +01:00
Dominic Clifton
3d65e4ff96 Changes missed from last commit. 2014-07-31 13:47:46 +01:00
treymarc
9cf90fa230 smallAngle configurable, user can arm/disarm with swith in any
orientation
Conflicts:

	src/cli.c
	src/config.c
	src/imu.c
	src/mw.c
	src/mw.h
2014-07-31 00:25:24 +01:00
Dominic Clifton
e56535f4f3 Fix builds on targets that do not have sonar support. 2014-07-22 21:25:03 +01:00
treymarc
ae0f842266 rename/removed global var sonarAngle to tiltAngle , fix spaces/lines
Conflicts:

	src/imu.c
	src/main/drivers/sonar_hcsr04.c
2014-07-15 14:12:28 +01:00
treymarc
5253064b46 sonar althold
Conflicts:

	src/imu.c
2014-07-14 14:17:04 +01:00
Dominic Clifton
af87cff18f Fix debug output of alt-hold data, accSum was reset prior to output. 2014-07-02 18:51:27 +01:00
Dominic Clifton
668772f1f3 Explicitly use float literals in velocity calculation. 2014-06-24 00:30:58 +01:00
Dominic Clifton
f127847bf2 Some baro cleanups to avoid using or exposing incomplete and
uninitialised baro data.

imu code size reduction (treym)
2014-06-24 00:14:30 +01:00
Dominic Clifton
e30a373c92 Disable ADC debug output and enable AltHold debugging output. 2014-06-23 22:06:17 +01:00
Dominic Clifton
91bfdf05ca Move mw loop() code into separate methods. Cleanup related code.
If a given feature or mode is off the next task is not processed in the
current loop but will be processed during the next loop iteration for
simplification, this allowed the cleanup of return values in other code.
2014-06-23 00:47:45 +01:00
Dominic Clifton
f96bdf0965 remove unnecessary variable. unroll loop for better code size. 2014-06-18 23:44:35 +01:00
Dominic Clifton
0b9c326ffe Complete decoupling of imu code from config.
The giant list of unrelated includes is now gone and the dependencies
are now clear.
2014-06-07 02:44:06 +01:00
Dominic Clifton
2bbbf9937d Decoupling imu from config - acc_unarmedcal. 2014-06-07 02:27:07 +01:00
Dominic Clifton
3643c08475 Decoupling imu from config - acc deadband. 2014-06-06 21:37:41 +01:00
Dominic Clifton
51eee3d62c Decoupling imu from config - barometer config. 2014-06-06 20:59:59 +01:00
Dominic Clifton
82bb6b7982 Decoupling imu from config - pid profile. 2014-06-06 20:45:59 +01:00
Dominic Clifton
da73be1b2d Start decoupling imu from config. 2014-06-06 20:40:00 +01:00
Dominic Clifton
ab0296c991 Fix bug that prevented throttle angle correction working correctly when
using different values in different.

The cause was the IMU init code which triggered calculation was never
called after switching profiles - it couldn't be called twice because it
also initialised the compass.

The solution was to decouple compass initialisation from IMU
initialisation and extract the code to recalculate throttle angle scale
to a new method.
2014-06-06 20:39:59 +01:00
Dominic Clifton
e867af8c4b Correct project name in GPL notices. 2014-06-05 00:47:47 +01:00
Dominic Clifton
0bbcd6570f Updated source files to include the GPL v3 notices. Include a copy of
the GPL v3.
2014-06-04 16:48:23 +01:00
Dominic Clifton
18046013a4 Decouple sticks processing code from main mw loops.
Decouple led ring driver from non-driver code.
2014-06-01 18:36:33 +01:00
Dominic Clifton
4b437e8e08 Relocate battery code to sensors directory. 2014-06-01 16:58:16 +01:00
Dominic Clifton
d19a5e7046 Cleanup project structure. Update unit test Makefile to place object
files in obj/test
2014-05-31 22:43:06 +01:00
Renamed from src/flight_imu.c (Browse further)