Latest version of my quadcopter controller with an LPC1768 and MPU9250.
Currently running on a custom PCB with 30.5 x 30.5mm mounts. There are also 2 PC apps that go with the software; one to set up the PID controller and one to balance the motors and props. If anyone is interested, send me a message and I'll upload them.
Filters/MAfilter.h@8:981f7e2365b6, 2018-07-31 (annotated)
- Committer:
- Anaesthetix
- Date:
- Tue Jul 31 20:36:57 2018 +0000
- Revision:
- 8:981f7e2365b6
- Parent:
- 4:fab65ad01ab4
Switched from Madgwick to Mahony as I'm having trouble with slow oscillations caused by the madgwick filter. Fixed an error on the PID algorithm also.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Anaesthetix | 4:fab65ad01ab4 | 1 | // Coded by Erik van de Coevering |
Anaesthetix | 4:fab65ad01ab4 | 2 | |
Anaesthetix | 0:0929d3d566cf | 3 | #ifndef MAfilter_h |
Anaesthetix | 0:0929d3d566cf | 4 | #define MAfilter_h |
Anaesthetix | 0:0929d3d566cf | 5 | |
Anaesthetix | 0:0929d3d566cf | 6 | //#include "mbed.h" |
Anaesthetix | 0:0929d3d566cf | 7 | class MAfilter { |
Anaesthetix | 0:0929d3d566cf | 8 | private: |
Anaesthetix | 0:0929d3d566cf | 9 | float filterbuff[200]; |
Anaesthetix | 0:0929d3d566cf | 10 | float out; |
Anaesthetix | 0:0929d3d566cf | 11 | int i; |
Anaesthetix | 0:0929d3d566cf | 12 | |
Anaesthetix | 0:0929d3d566cf | 13 | public: |
Anaesthetix | 0:0929d3d566cf | 14 | float run(float input); |
Anaesthetix | 0:0929d3d566cf | 15 | }; |
Anaesthetix | 0:0929d3d566cf | 16 | |
Anaesthetix | 0:0929d3d566cf | 17 | class MAfilter10 { |
Anaesthetix | 0:0929d3d566cf | 18 | private: |
Anaesthetix | 0:0929d3d566cf | 19 | float filterbuff[10]; |
Anaesthetix | 0:0929d3d566cf | 20 | float out; |
Anaesthetix | 0:0929d3d566cf | 21 | int i; |
Anaesthetix | 0:0929d3d566cf | 22 | |
Anaesthetix | 0:0929d3d566cf | 23 | public: |
Anaesthetix | 0:0929d3d566cf | 24 | float run(float input); |
Anaesthetix | 0:0929d3d566cf | 25 | }; |
Anaesthetix | 0:0929d3d566cf | 26 | |
Anaesthetix | 0:0929d3d566cf | 27 | #endif |
Anaesthetix | 0:0929d3d566cf | 28 |