Commit Graph

227 Commits

Author SHA1 Message Date
dongie 96dcfe9174 Added support for fast sbus2 protocol (used by newer receivers). Untested, thanks Cesco 2014-02-19 16:36:10 +09:00
dongie af13325f9e building hex file for servo center fix 2014-02-18 15:42:13 +09:00
dongie 30afff2578 got rid of feature_gyro_smoothing. nobody used that, and its retarded to do anyway. 2014-02-18 15:27:53 +09:00
dongie 9d421b4a67 removed rc averaging for serialrx sources - suggested by cesco 2014-02-18 12:12:08 +09:00
dongie 0c46bdbfc8 added cli settings for pidvel
added (unsupported) GPS nav MSP numbers.
2014-02-04 08:21:40 +09:00
dongie a695ddd66a added sumd serial receiver support by cesco/Plüschi 2014-01-31 10:02:50 +09:00
dongie 92c0947d7f bump config version after PID default changes and add built hex file 2014-01-28 10:03:30 +09:00
dongie e4746e60cf hex to match latest source commits 2014-01-26 09:32:12 +09:00
dongie 8c4a594808 build for throttle angle correction 2014-01-15 22:06:31 +09:00
dongie a206965854 adding support for maxthrottle and mincommand in MSP_SET_MISC now that all the tools can use it. 2014-01-15 19:37:31 +09:00
dongie 1dea496fd5 build for mixer update 2014-01-01 19:44:33 +09:00
dongie 13324c9f88 build binary for the previous GPS baud rate index fix 2013-12-27 08:37:17 +09:00
dongie 44adda8b3b gps fix build 2013-12-24 23:46:18 +09:00
dongie 7fec1b3a69 git fucking shit up again. been building with wrong gyroscale for weeks. way to fucking go. everyone upgrade to this. 2013-11-26 11:59:18 +09:00
dongie 1cbbe0b110 airplane mixer will now actually output servo data 2013-11-14 20:28:33 +09:00
dongie e1087cf921 fix returned size in MSP_MISC, should correct CRC errors in other GUIs and correctly work with MSP_SET_MISC in MultiWiiConf 2013-11-02 12:40:56 +09:00
timecop@gmail.com 609df47cd4 tri gyro data reading fix - closes issue #18
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@464 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-11-01 00:47:05 +00:00
timecop@gmail.com 2d076db908 Built firmware to match r460.
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@461 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-10-28 23:49:06 +00:00
timecop@gmail.com 3bb1063001 fixed buzzer on rev5 boards;
added experimental gyro-based headfree boxes

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@429 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-10-04 14:36:34 +00:00
timecop@gmail.com 800ce6bdf7 fixed a fuckup with yaw_rate that was caused by more 8bit leftover garbage
fixed althold vel/constrain typo thx Marcin
flight-tested this build on my shitcopter, CAREFUL flight testing may commence.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@428 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-10-04 01:51:31 +00:00
timecop@gmail.com edb0ef01b7 fixed mag gain during testmode (thanks pm1) and added some explicit float definitions to mag test code.
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@396 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-09-12 10:50:13 +00:00
timecop@gmail.com 509e349e69 Whitespace/compiler warnings cleanups by Dominic Clifton;
Slight tweak of new althold defaults
NOT-flight-tested .hex committing so people can commence with althold testing.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@391 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-08-31 01:40:13 +00:00
timecop@gmail.com 3b8c1841f8 new SPI2 driver w/testcase
5883 and 6050 driver updates

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@363 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-07-02 02:52:33 +00:00
timecop@gmail.com 57cbd784a9 a couple optimizations for dynamic HSE frequency - moved SetSysClock() to run after reset vector + bss init, and changed rcc which used hardcoded HSE_VALUE.
turn off leds/beeper before initializing pins to prevent flash at startup
uninitialized errorAngle fix in new PID


git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@362 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-07-02 00:58:50 +00:00
timecop@gmail.com e010e3a354 Cleaned up SetSysClock to remove duplicated code when configuring HSE or HSI
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@359 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-06-30 06:25:24 +00:00
timecop@gmail.com e4ea700fe0 reverted cli line editing stuff - was more trouble than its worth, and caused issues with hercules
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@358 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-06-29 15:48:43 +00:00
timecop@gmail.com d442c9dfb6 initial pass at gpio cleanup. removed almost all dependency on stdperiphlib (remaining exti).
slightly modified initial pin configuration, but this needs rework soon anyway.
couple spacing/line ending/formatting fixes in sonar driver file while fixing gpio there.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@357 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-06-29 14:09:54 +00:00
timecop@gmail.com 4bd505972d renaming of serial bool returning vars into isFoo(), also fixed bool returned as uint16_t type
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@354 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-06-25 07:09:47 +00:00
timecop@gmail.com 539f2cb6db acctrim was broken because changes were never getting saved.
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@353 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-06-22 09:11:41 +00:00
timecop@gmail.com c4a1c57b91 careful flight testing may commence
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@351 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-06-20 01:17:20 +00:00
timecop@gmail.com 82130ca60f amazing patch from jef78m for cli set
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@350 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-06-20 01:15:42 +00:00
timecop@gmail.com 3f8fc1b509 oops, this is NOT ready for public consumption yet.
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@305 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-05-02 14:17:05 +00:00
timecop@gmail.com c26603dd72 some more minor updates from 2.2
added variable for gyro_cmpfm factor (mag) to configurables
changed gyro_cmpf factor to 600 (higher gyro influence)
got rid of GYRO_INTERLEAVE stuff (didn't work, obsolete)
got rid of applyDeadband hacks, invsqrt hacks, and other shit. ifdef'd original baseflight attitude/heading calcs w/new 2.2 routines
fixed cockup in altitude calculation w/applyDeadband
remaining: GPS

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@304 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-05-02 14:07:52 +00:00
timecop@gmail.com bba9bc291f added some more configurable frobs to cli. commit before 2.2 merge.
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@288 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-03-11 06:18:20 +00:00
timecop@gmail.com 600f50ecac added MSP_UID patch from cGiessen
added sending cell voltages (faked) via frsky telemetry by fiendie
two additional cli commands (aux and dump) from jef79m - aux allows setting switches from command line, dump creates a copy-pasteable config which can be sent to a new board.


git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@283 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-03-04 00:17:50 +00:00
timecop@gmail.com c88614046b reversed o/n meaning from previous commit to actually mean what I said :)
n = new rev (fullscale acc)
o = old rev (halfscale acc)


git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@279 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-02-22 15:57:29 +00:00
timecop@gmail.com bc627783f8 removed mpu6050_scale cli since it's now autodetected.
the value is now printed in the status command, after MPU6050 as MPU6050.n = new revision, MPU6050.o = old revision.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@278 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-02-22 11:04:32 +00:00
timecop@gmail.com fc185b8e15 rewrote mpu6050 revision sensing code to match that of eMPL from Invensense.
Also changed scalefactor for acc to 256/512 to match multiwii code. untested/etc, proceed with caution.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@276 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-02-21 08:59:27 +00:00
timecop@gmail.com 4c0fe94072 further accuracy improvement for mag calculation.
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@263 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-02-07 04:59:29 +00:00
timecop@gmail.com d1d6a5d5ef very nice proper magnetometer vector rotation from crashpilot1000
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@261 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-02-06 04:08:10 +00:00
timecop@gmail.com 785443789c third time's the charm (fixed + confirmed tiltmix gimbal)
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@251 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-01-16 11:11:13 +00:00
timecop@gmail.com fc4693af3a let's try this again (simple gimbal sign fix)
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@250 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-01-12 12:49:26 +00:00
timecop@gmail.com a1ac53c841 changed cpu to CBT6 in release build;
maybe fixed simplegimbal mixer;


git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@249 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-01-12 08:26:24 +00:00
timecop@gmail.com bd08f337e7 Ah, finally fixed spektrum stuff. after PWM rewrite, spektrum init ended up before pwm init, so when rcReadRawFunc was assigned, it was always set to PWM. oops. Thanks to Cerberis @ irc for the patch.
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@240 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2013-01-05 01:13:18 +00:00
timecop@gmail.com 006e6629f6 Added GIMBAL_MIXTILT (16) to gimbal_flags. Setting gimbal_flags=16 will use "mixed" gimbal i.e. SERVO_MIX_TILT from MultiWii. Untested, but should work(tm).
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@239 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-12-27 13:23:43 +00:00
timecop@gmail.com e7bc3cc38e oops.
spektrum support was broken, now fixed.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@238 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-12-24 14:54:37 +00:00
timecop@gmail.com af7e135d75 fix from frog32 for external adc channel allocation;
fix from mwc forum for frsky telemetry gps output

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@237 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-11-12 09:08:16 +00:00
timecop@gmail.com 12dfa8915d slight improvement to motion threshold calculation
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@234 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-10-27 07:34:45 +00:00
timecop@gmail.com 23acf529d7 implemented using one of RC inputs as ADC channel for power meter.
added MSP_ACC_TRIM stuff for android GUI.


git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@231 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-10-19 02:43:27 +00:00
timecop@gmail.com e59f639951 made gyrodiff for motion detection configurable, 0 = disabled
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@230 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-10-14 00:34:23 +00:00
timecop@gmail.com 0976133f1f added acc_trim stuff into cli
spacing/indentation fixes
flyingwing is somewhat supported, reflect that in comment
added anti-moron gyro calibration routine... if model is getting moved while its arming... don't calculate gyro avearage because its gonna be wrong... example of fail see here: http://www.rcgroups.com/forums/showthread.php?t=1749966

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@229 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-10-13 12:08:56 +00:00
timecop@gmail.com 9fc43d5357 fixed MPU6050 sig stuff, d'oh
added sensor axis orientation stuff to cli... not the most optimal way but surely one that uses least code, lol!

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@228 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-10-08 13:50:48 +00:00
timecop@gmail.com 021b486916 added ability to swap sensor axises dynamically. still needs a sane way to configire in CLI, though.
adjusted all drivers for the new align stuff.
commented out default config setting values to zero - memset already did that.


git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@227 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-10-07 18:03:42 +00:00
timecop@gmail.com 193902079c moved some readonly strings to flash, thanks zyp
cleaned up frsky telemetry a bit with verbose telemetry ID names, changed loop timing a bit, added output for heading and voltage (when vbat is enabled). telemetry stuff is untested, so someone try it out.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@226 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-10-07 14:58:12 +00:00
timecop@gmail.com 005308b430 Applied patch from trunet for running at 64MHz off HSI for broken Chinese kcopter clones
status in cli now prints cpu MHz, 72 when running off crystal, 64 when running off intrc.
corrected WHO_AM_I check for mpu6050 when it's used on alternate address (AD0 high).
corrected PWM driver to consider CPU clock for timer prescalers - now things properly work below 72MHz
added a neat hack for pitch angle calculation so that it's not affected when roll reaches 90deg
added proper math for vector rotation instead of small-angle approximation

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@225 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-10-06 14:40:24 +00:00
timecop@gmail.com 4a4c0d585d sign error in HEX6P mix.
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@224 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-09-23 11:41:02 +00:00
timecop@gmail.com 1dea2b3b3b integrated tommie's eeprom sanity check. much less chances of new firmware screwing up due to old config version.
fixed pwm init for airplane mode mistakenly deleting motors from the mix. flyingwing should really work now.
removed led debug from althold


git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@223 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-09-21 04:12:17 +00:00
timecop@gmail.com 9d5bfdb60b forgot to add lpf_for_velocity into tunables for new althold
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@222 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-09-20 01:47:22 +00:00
timecop@gmail.com 2544c290ae enabled mahowik althold by default. let the users figure it out.
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@220 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-09-19 11:14:12 +00:00
timecop@gmail.com 817eb09b8a fixed bug in soft_i2c driver (doesnt affect anyone except testing)
added VAR_FLOAT to cli - now allows setting/printing float vars
fixed newlines in pwm driver
exported new althold tunables to cli (some are floats) - still not enabled by default until I know it works

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@219 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-09-18 13:29:35 +00:00
timecop@gmail.com f3ce558871 flying wing servo output fix
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@218 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-09-12 10:39:30 +00:00
timecop@gmail.com a139b96de6 fixed bug with MTK init - stuff was sent without delay while changing baudrates, and it would wreck stuff - changing rate mid-buffer. oops. should work now.
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@216 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-09-12 02:15:14 +00:00
timecop@gmail.com 70884d69d5 bring back flying wing w/all configuration options
config version bumped, settings cleared.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@213 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-09-09 11:35:35 +00:00
timecop@gmail.com b94c13b1c5 allow using GPS in PWM input mode. This (obviously) reduces number of available channels by 2.
I heard thats not a problem since tarduino only allows 4RC+2AUX channels anyway! If you want more, upgrade to PPM.
So you use RC3/4 for GPS, and connect the rest of the channels as usual. Channels used for GPS uart are
skipped, so no changes to 'map' are necessary. Simply connect in order.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@212 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-09-08 12:53:55 +00:00
timecop@gmail.com 4ed57b2696 fix for airplane pwm mode - variable wasn't initialized, resulting in non-working motors on some compilers.
synced angle/horizon mode stuff from mwc. no idea what it does.
perhaps the most important part of this update:
-errorAngle = constrain(2 * rcCommand[axis] - GPS_angle[axis], -500, +500) - angle[axis] + cfg.angleTrim[axis];
+errorAngle = constrain(2 * rcCommand[axis] + GPS_angle[axis], -500, +500) - angle[axis] + cfg.angleTrim[axis];
(which means GPS might actually work).

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@209 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-09-08 08:15:16 +00:00
timecop@gmail.com 3cd8e4e3f6 added printf() support via SpareTimeLabs printf lib. this cleaned up some mess inside cli.c
example of usage: http://bcas.tv/paste/results/xToE9w26.html
hover-tested quadx loaded as custom mix, works.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@207 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-09-06 06:35:02 +00:00
timecop@gmail.com 98cba890e1 moving towards custom mixer table and proper fixedwing mixer.
refactored all of mixer.c to use tables instead of hardcoded mix.
custom mixer is stored in flash, but currently has no UI to configure it.
do not choose mixer CUSTOM in console.

hover-tested QUADX, if upgrading anything else, please carefully check motor response first, preferably without props on heavy models.
tec

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@206 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-09-05 23:44:55 +00:00
timecop@gmail.com fef43457c0 buffer overrun in cli parser, increased command buffer. oops. thanks nicodh.
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@205 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-09-05 06:58:57 +00:00
timecop@gmail.com b2bc4bf9e6 Finished merging GPS autoconfig + ubx protocol code.
use set gps_type=X in cli to configure, where X=0 if NMEA (no special config), X=1 if UBX (enters ubx binary mode), X=2 if MTK (sets up MTK for 5Hz operation).
changed default GPS rate to 115200 baud
added baudrate reset stuff to UART driver for GPS autoconfigure
NONE of this is tested (except UBX working on my window)

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@204 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-09-04 16:26:46 +00:00
timecop@gmail.com 80d7ba604b merged multiwii GPS code from 1097. still no support for UBX, or GPS auto-config, soon.
added interrupt pins from mag/mma/mpu for rev4 hardware. nothing done with them yet - candidates for EXTI use
added tx buffer to UART2 (gps) in preparation for auto-config


git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@203 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-09-04 09:13:59 +00:00
timecop 70db9006af mag init after gyro
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@202 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-08-23 23:50:52 +00:00
timecop fd9d077d8b I2C bypass mode permanently enabled on MPU6050.
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@201 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-08-22 23:59:34 +00:00
timecop 10570a6579 i2c no-ack fix (never actually worked properly, fixed now)
bumped config version, or else r198 crashed on update from recent version
airplane mode config passed to drv_pwm


git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@199 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-08-21 05:41:58 +00:00
timecop e6cb4a0b1c cleaned up bmp085 driver
added ms5611 driver
refactored pressure sensor subsystem to allow multiple sensors
couple changes in PWM driver to make motor/servo arrangement for airplane mode more intuitive
moved MAX_MOTORS/MAX_SERVOS etc into drv_pwm.h
staring to merge back in airplane/flyingwing mixes
fix for tri servo display - mwc moved it to servo[5] again, gui was broken, function not.
will probably implement custom mixer soon (motors only, no servos)


git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@198 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-08-20 10:25:10 +00:00
timecop ee76242525 rewritten and cleaned up PWM driver
this has been hover-tested.
all current functionality *should* work even though the driver has been rewritten.
please test carefully, especially servo configurations!

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@197 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-08-17 06:48:30 +00:00
timecop 288d0ca4a6 committing built firmware w/currentTime fix
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@195 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-08-15 08:48:07 +00:00
timecop e894dba995 fixed bug in mpu6050 accel code
added mpu6050 acc scale factor fixup for es/non es chips (exposed as cli option as well)


git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@191 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-08-07 08:00:16 +00:00
timecop ecda218e8f added support for l3g4200d i2c gyro, autodetected
added motors off in hardfault handler, so we drop to the ground on hardfault.


git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@190 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-08-05 01:57:51 +00:00
timecop 75adda0597 allow 0 for looptime to go back to not-rate-limited loop.
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@183 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-07-21 07:06:19 +00:00
timecop c98113b82c synced with mwc 2.1. it's suprising how many "new" things in 2.1 didn't actually matter on a real platform.
removed camtrig stuff since it wasnt possible. somewhat replaced with aux forwarding (see below)
2.1 buzzer code changed, untested.
removed flying wing mixer. nobody used that. 
added alt_hold_throttle_neutral, nav_slew_rate and looptime configuration to cli. default looptime set to 3000. changed default gyro_cmpf to 400 to sync with 2.1.
increased bmp085 oversampling
added gimbal_flags (bit 4 set) flag which, in PPM mode, forwards AUX1..4 to the lower 4 PWM outputs instead of using them as motors. set gimbal_flags=8 to test it out. output is fixed to 50Hz.
merged 2.1 gps changes (not many)
casting in gyro smoothing (nobody uses that anyway)
calibrate accel in gimbal mode, set smallangle in gyro-only mode
vtail4 mixer fix
flight tested on quadx w/ppm.


git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@182 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-07-20 14:53:15 +00:00
timecop e70d7b5d16 added softi2c source file (oops)
changed gpio speeds to 2mhz from 50, nothing is toggling at 50mhz here. reduce ringing/noise.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@181 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-07-14 07:43:18 +00:00
timecop 23d11299b8 added test driver for software i2c. disabled by default. no, that wasn't the cause of cycletime jumps.
increased flash size to 128k, moved config data in last kbyte of that. as a result all settings are reset, please save them.
corrected hex6x mixer.
added telemetry to makefile.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@180 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-07-14 02:00:39 +00:00
timecop 829331c020 added pidalt stuff into cli
added a modifier for set (type "set *") to see min/max values for each parameter. this is for gui stuff
bumped config VERSION
fixed 0xffff - now stuff in drv_pwm, after it was mentioned to me for the  3rd time :p
replaced some uint8_t -> uint32_t for loop counters - saving 4 to 8 bytes of flash each time. thanks goes to thee 35+ years of C experience kicad guy.
turned bitfiends into a regular struct - instant 100byte flash size reduction

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@174 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-07-02 15:47:12 +00:00
timecop c998f5ca67 added support for outputting FrSky telemetry by silpstream @ rcgroups
feature TELEMETRY to enable it. when armed, telemetry is sent out the TX pin. It must be connected to 'Rx' pin of FrSky telemetry receiver via a level shifter. When disarmed, port goes back to 115200 bps for GUI.
fixed a typo in imu.c introduced by  GYRO_INTERLEAVE junk.
todo: just switch serial speed instead of reinitializing everything.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@173 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-07-01 15:32:45 +00:00
timecop 9c2204c179 synced serial protocol to multiwii-dev 20120622
changed booleans to bitfield struct to match with 0622
no other functional changes, and not all enhancements (like boxlight) from 0622 are implemented yet
NOT flight tested, use at your own risk.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@172 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-06-30 13:20:53 +00:00
timecop 2fd5645dce made sonar support compiled in (lol)
changed PPM pulse idle detect to 2.7ms per JimDrew instructions
updated keil project w /sonar source files.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@168 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-06-26 01:36:58 +00:00
timecop 4366c7f0d4 adding sonar support from sbaron, disabled by default.
docs: http://www.rcgroups.com/forums/showpost.php?p=21903320&postcount=3827

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@166 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-06-15 13:53:49 +00:00
timecop 09de7d7d03 rebuild FY90Q version.
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@165 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-06-14 06:40:25 +00:00
timecop f73ccdd0a9 fixed mma driver ID;
fixed a boner #ifdef typo in imu.c
go back to gyro glitch stuff in sensors.c
do gyrocal during acc cal as well

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@164 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-06-14 04:12:23 +00:00
timecop 8fb580d3f5 added FY90Q buyild target to Makefile
fixed mag calibration finally I think...
heading + mag declination calculation done using better precision.
increased gyro bias calculation to 1000.


git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@163 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-06-14 03:35:23 +00:00
timecop 572d5827cc took out cycle counter stuff for timing, now using systick + counter strictly. ... seems improved loop precision a bit.
put gyro interleave under define. this needs to be cleaned sometime.
took out "gyro glitch" stuff that was leftover from  nintendo days.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@162 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-06-07 15:29:37 +00:00
timecop 19ca85963b trashed uvop keil file since that was system-specific stuff.
applied mwc-dev GPS code with bits of tarducopter code by sbaron. Thanks again. Moved some of the GPS config stuff into cli - gps_lpf, min/max nav speed, nav_controls_heading. Remember I don't test any GPS functionality at all, so if this makes your quad fly towards North Korea at over 9000cm/sec, this is NOT my problem.
spacing fixes in a couple files.
trashed old serial code that was under #if 0


git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@161 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-06-06 15:09:44 +00:00
timecop 12d6c41407 oops, my retarded arm fix disabled all arming :)
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@160 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-06-01 03:15:22 +00:00
timecop 49653ec65e rearranged accelerometer autodetect code and allow user override by "set acc_hardware" in CLI (0=autodetect,1=adxl345,2=mpu6050,3=mma845x)
added arm/disarm on left/righ roll while throttle down to  configuration options and disabled it by default. "set retarded_arm" in CLI
put gyro_cmpf_factor into settings. default is 310, can be increased to decrease acc influence. debug use only.
dropped acc_lpf_factor back to 4. those who want it at 100, make it so.
cleaned up MPU6050 driver with humanreadable register names
got rid of MMGYRO crap - no use


git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@159 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-05-31 17:28:05 +00:00
timecop 59ccf93dd3 added driver for MMA8452QT accelerometer
added mag_declination set option to cli - oops
status in cli now prints which ACC hardware is used. work in proress to show difference between hardware with MPU6050 and MPU3050


git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@157 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-05-18 16:01:10 +00:00
timecop b929f79b54 Fix for shipping MPU6050 versions (AFS=2 fix, only affected a couple sample boards with MPU6000-ES, MPU6050-EL now works).
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@156 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-05-17 15:22:04 +00:00
timecop 18db641282 readded support for failsafe (thanks rimshotcopter for bugging me about it for a month)
new config ooptions for failsafe, so current settings are cleared
fixed mistake where yaw servo stuff for tri was still hardcoded even though it had configurable values in cli
reduced level default D to 20 from 100 (dunno what effect this has, shrug)
untested, enable feature FAILSAFE at your own risk.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@155 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-05-09 05:29:30 +00:00
timecop 6da3320be8 oops.
mistake in serial.c which made it impossible to do 'R' anymore.
fixed.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@154 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-05-06 14:42:00 +00:00
timecop 941f2f1762 added improved mag calibration from http://www.multiwii.com/forum/viewtopic.php?p=13334#p13334 (thanks EOSBandi)
new hex file only works with Java GUI 20120504-dev :( WinGUI is still not updated. Use latest release version on downloads page if want to use WinGUI.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@153 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-05-06 09:58:03 +00:00
timecop 910df63a7f fixed motor output when using spektrum.
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@151 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-05-04 01:59:37 +00:00
timecop 26b2031e24 fixed cli version from pre-3 stuff
increased gyro complementary filter factor to 500 to reduce acc influence (should hopefully fix random walk stuff?)
fixed a bug in servotilt stuff (maybe?)

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@150 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-05-01 00:07:22 +00:00
timecop f3a4e9f731 fix for pwm preload (not possible with this firmware, reported by marcin)
added gimbal flags to mixer. allows making gimbal tilt only or pantilt or disabling all pan/tilt by aux3/4

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@149 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-04-10 07:19:57 +00:00
timecop 4087cc0ca7 corrected gyro scale factor for MPU3000/6000
fixed fy90q battery adc (which didn't actually exist)
spektrum channel order is configurable by 'map' command (maybe).

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@147 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-04-09 15:01:51 +00:00
timecop d9920756d9 Initial support for FY90Q hardware
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@146 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-04-08 14:46:50 +00:00
timecop cb334ecf47 fixed acczero offsets to 0 on initial eeprom cleanup
added fifo mode to adxl345 driver, currently disabled. work in progress.
fixed output for PWM 5-8 when used with PPM + camstab + abovequad configs.
fixed baro, now alt-hold actually works. silly copypaste typo.
trashed all remaining parts of power meter and lcd configuration stuff. useless.


git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@145 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-04-07 15:29:00 +00:00
timecop 9e5504acd8 added a fix for roundf() and friends for keil
added float-based acc lpf, acc_lpf_factor values now changed, its 1/factor now, values 60+ and larger filter heavier.
playing with release MPU6050 hardware, looks like acc1G is fucked, as predicted
bug in serial output (forgot to output armed bit to GUI, estalt is /10)

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@144 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-04-06 02:23:25 +00:00
timecop 861b274039 fixed up mpu6050 DMP stuff.
increased i2c send buffer to 16bytes (was needed for DMP)
decreased interrupt priority of both uarts - with GPS running at 115200, this would cause I2C errors (i2c interrupt must be highest priority).
GPS was tested with $25 FMP04 GPS module ghettoed up outside my window, locking 5 satellites in a few minutes.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@140 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-04-02 16:08:24 +00:00
timecop 703234b608 renamed 'tilt_*_prop' stuff into gimbal_[axis]_gain and added more dynamically-configurable gimbal/camstab stuff into cli.
whitespace fixes in mw.h and trashed the old XA-XB based mixer setting leftovers.
settings are cleared again due to updated config struct.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@138 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-03-31 03:52:16 +00:00
timecop 58eb2b966f added configurable motor and servo period settings (50-498Hz). both set by cli, default is 50 for servo, 400 for motors.
removed feature digital_servo since its now set by cli instead.
added proper tx end check into uart, to remove delay inside printing out set values and tx buffer overrun during help()
instead of passing a bunch of params to pwm driver, made a config struct
fixed a bug in gps baudrate
fixed typo in stmloader.c
whitespace / indentation cleanups in various drivers

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@137 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-03-30 09:49:00 +00:00
timecop c98b6b30af main uart baud rate commit before tearing stuff up
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@134 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-03-29 06:00:22 +00:00
timecop da5ac020e1 added gps baudrage config setting
renamed gcc startup file to .S (breaks some lunix dudes apparently)
ppm sum handler waws hardcoded to TIM2 instead of using passed parameter. fixed. (thanks sbaron)
invalid data from pwm/ppm read are returned as midrc, not 1500. (robert_b)


git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@133 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-03-27 12:55:44 +00:00
timecop e0537e5aa0 nice boner in PWM output
now fixed.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@131 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-03-26 16:11:28 +00:00
timecop 96829b7306 synced code with multiwii 2.0 release
split uart2 initialization inside drv_uart. added receive data callback to use either with GPS or spektrum satellite
added spektrum satellite support, also freeing up 4 motor outputs for hexa/octo/camstab
configurable acc lpf and gyro lpf via cli
configurable (build-time) temperature lpf on baro. seems mostly useless.
fixed a nice boner bug in mag code which ended up multiplying magADC twice with magCal data.
fixed mpu3050 driver to allow configurable lpf, also broke other stuff in the process. considering moving this sort of stuff to "init" struct for sensor.
pwm driver rewritten to fully disable pwm/ppm inputs (such as using spektrum satellite case)
cleaned up double math in gps.c to use sinf/cosf etc
removed TRUSTED_ACCZ since its useless anyway
whitespace cleanup

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@130 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-03-26 15:28:36 +00:00
timecop fd9d986169 added printing detected sensors in 'status' in cli
took out leftovers of old dynamic mixer binary protocol - now cli sets it.
added some mpu6050 DMP stuff - all disabled by default, only for testing stuff. ignore it.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@128 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-03-24 15:43:09 +00:00
timecop 007e033364 committed (untested) GPS support by sbaron;
fix for channel map cli stuff by simonk.
reindented some code, so changes are large.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@127 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-03-24 09:27:40 +00:00
timecop 0534444b2d temporarily removed throttle calibration. broken until further notice.
implemented channel order selection (map in cli). example "map AETR1234" -> ail, ele, throttle, rudder, aux1234. thanks simon for all the halp on this one. truly a mindfuck.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@126 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-03-24 07:10:17 +00:00
timecop 670390e7a6 ugh. only check 1st channel.
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@125 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-03-23 10:29:58 +00:00
timecop f39ed713cb cancel throttle calibration if any RC signal is detected
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@124 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-03-23 10:28:15 +00:00
timecop be56a148f6 send 1000us for low throttle during cal, not minthrottle.
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@123 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-03-23 04:47:33 +00:00
timecop 8318331f27 fixed mag calibration stuff as reported by multiwii dudes
added (untested) support for additional PWM output channels incase of PPM input - 4 more, so total of 10 outputs in this mode.
added (mostly untested) support for throttle calibration - short out PPM input connector with a bind plug and power up.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@122 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-03-23 03:59:15 +00:00
timecop c526d2f3b9 renamed orient to align for sensor orientation
implemented battery cell count auto detect (DJI, you can steal this source from me for your next product). automatically finds 2S..6S battery, and sets warning voltage accordingly
added new battery config -related stuff in cli, min/max cell voltage for non-lipo users. Defaults for lipo are 4.3V/cell (max) and 3.3V/cell (min).
added pid setting stuff into cli from nicodh
added 'status' command to cli to print out system info.
added build date/time to 'version' in cli, to track down stupid users.
config version bumped, settings are cleared again.
refactored battery voltage stuff a bit, and got rid of 3 levels of warnings. don't see any benefit at all.


git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@121 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-03-20 14:54:26 +00:00
timecop 8bcbf5e41e added mincheck, maxcheck, vbatscale to settings configurable via cli
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@120 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-03-18 06:06:45 +00:00
timecop c1cb4287b7 removed dependency on sprintf which caused gcc to puke (shock and horror).
uses code from here:
http://groups.google.com/group/comp.lang.c/msg/66552ef8b04fe1ab?pli=1

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@119 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-03-17 15:08:05 +00:00
timecop 2fc24b338e implemented various things for cli
added 'reset to defaults' to cli
got rid of 'servo' feature since that's not really a feature a user can set
added couple more configurable tricopter things to config struct.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@118 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-03-17 14:09:14 +00:00
timecop 2861482bb6 cli improvements by simonk
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@117 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-03-17 08:27:06 +00:00
timecop 7592316c04 added inflight acc cal as a feature (NOT TESTED NOT GUARANTEED TO WORK ETC)
changed gyro/acc to allow different drivers without recompile, this allowed adding mpu6050 support w/autodetect
moved sensor orientation code into driver - each driver provides its own
added support for mpu6050 - desolder mpu3050 and adxl345, replace with mpu6050 for instant ???
merged multiwii 2.0pre3 code changes (none that mattered except mag calibration and typo in baro stuff)
changes to sensor autodetect for new dynamic drivers
more of ledring stuff done (still doesn't work, so dont try)


git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@115 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-03-17 07:08:36 +00:00
timecop 07be618756 latest bulit hex is now in SVN to save time creating uploads.
these are NOT guaranteed to work, use with caution.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@112 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-03-13 15:34:05 +00:00