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/LPfilter.h@0:0929d3d566cf, 2018-07-09 (annotated)
- Committer:
- Anaesthetix
- Date:
- Mon Jul 09 16:31:40 2018 +0000
- Revision:
- 0:0929d3d566cf
- Child:
- 4:fab65ad01ab4
Latest version of my multicopter controller
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Anaesthetix | 0:0929d3d566cf | 1 | #ifndef __LPfilter_H__ |
Anaesthetix | 0:0929d3d566cf | 2 | #define __LPfilter_H__ |
Anaesthetix | 0:0929d3d566cf | 3 | |
Anaesthetix | 0:0929d3d566cf | 4 | #define LP_A 0.02008336556421 |
Anaesthetix | 0:0929d3d566cf | 5 | #define LP_B 1.561018075801 |
Anaesthetix | 0:0929d3d566cf | 6 | #define LP_C -0.6413515380576 |
Anaesthetix | 0:0929d3d566cf | 7 | #define LP_D 1.0f |
Anaesthetix | 0:0929d3d566cf | 8 | #define LP_E 2.0f |
Anaesthetix | 0:0929d3d566cf | 9 | #define LP_F 1.0f |
Anaesthetix | 0:0929d3d566cf | 10 | |
Anaesthetix | 0:0929d3d566cf | 11 | |
Anaesthetix | 0:0929d3d566cf | 12 | class LPfilter { |
Anaesthetix | 0:0929d3d566cf | 13 | private: |
Anaesthetix | 0:0929d3d566cf | 14 | float filterbuffer[3]; |
Anaesthetix | 0:0929d3d566cf | 15 | float out; |
Anaesthetix | 0:0929d3d566cf | 16 | public: |
Anaesthetix | 0:0929d3d566cf | 17 | float run(float input); |
Anaesthetix | 0:0929d3d566cf | 18 | }; |
Anaesthetix | 0:0929d3d566cf | 19 | |
Anaesthetix | 0:0929d3d566cf | 20 | class LPfilter2 { |
Anaesthetix | 0:0929d3d566cf | 21 | private: |
Anaesthetix | 0:0929d3d566cf | 22 | float filterbuffer1[3]; |
Anaesthetix | 0:0929d3d566cf | 23 | float filterbuffer2[3]; |
Anaesthetix | 0:0929d3d566cf | 24 | float out_temp; |
Anaesthetix | 0:0929d3d566cf | 25 | float out; |
Anaesthetix | 0:0929d3d566cf | 26 | public: |
Anaesthetix | 0:0929d3d566cf | 27 | float run(float input); |
Anaesthetix | 0:0929d3d566cf | 28 | }; |
Anaesthetix | 0:0929d3d566cf | 29 | |
Anaesthetix | 0:0929d3d566cf | 30 | class LPfilter2_1 { |
Anaesthetix | 0:0929d3d566cf | 31 | private: |
Anaesthetix | 0:0929d3d566cf | 32 | float filterbuffer1[3]; |
Anaesthetix | 0:0929d3d566cf | 33 | float filterbuffer2[3]; |
Anaesthetix | 0:0929d3d566cf | 34 | float out_temp; |
Anaesthetix | 0:0929d3d566cf | 35 | float out; |
Anaesthetix | 0:0929d3d566cf | 36 | public: |
Anaesthetix | 0:0929d3d566cf | 37 | float run(float input); |
Anaesthetix | 0:0929d3d566cf | 38 | }; |
Anaesthetix | 0:0929d3d566cf | 39 | |
Anaesthetix | 0:0929d3d566cf | 40 | #endif |
Anaesthetix | 0:0929d3d566cf | 41 |