Hello all.
I've scoured the internet looking for a solution and have yet to find one.
I'm building a quadcopter with an arduino uno for the flight controller using a flight controller I wrote myself.
The issue that I am currently having is that the flight controller only functions properly if it is initialized while the serial monitor is open. I can unplug it before the quadcopter is even done setting up, and it will function perfectly fine.
If I start the quadcopter without the serial monitor open, the motors behave erratically. One motor begins to speed up very quickly, typically exceeding its programmed speed limit. The others sit idle. The active motor still responds to input from my wireless controller within reason, but it will try to speed up irregardless of what I do.
I should note that I do not expect the quadcopter math, etc to be anything really close to functional at this time as it is entirely experimental. Right now I am trying purely to get the quadcopter to behave the same irregardless of if it's started with or without the serial monitor.
I have tried solutions for a few days and googled for a few hours to no avail. I have attached my source and the library I wrote to calibrate the gyro. Any help would be appreciated.
Flight_Controller_2.ino (6.9 KB)
Calibration.cpp (1.73 KB)