Introduction - If you have any usage issues, please Google them yourself
Brushless_Gimbal_Balancing_Robot
Arduino Code
-The code is running on a mega328p and was compiled using Arduino 1.6.6
-The code cycle time is a constant ~250Hz
At the heart of the code is a counter that is advanced every time TIMER1 overflows and triggers an interrupt routine. This counter triggers other events at specific intervals allowing the code to run at a known rate and simplify math in the control loop.