Commit Graph

4168 Commits

Author SHA1 Message Date
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 ab509889ca stmloader serial fix from lianj
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@221 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-09-19 23:22:30 +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 a51bb66ad4 more mahowik althold changes. at least it doesn't shoot up in the air now on enable... but still nothing impressive.
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@217 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-09-12 07:09:45 +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 8e16d83a37 testing: merged patch from http://www.multiwii.com/forum/viewtopic.php?p=22485#p22485
no binaries, as it doesn't work at the claimed PIDs of 5.0-0.030-30

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@214 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-09-10 09:11:22 +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 ad1939591f oops, printf stuff forgotten to add to uv project.
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@208 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-09-06 06:54:06 +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 9b7e26b274 makefile fix to add l3gd driver
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@196 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-08-15 14:51:17 +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 9a842f6bb0 fix for 32bit overflow of currentTime killing baro/mag after 72 minutes (yes, someone noticed)
thanks to enots @ feenode.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@194 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-08-15 08:47:23 +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 ce1ec92a67 Makefile fix from zippe; Untested to build on Win32, but presumably works on Lunix, etc.
Now properly builds both Naze and FY90Q targets.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@167 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
2012-06-19 05:46:55 +00:00