Since i’m building a quadcopter and finally at the point of stabelizing it through PID I haven’t been any further. No matter what I try i can’t get the right PID values. I’m using the PID Library. It’s not because the pid is not working. I can see the difference clearly even the ‘KD’ will smooth it to a certain point, but it’s oscillating to much. I have doubts if the arduino can process everything fast enough. I don’t know much about Hz rate’s etc. Another doubt I have is that my MPU is not accurate enough. I have the CMPS11 which give kalmanfiltered angles without any decimal’s. Could this have any influence on how precise the pid will compute it, does it make sense at all to the motor output? At first I used the mpu9015 (same as mpu 6015, but with magnetometer), but I had troubles with it, which you can read in another topic from me. That one gives the angles with two decimals.
I made a video to give you an idea how it peforms right now: https://youtu.be/KakVR_XOJWY
As you can see it hangs mostly to the left side and then it correct it a bit and falls back to that side.
I’m stuck because I don’t know where I need to look. Is it the CMPS11, the processing speed of the arduino(mega 2560 ADK) or still the PID values…
For who want’s to look at the code, here you go. It’s a bit messy right now: See attachment.
Some of the code have been derived from this(Especially the PID implementation): Arduino-Quadcopter/Quadcopter at master · benripley/Arduino-Quadcopter · GitHub
There is some dutch comments, sorry about that. With ‘mpullcore’ I control the motor output. When everything works the distance sensor need to take this over.
Ohw, I don’t use any radio control.
If you need more information, let me know!
quadpid.ino (10 KB)