I am making a DIY drone. I can retrieve the orientation and also control the speed of the quadcopter with PWM.
I am on the phase of designing and testing the control system. I was wondering if theoretically this type of control system is enough to be able to just keep a drone stabilised:
I have seen that other type of control systems have an outer loop (similar to the one I have) and another inner loop happening at a higher frequency working with the rate of change of the Euler angles (which I do not understand really well how to implement it and their scope).
Any suggestion, both theoretical and practical is welcome, any resource that contribute to this would be appreciated.
Thanks in advance for taking your precious time reading this and hopefully replying to this.
If you don't understand how to implement it, then the choices are to improve your understanding or to adapt an existing open source control system to your project.
The outer loop in such a case may only be in service of providing angle mode flight operation.
Quadcopters can be flown in angle mode or rate mode, each has its features and adherents. Rate mode is known colloquially as "acro" mode, as it is only possible in rate mode to do acrobatic maneuvers like loops and rolls.
Rate mode only needs the gyro, and the control system is responsible for attempting to make the quadcopter rotate about the axes at the rates commanded by the pilot.
Angle mode adds the accelerometer and the control system attempts to place the quadcopter at the angle(s) commanded by the operator.
There are quite a few open source quadcopter control software "ecosystems", I suggest you read around a bit and see what that might help you do.
thanks for the reply @alto777@jremington I have already implemented and started tuning the PID control system. I am capable of implementing it if given enough information.
I have looked at the Crazybee, and ESPCopter, flight controller systems and I can see they have a different type of diagram they follow. The Crazybee is out of scope as I am trying to do the most basic thing possible to just balance a drone, the ESPCopter is open source but lacking of documentation.
And here's a very light weight control system developed as a replacement for certain toys that allow field programming, it's called Silverware and has lotsa children out there:
Thanks @alto777 , Silverware seems to be more closed source and less documented.
I had already started looking deep into the stabilisation system for the drone. I have pinpointed that each axis has been following this simplified diagram:
This seems very doable to me, the only thing I am a bit confused about is: the Feed Forward block [FF], and how are the target, actual rate and the output of the FF integrated (I cannot understand their signs, are they all summed or subtracted or what).
@jremington@alto777 do you think a general engineering university student is capable of coding a drone from scratch? Would love to hear your opinion about that.
Sure. A dedicated engineering student with a good grasp of coding, and who did well in math, control theory, mechanical engineering and electronics design courses, could build a drone control system from scratch. It might take 2-3 years of hard work.
That should be obvious, given that advanced drones are everywhere.
I am generally very negative and pessimistic. I have always been impressed by the ppl who set out to do the impossible, and usually advise against reinventing the wheel.
But time after time, we have seen ppl actually get things into the air and flying.
And it's a good time in history. There are now available very powerful and inexpensive processors to exploit.
I usually also advise that learning to fly a real quadcopter would be a good thing to do on something other than your first build.
Like buy a cheap quadcopter set that runs Betaflight and destroy a few of those first… or even a cheap toy that can be burned with Silverware - that is after you've flown it out of the box.
I have told many ppl to find someone who did it themselves and slavishly follow the build and duplicate it exactly. Quadcopters are a delicate balance of weight and power - many very nice looking quads just don't fly very well, and some that fly well don't anymore when you add a few ounces to the mass.
Are you planning on using FPV? What size quadcopter do you imagine building, and what functionality will be important, other than proving it can hover?
BTW hovering is hard! New pilots think they must master hovering, but just flying is hard enough. Unless you add things like a barometer and optical flow sensors and take the pilot out of the loop.
About the processing power - an Arduino UNO, for example, is not much when you compare it to the processors used in FC flight control boards you can get at hobby places. Even toys have more raw power. But ppl do get things flying with the lesser powered micros.