rbyambajav / quadrocopter Goto Github PK
View Code? Open in Web Editor NEWThis project forked from matthew-t-watson/quadrocopter
This project forked from matthew-t-watson/quadrocopter
This is the code for my quadrocopter Control V4 board. Please treat all of it with care, as it was rather hastily thrown together over about three weeks, and as such is still full of bugs and errors. Main sections: inputcapture.c: Contains all the code for operating the input capture module, which is used to decode the PWM output from a 4ch reciever. Outputs target x y and z angles. timer1.c: The main 400Hz control loop. Most of the control occurs within the timer1 interrupt. timer2.c: Timer used to measure the length of the reciever PWM pulses. timer3.c: Timer used to control the length of the PWM output to the motor controllers. timer4.c: Legacy timer from when I ran with a variable frequency control loop. It is still used, however any reference to dt could be replaced with 1/400. uart.c Contains the code for setting up the UART module, along with simple functions for transmitting and recieving char variables. I just use the STDIO.h printf function for general debugging. filters.c Contains both a simple complementary filter, and a 2nd order complementary filter designed by RoyB, with the source linked in the comments. kalman.c Code to implement a kalman filter, with the source listed. I could never get this to function better than my complementary filter, if you can see what I am doing wrong please shout. This file isn't used in the current build. pwm.c Code to set up and operate the output compare modules in PWM mode. Since I switched to single shot mode this file hasn't been used. singleshot.c Setup and operation of the output compare modules in single shot mode. Requires the control loop to be running at the rate at which your ESCs can accept pulses. MPU6050.c Contains all the code required to operate the MPU6050. I2C.c Standard I2C control code, a complete mixture of my own work and a microchip example, although I have a feeling I may have decided to delete everything I had done and just stick with the example. motors.c Contains functions for updating the PID output and for outputting new motor speeds. main.c Simply sets up all the required timers and peripherals, then listens for UART input. This isn't required to fly, and just exists from when I was tuning the PID values on the fly. Despite being ridiculously inefficient, I found it still ran fast enough to saturate the UART buffer.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.