Flammert Posted February 2, 2015 Posted February 2, 2015 I have a project to make a quadcopter fly autonomous. I use a 9 degrees of freedom pcb, wich has a gyro, acceleration meter and compass in it. We are now flying with only the gyro. A gyro however has a few imperfections like drift (and a imperfection I dont know how to call). So a you cannot fly on a gyro alone, so when I search for some answers to that problem I find solutions like the complementary and kalman filters. They combine the data from the gyro and acceleration meter. But how can I use a acceleration meter on a flying object? The acceleration meter can only measure the force on the quadcopter, and the force on the quadcopter is the force generated by the propellers it self, (which is always on the Z-axis)? A prove for this is that if you place a glass of water on a quadcopter, the glass would always stay on the quadcopter because the only force on the quadcopter is in the z-axis https://www.youtube.com/watch?v=w2itwFJCgFQ#t=275 Flammert
imatfaal Posted February 2, 2015 Posted February 2, 2015 A counter to that proof would be that the quadcopter moves in the x and y axes - and if it starts with no motion in the x and y and at a later point has velocity in the x and y then there must be acceleration in the x and y, and thus force. Wind would be the first obvious candidate. I would have thought that x & y components would be generated by unbalanced z between rotors. As soon as force is not balanced then the craft will rotate around Centre of Mass (yaw and pitch) and previously upward pointing rotors will now have an x and y component. This can be done deliberately to steer, accidentally by poor mechanics, or incidentally by environment.
Flammert Posted February 2, 2015 Author Posted February 2, 2015 That is an much simpler answer then I was expecting, I have been breaking my head over this for a long time. Thanks!
Flammert Posted February 2, 2015 Author Posted February 2, 2015 For the sake of simplicity we (I forgot to mention im doing this project with a friend) are using an arduino for now, but we are considering to use a stm32f3 /stm32f4 discovery board. Because it has so much more capacity (much faster, floating point unit, etc.)
Klaynos Posted February 2, 2015 Posted February 2, 2015 I see. Are you planning to mount a camera? My limited experience suggests that an arduino doesn't deal too well with video or audio (not designed for it and doesn't have the power to just throw processing power at it). I'm asking purely for interest. I like the idea of building a quadcoptor but it's about 15th on my microprocessor projects at the moment if only because of cost.
Flammert Posted February 2, 2015 Author Posted February 2, 2015 I maybe, going to add FPV to it. But if I would do anything with a camera, I would use a separate system. So the 'quadcopter calculations' run on a realtime system and the camera on a raspberry or something.
Mordred Posted February 3, 2015 Posted February 3, 2015 I would also look at the problem of overshooting. Without seeing your code structure I can only guess how you programmed each propeller. Say you have a 10 degree tilt, you then speed up one propeller at a set speed to correct. Now at what point do you slow down that propeller. Can you provide a brief description of your code specifically to the set point determined by the amount of correction. Are you using a form of fuzzy logic or PID control? If it was me programming this I would consider the latter the better option to prevent overshooting your correction setpoint.
Flammert Posted February 3, 2015 Author Posted February 3, 2015 My project mate is the expert on that subject, I will ask him to write a little about it. But in short what we do is, we look at the current angle and the rotation speed. If you only look at the current angle, then if you just corrected the angle to a 0 degree tilt, it still has speed so it overshoots to a -10 degree tilt. So basically what you do is when you get close to the 0 degree tilt, you correct the rotating speed.
Klaynos Posted February 3, 2015 Posted February 3, 2015 Given the space limitations on an arduino I'd probably opt for PID.
imatfaal Posted February 3, 2015 Posted February 3, 2015 Aeronautics is really not my thing - but do you use any form of automatic self levelling like planes do? (dihedral angle) It would seem to me that if all the rotors were slightly tilted inwards then any pitch or roll would tend to bring the craft back to a more level flight using a natural negative feedback. To explain. Four rotors named N E S W - each rotor is set such that when the craft is level the plane of rotor is sloped down towards the centre of the craft. Thus when the craft is tipped (ie bad situation needing to be rectified) along the EW axis then N rotor is raised and S is lowered; but additionally the plane of rotor S is now closer to the horizontal and thus component of force in z will be maximised AND plane of rotor N is further from the horizontal and the component of force in z is lowered. This imbalance of force will lower N and raise S - thus correcting the rotation on the axis of EW You would lose manoeuvrability but gain stability.
Mordred Posted February 3, 2015 Posted February 3, 2015 (edited) My project mate is the expert on that subject, I will ask him to write a little about it. But in short what we do is, we look at the current angle and the rotation speed. If you only look at the current angle, then if you just corrected the angle to a 0 degree tilt, it still has speed so it overshoots to a -10 degree tilt. So basically what you do is when you get close to the 0 degree tilt, you correct the rotating speed. I would opt for the PID function I believe to arduinos though not positive have a built in one. This function will adjust the RPM as the craft levels in a gradual curve. Rather than a single or multipoint reduction in RPM at specified setpoints. PID is proportional, integral, Derivitive. In the older days it used to be called gain, error, reset. Key note the PID formulas typically give a quarterly amplitude decay. This is 4 overshoots each successive overshoot 1/4 less than the previous. You can set your preliminary I and D points to get the rough values, then use the integral and derivitive terms to fine tune further to achieve a critically dampened PID. (No overshoot). The advantage is bit will calculate the rotor RPM at each sampling, rate depends on what you specify on sampling rate (when you call up the PID sub routine). The additional challenge will be preventing one rotor from overpowering the other, PM me I can direct you to some motion control specialists that can help in that added complexity. Should PID becomes your choice to implement. Edited February 3, 2015 by Mordred
Flammert Posted February 3, 2015 Author Posted February 3, 2015 (edited) Imatfaal: No we don't. Basicly how we balance the quadcopter now is: We have the input from the gyro in rad/s, we integrate that value so we get the current angle, then based on the speed that we are rotating in and the current angle we adjust the speed of the propellers. So we aren't doing any aeronautic tricks. But its the first time I have heard of it, it looks very interesting. Mordred: One of the goals of the project is to learn to build a PID system. Our current PID is pretty good, it is quite stable and it has just a little overshoot. The only problem that we have is the drift of the gyro, and a (I guess) mathematical problem (witch is kinda hard to explain). The mathmatical problem: If you take your phone for example, rotate it 180 degrees of the, x, y, z axis. Now you phone is in the same position as where it started in, but the values of x, y, z are all 180. So in case of the quadcopter, the arduino would think, that the angle is incorrect, but the quadcopter actually is in the right position, so the arduino will correct the quadcopter wrong. I hope I explained that correct and clear. Edited February 3, 2015 by Flammert
imatfaal Posted February 3, 2015 Posted February 3, 2015 Imatfaal: No we don't. Basicly how we balance the quadcopter now is: We have the input from the gyro in rad/s, we integrate that value so we get the current angle, then based on the speed that we are rotating in and the current angle we adjust the speed of the propellers. So we aren't doing any aeronautic tricks. But its the first time I have heard of it, it looks very interesting. Sounds fascinating - good luck. If you want to look at wing dihedral angles you can try wikipedia (but as per usual the page is needlessly complicated) - but here is a simple summary which does a better job than I could http://www.aviation-history.com/theory/wing_dihedral.htm Mordred: One of the goals of the project is to learn to build a PID system. Our current PID is pretty good, it is quite stable and it has just a little overshoot. The only problem that we have is the drift of the gyro, and a (I guess) mathematical problem (witch is kinda hard to explain). If you can get some of the engineers and mathematicians here interested you will have a great group of brains to bounce any solutions off! So go for the explanation and see what happens
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now