James Cotton
900780e10c
Add bias estimation to the altitude fusion algorithm. Necessary to increase
...
the gains on acceleration and velocity feedback terms (they are a problem when
biased).
2012-02-19 11:38:09 -06:00
James Cotton
47fac7e31c
Move the throttle setting code for alt hold into the fast accel loop.
2012-02-18 18:16:15 -06:00
James Cotton
7d4582e5f0
Update the altitude KF to use the updated measurements appropriately and check
...
in the relevant matlab code to check it and genererate it. Produces quite
smooth traces.
2012-02-16 05:33:47 -06:00
James Cotton
c957172f8f
In the case of swapping in userspace due to the buffer being blocked during
...
ISR, make sure the latency is less than 50 us to avoid framesync errors. Still
seeing a few nonsense packets on Overo side but fairly few. Probably need to
add CRC to whole packet now and call it done.
2012-02-14 11:06:16 -06:00
James Cotton
1930d092eb
In the case where the overo scheduler cannot swap buffers (userspace loading
...
it) then set a flag so as soon as the buffer is loaded then we schedule it.
2012-02-14 11:00:29 -06:00
James Cotton
f04c58b0f4
Make the overo transaction occur based on the rising edge of the NSS line.
...
This fixes most of the frame sync problems. However, it's a bit hacky as
there is currently hardware information inside a module.
2012-02-14 10:37:30 -06:00
James Cotton
d018d93e88
Clean up previous commit a bit and make the sampling rate a variable (and adapt
...
the sampling time accordingly).
2012-02-13 01:49:54 -06:00
James Cotton
3acbfbe96c
Convert the pressure sensor code to most of the calculations as int64 to retain
...
precision.
2012-02-13 01:22:48 -06:00
James Cotton
4717af1afd
Swap telemetry port and gps ports back
2012-02-12 13:55:52 -06:00
James Cotton
f23f53dc4e
Add settings for the altitude kalman filter settings and init the state when
...
first measurement arrives
2012-02-12 09:07:27 -06:00
James Cotton
34ca5777dd
Kalman filter for altitude
2012-02-11 21:08:19 -06:00
James Cotton
d8f0494e57
Merge branch 'revolution' into revolution_overo
2012-02-11 20:02:20 -06:00
Alessio Morale
22b211167c
Ported pios_iap.c to F4
...
restored failed boot count check on pios_board.c for revo
2012-02-11 13:49:32 +01:00
James Cotton
3026527801
Now the desired altitude is relative to when the switch was flipped so that the
...
baro altitude module can use a smoothed altitude estimate for the starting
point.
2012-02-08 23:02:29 -06:00
James Cotton
80d602ef7b
Switch order of some commands to make sure it loads the correct hover throttle
2012-02-08 20:47:10 -06:00
James Cotton
ab41bae071
Separately smooth the error estimate from the derivative
2012-02-08 11:15:33 -06:00
James Cotton
60c951843d
Use backtracking to limit integral in altitude hold and smooth the velocity
...
error. Initialize the throttle integral better.
2012-02-08 10:39:31 -06:00
James Cotton
c6b1d6b8df
Rework the altitude hold code a bit
2012-02-08 09:42:10 -06:00
James Cotton
49a03a868b
Merge branch 'altitudehold' into revolution_overo
...
Conflicts:
flight/OpenPilot/UAVObjects.inc
flight/Project/OpenPilotOSX/OpenPilotOSX.xcodeproj/project.pbxproj
flight/Revolution/Makefile
flight/Revolution/ins.c
2012-02-07 23:00:29 -06:00
James Cotton
6ec0f06c80
Back to 1024 byte packets
2012-02-07 13:02:11 -06:00
James Cotton
2c60447200
Switch back to 512 byte packets and fix bug when writing the header size that
...
was smashing the crc
2012-02-07 11:32:04 -06:00
James Cotton
221a0c5e53
Add the number of dropped updates to the overosync stats
2012-02-07 09:13:26 -06:00
James Cotton
a89d425b23
Reset the received rate for overo sync object
2012-02-07 09:01:58 -06:00
James Cotton
02bec750bd
In the attitude loop need to check all the queues even if unused or the event
...
system will have warnings
2012-02-07 08:46:34 -06:00
Stacey Sheldon
e2939dae2a
revo usb: Add support for USB to Revo
2012-02-07 02:25:31 -05:00
Stacey Sheldon
8b73ae7d16
remove trailing whitespace
2012-02-07 02:25:31 -05:00
Stacey Sheldon
b8c16fe7a5
hw defs: move misc defines and non-const data out of board_hw_defs.c
...
The board_hw_defs.c file should only contain static
const declarations that only describe the hardware.
All other non-const variables should be put into one
of the pios_board.c files.
2012-02-07 02:25:31 -05:00
Stacey Sheldon
3c1b1001f9
f4 usb: Allow USB descriptors to be const through ST APIs
2012-02-07 02:25:31 -05:00
Stacey Sheldon
56102013aa
f4 usb: correct function prototypes in bsp template
...
This file is not actually used but it should still be accurate.
2012-02-07 02:25:31 -05:00
Stacey Sheldon
57f9f6e3d1
f4 usb: configure and build ST USB OTG and USB DEV libraries
2012-02-07 02:25:31 -05:00
Stacey Sheldon
1e79ed6d54
f4 usb: fix invalid reference to stm32f4_discovery.h
2012-02-07 02:25:31 -05:00
Stacey Sheldon
04b81f13a7
f4 usb: fix invalid references to stm32f2xx.h
2012-02-07 02:25:31 -05:00
Stacey Sheldon
266b95561f
f4 usb: rename device template to real config file
2012-02-07 02:25:30 -05:00
Stacey Sheldon
a4ae844f2b
f4 usb: rename otg template to real config file
2012-02-07 02:25:30 -05:00
Stacey Sheldon
58bbe0870d
f4 usb: allow device->host data to be const
...
This allows the application code to pass const
descriptors to the Tx APIs in the STM32 USB
library.
2012-02-07 02:25:30 -05:00
Stacey Sheldon
4b911bb3be
f4 usb: remove unused device class examples
2012-02-07 02:25:30 -05:00
Stacey Sheldon
efbe8bbfdd
f4 usb: convert all line endings to LF-only
...
Line ending changes only. No functional changes.
2012-02-07 02:25:30 -05:00
Stacey Sheldon
6a43d1c7ed
f4 usb: Import pristine STM32F4 USB Library v1.1.0
...
Taken from version STM32F4-Discovery_FW_V1.1.0 of the
library from ST.
2012-02-07 02:25:30 -05:00
Stacey Sheldon
240425ff22
gdb: add config file for revo bl
2012-02-07 02:25:30 -05:00
Stacey Sheldon
1532338847
ef: fix dependencies in entire flash image build
...
ef_$(BOARD_NAME).bin files were not properly depending
on their fw and bl files resulting in the ef files not
being regenerated.
2012-02-07 02:25:30 -05:00
James Cotton
ae01936808
Add the portTickTime into the OveroSync stream
2012-02-06 10:00:02 -06:00
James Cotton
dbcb499d7f
Add object to monitor the overo link status. Current just records the bytes/s
...
being sent and the connected status (based on sending more than 500 bytes per
second)
2012-02-06 09:37:31 -06:00
James Cotton
5b2376dbee
Remove the semaphore for buffer swapping and make this occur during the receive
...
ISR. This leads to a possible condition where a copy is taking place in
userspace and then a buffer swap interrupts it. However, the copy should
always finish before the SPI DMA slave catches up to that place in memory at 10
MHz.
This fixes a common condition where the userspace task (low priority) was not
swapping buffers in time from user space and logs were corrupted.
2012-02-06 08:21:24 -06:00
James Cotton
179e66b754
Refactor how new packets are scheduled to avoid trying to start a transaction
...
from an ISR. This was causing lock ups. It's a bit higher latency probably
(trivially slow) but if we aren't keeping up with the Overo transactions then
using a proper DMA double buffer will be required.
2012-02-04 20:11:31 -06:00
James Cotton
665801662d
In cc3d update sensors add accelbias before scaling to allow more precision in
...
levelinIn cc3d update sensors add accelbias before scaling to allow more
precision in levelingg
2012-02-04 12:12:41 -06:00
James Cotton
4e190f99e2
Improved the revo overosync code to put multiple uavobjects into a packet
2012-02-04 12:06:03 -06:00
Stacey Sheldon
60a2af2e58
ef+dfu: Move EF image generation into separate makefile
...
A separate makefile for EF (Entire Flash) targets allows
the removal of board-specific hard-coded addresses. These
values can now be included from the board-info.mk files
for each board.
2012-02-04 12:03:42 -05:00
Brian Webb
3f66afd74a
Removed emacs mode header from pios_gcsrcvr.c
2012-02-04 08:42:16 -07:00
Stacey Sheldon
4fafbb13ed
makefile: Add EF (Entire Flash) targets for all boards
...
These new build targets will construct a flash image that
includes both a bootloader as well as a firmware image all
in one. Examples:
make ef_coptercontrol
make ef_revolution
This also adds support for a new target for writing this EF
image to boards that support a DFU interface (only F4-based
boards). This can be done by running:
make dfuutil_install
# Boot board with SBL asserted to activate STM32 DFU ROM
# Attach USB cable
make ef_revolution_dfu
Bootloader images are also now padded out to occupy the full
BL flash region.
2012-02-03 00:59:36 -05:00
Stacey Sheldon
ce544cf4ab
gdb: remove cortex_m3 remnants from revo gdb init file
2012-02-03 00:59:31 -05:00
Stacey Sheldon
99f5f20cb2
openocd: add support for stlink on stm32f4 targets
2012-02-03 00:51:31 -05:00
Brian Webb
a314604f9b
Added failsafe to GCS Receiver device.
2012-02-02 19:59:42 -07:00
James Cotton
18a64e261f
Going a bit overkill with this - deinit who SPI block between transactions.
2012-02-02 12:32:57 -06:00
James Cotton
c26154f303
Switch back to 256 byte packets and 0xFF pad the end
2012-02-02 11:40:49 -06:00
James Cotton
03cfb1453a
DeInit SPI DMA between transactions. Somehow if this doesn't happen the next
...
transaction doesn't start at the beginning again. Something is still not quite
right because first few bytes aren't getting across. Need logic analyzer.
2012-02-02 11:37:35 -06:00
James Cotton
77a6abb341
For PIOS_SPI F4 do not enable the TX irq. Also do not wait for the
...
transmission to finish either.
2012-02-02 11:24:14 -06:00
James Cotton
8b1137c6a0
Align the tx and rx SPI buffers from Overosync
2012-02-02 11:23:40 -06:00
James Cotton
0a71a48c57
Sending all FF finally again
2012-02-02 10:36:09 -06:00
James Cotton
80b839d145
The SPI3 TX DMA channel was wrong
2012-02-02 10:13:09 -06:00
James Cotton
29237f97ae
For SPI slave devices we need to handle the interrupt differently since
...
transactions should already be completed. Also reset the callback so in the
case of noise on the IRQ line it will not keep firing interrupts.
I suspect we should probably disable interrupts in this handler to prevent
refiring.
2012-02-02 10:13:09 -06:00
James Cotton
88b9f20cda
Fix nasty bug in the DMA stream configuration
2012-02-02 10:13:09 -06:00
James Cotton
95abb56d5e
Added module to send updates out the SPI port
2012-02-02 09:19:25 -06:00
James Cotton
e434ab94a9
Enable SPI port for revolution to overo communications
2012-02-02 01:42:38 -06:00
Alessio Morale
5449408763
Merge branch 'amorale/timerprescaler' into inoutch8
2012-02-01 00:23:53 +01:00
Alessio Morale
cb2dadd0ea
fix Motor 8 out not working
2012-02-01 00:20:50 +01:00
Alessio Morale
322ced44a1
Solve PWM Input 8 not working
2012-02-01 00:16:48 +01:00
Alessio Morale
820e8ac062
Handle different prescaler values for timers on APB1 and APB2.
...
The PIOS_MASTER_CLOCK has been removed in favor of
PIOS_SYSCLK (the master clock value,168000000 for revolution)
PIOS_PERIPHERAL_APB1_CLOCK and
PIOS_PERIPHERAL_APB2_CLOCK
Look at STM32F4xx_Revolution.h for the list of timer/peripheral and APB them belongs.
2012-01-28 20:04:55 +01:00
James Cotton
a778c45d6f
For L3GD20 sensor task run at the sensor speed
2012-01-28 10:11:30 -06:00
James Cotton
13447ac907
Fix the MPU6000 implementation
2012-01-28 00:21:58 -06:00
James Cotton
e07fca0465
Commit the revolution board_hw_defs.c file
2012-01-26 23:32:36 -06:00
James Cotton
b4435d0b35
For L3GD20 sensor task on revo update gyro once per physical sample
2012-01-26 23:29:12 -06:00
James Cotton
f311700804
Flashfs: Whenever failing out of a transaction unlock the semaphore
2012-01-26 14:14:50 -06:00
James Cotton
85bfa7dcf9
Flashfs: Missed calculation of the header crc for monolitihic write
2012-01-26 13:32:53 -06:00
James Cotton
84dd1dbc40
A bit more lenient settings for CC sensor timings
2012-01-26 13:00:06 -06:00
James Cotton
ad3d470f40
Flashfs and Flash: Add new function to write a series of blocks in one flash
...
write transaction to improve efficieny.
2012-01-26 12:39:35 -06:00
James Cotton
80705cdba1
Flash: Because on CC/CC3D the flash is initialized before FreeRTOS is started
...
we cannot use the transaction lock or the delay while saving.
2012-01-26 11:50:05 -06:00
James Cotton
4fc907ad0d
Add a transaction semaphore to flash and flashfs to make sure multiple saves
...
or loads can't be attempted between threads
2012-01-26 11:36:07 -06:00
James Cotton
8b15fdd88b
Flash: Add a vTaskDelay when waiting for flash operations to complete to
...
prevent blocking the bus from accels
2012-01-26 11:26:19 -06:00
James Cotton
7f38d113eb
Delete more old target stuff
2012-01-26 11:21:34 -06:00
James Cotton
e69a0937bc
Flash: Wrote status instead of read it
2012-01-26 11:17:00 -06:00
James Cotton
69dc5abf0c
Flash: Get rid of some defines and directly reference the cfg structure
2012-01-26 10:56:26 -06:00
James Cotton
6d572986e5
Flashfs: Clean up some of the JEDEC commands and also format whole chip when FS
...
is wrong.
2012-01-26 10:04:49 -06:00
James Cotton
fe7b9a909a
LED: Update the LEDs on revo
2012-01-26 09:11:27 -06:00
James Cotton
7eab883d5c
Fix some small revolution typos
2012-01-25 22:50:19 -06:00
James Cotton
20670d049b
Update pios_led for F4 targets to match the new F1 implementation. Also fix
...
type for F1 in GPIO labels.
2012-01-25 22:50:19 -06:00
James Cotton
727f0befc5
Make the gyro go a bit more regularly to stabilization but needs updating
...
regular CC
2012-01-25 22:50:19 -06:00
James Cotton
e4df3202e0
L3GD20: Update sensor task for revo to use the new queue
2012-01-25 22:50:19 -06:00
James Cotton
205aabe895
L3GD20: Make this sensor push data onto a FreeRTOS queue so that the sensor
...
reading task can block according. Also now the gyro data is sent to
stabilization multiple times per update of the attitude loop.
2012-01-25 01:20:07 -06:00
James Cotton
0da20bb846
Flash: Because most of the commands are a JEDEC standard rename this file
...
pios_flash_jedec and abstract out the methods that can vary between chips.
2012-01-25 00:23:24 -06:00
James Cotton
a02cad6f52
Flashfs: Separate out the sector sizes and magic values into a runtime
...
configurable structure. This makes it easier to deal with different chip
layouts.
2012-01-24 23:56:59 -06:00
James Cotton
1971ba30dc
No longer hardcode baudrate
2012-01-24 23:42:43 -06:00
James Cotton
5ad37e691c
USB: Update the USB configuration structure to include the GPIO that is used
...
for sensing and then load different config for CC and CC3D. Updated the
bootloader as well. Also changed the PIOS_USB_CheckAvailability function to
only return the sense signal and not the transfer_possible flag as this is not
set in time for the bootloader on CC3D for some reason.
2012-01-24 22:15:43 -06:00
James Cotton
bc3703ce33
Need more irq stack for CC3D
2012-01-24 19:48:52 -06:00
James Cotton
104c091590
Correct the range constants for the L3GD20 driver
2012-01-24 19:48:14 -06:00
James Cotton
a25d52785b
Change the bus speed for the L3GD20 to 10MHz and some small cleanups
2012-01-24 19:17:49 -06:00
James Cotton
3880b0ddc3
CC3D and CC use different CS lines for the flash chip. Add a second cfg
...
structure for each SPI interface.
2012-01-24 16:21:48 -06:00
James Cotton
587ec5a615
Revert earlier patch on filesystem for Revolution. Need to make erase command
...
and positioning of filesystem dependent on board type.
Reverted 99123372d0
2012-01-24 16:14:41 -06:00
James Cotton
b6c056fef2
Use the updated L3GD20 format and make attitude.c use the gyro data from the
...
fifo
2012-01-24 15:52:17 -06:00
James Cotton
c9263cb8c0
L3GD20: Dynamically allocate buffer structure when used
2012-01-24 15:51:38 -06:00
James Cotton
5efbfb02fa
Make the BMA180 sensor system acquire from the queue. Correct the orientation
...
and speed it up to 10 MHz communications.
2012-01-24 15:09:20 -06:00