Unterschiede zwischen den Revisionen 1 und 19 (über 18 Versionen hinweg)
Revision 1 vom 30.03.2010 23:27
Größe: 35032
Autor: smokytyrz
Kommentar:
Revision 19 vom 28.04.2010 22:56
Größe: 22845
Autor: anonym
Kommentar: converted to 1.6 markup
Gelöschter Text ist auf diese Art markiert. Hinzugefügter Text ist auf diese Art markiert.
Zeile 1: Zeile 1:
<<TableOfContents>>
Zeile 2: Zeile 3:
[[TableOfContents]] = Understanding MKTools Parameters =
Mikrokopter Tools (MKTools) allows the user to configure settings on the Mikrokopter such as gyro gains, gps holding thresholds, camera motion settings, and many others. The purpose of this page is to present a deeper understanding of the MKTools settings. General information about MKTools can be found [[http://mikrokopter.de/ucwiki/en/MikroKopter-Tool?action=show&redirect=en/MikroKopterTool|here]].
Zeile 4: Zeile 6:
Re the parameters, the pages in the WiKi for the MKTool and the separete en/Parameters page certainly need some updating. But here's my summary of the parameters. Feel free to correct:
Screen: Stick
Stick nick/roll P: Response to degree of stick movement. High value: Needs small stick novements. Low value: Needs large stick movements.
Default values: 8-15.
Stick nick/roll D: Response to speed of stick movement. High value: very twitchy on overcontrol. Low value: sluggish. Default values: 16-30
Gier P: Yaw response to stick movement. High value: Fast yaw. Low value: Slow yaw. Default values: 6-12.
Screen: Gyro
Gyro P: Speed of response to gyro angle changes . High value: Fast response, dampending oscillations . Low value: Sluggish response. Default values: 80-100.
Gyro I: Level of gyro control. High values: Very strong control, wagging if too high. Low values: Oscillations and wind sensitivity. Default values: 120-150
Gyro D: ??
Acc/gyro factor: Accurateness of overlay of gyro and acc curves. Check by looking at curves in MKTool. Default value: 30.
Acc/gyro comp : Frequency of acc/gyro correction. High value: High frequency, more stable. Low value: Less stable. Default values: 16-32. Extended values: Up to 100.
Dynamic stability: Throttle level for control relative to current throttle position. High value: Can exceed throttle, ballooning in wind gusts. Low value: Remains below throttle, no bouncing in wind. 50-100. Value of 64 should be neutral.
Haupt I: Level of accurateness between stick and craft attitude. High value: Heading hold. Low value: Less heading hold effect. Default values: 16-32
Screen: Hohe
Hohe min gas: Minimum throttle if altitude hold active. High value: Less rapid descent on exceeding altitude, even balloon in wind if too high. Low value: More rapid drop on exceeding altitude. Default values: 30-100. Note: test for hover throttle, then set value to just under hover value.
Hohe P: Rapidity of response to exceeding of altitude. High value: More rapid response. Low value: Slower response, more exceeding of set altitude. Default value: 10
Baro D: Level of pressure difference leading to response. High value: More sensitive to small differences. Low value: Less sensitive to small gusts . Default value: 30.
Z acc: Compensation by changes in vertical acc values. High value: More sensitive to vertical acceleration changes. Low value: Less response to rapid descent. Default value: 30
Verstarkung: Gain, maximum altitude allowed: High value: Larger maximum altitude. Low value: Lower maximum altitude. Default values: 3-4
Screen: Other
Min gas: Throttle level needed for stationary running of all motors on throttle on. High values: Higher stationary speed, no stopping of motors in flight. Low values: Some motors not starting on motor on, motors stopping in flight. Default values: 10-20. Note: for converted TowerPro's you tend to need values of 15 to 20.
Max gas: Maximum throttle allowed for user (remainder usable for control?). Higher values: Less stable on low battery, but more throttle for cushening of rapid descent and landing?. Low values: More stable on low battery, bet less ability to prevent hard landing? Default values: 230-250
The table below can be tracked [[http://www.rcgroups.com/forums/showthread.php?t=1141571|here]]. This table summarizes popular setups, MKTools settings, and performance of those settings in the real world. This is a good place to start when learning how to configure your Mikrokopter using MKTools. {{attachment:mkparametertable.jpg}}
Zeile 28: Zeile 8:
These gyros spit out the rate of angular change. What this means is that (in terms of a PID control, see http://www.embedded.com/2000/0010/0010feat3.htm and http://en.wikipedia.org/wiki/PID_controller for starting info on PID controlers) that Gyro-P is the proportional factor of the gyro rate of change or ‘D’ in the PID control of the MK angle. Now, if you take the integral of the rate of angular change you get the angel, so that Gyro-I is then ‘P’ in the PID control of the MK angle. What does that mean? Well, think of a pendulum as an analogy (from kilagreg’s explanation about GPS-P/D) ‘P’ is the force that tries to move the pendulum back to the center. The further away it is the stronger the force to move it back. When the pendulum gets to the center position the force exerted on it is zero but momentum carries it on and past center only to create a force in the opposite direction again to try and move it back. And a swing in created. If you increase ‘P’ [Gyro-I] you are essentially increasing the force to move the MK back to the correct orientation. If ‘P’ is too big it is like pushing someone on a swing and if you push too much the swinging just gets bigger and bigger [MK would oscillate]. If ‘P’ is too little it would be like turning down gravity and you would swing slowly [MK would correct slowly]. . So ‘P’ is the return force. == Screen: Stick ==
 * Stick nick/roll P: Response to degree of stick movement. High value: Needs small stick novements. Low value: Needs large stick movements. Default values: 8-15.
 * Stick nick/roll D: Response to speed of stick movement. High value: very twitchy on overcontrol. Low value: sluggish. Default values: 16-30
 * Gier P: Yaw response to stick movement. High value: Fast yaw. Low value: Slow yaw. Default values: 6-12.
== Screen: Gyro ==
 * Gyro P: Speed of response to gyro angle changes. High value: Fast response, dampending oscillations. Low value: Sluggish response. Default values: 80-100.
 * Gyro I: Level of gyro control. High values: Very strong control, wagging if too high. Low values: Oscillations and wind sensitivity. Default values: 120-150
 * Gyro D: ??
 * Acc/gyro factor: Accurateness of overlay of gyro and acc curves. Check by looking at curves in MKTool. Default value: 30.
 * Acc/gyro comp: Frequency of acc/gyro correction. High value: High frequency, more stable. Low value: Less stable. Default values: 16-32. Extended values: Up to 100.
 * Dynamic stability: Throttle level for control relative to current throttle position. High value: Can exceed throttle, ballooning in wind gusts. Low value: Remains below throttle, no bouncing in wind. 50-100. Value of 64 should be neutral.
 * Haupt I: Level of accurateness between stick and craft attitude. High value: Heading hold. Low value: Less heading hold effect. Default values: 16-32
== Screen: Hohe ==
 * Hohe min gas: Minimum throttle if altitude hold active. High value: Less rapid descent on exceeding altitude, even balloon in wind if too high. Low value: More rapid drop on exceeding altitude. Default values: 30-100. Note: test for hover throttle, then set value to just under hover value.
 * Hohe P: Rapidity of response to exceeding of altitude. High value: More rapid response. Low value: Slower response, more exceeding of set altitude. Default value: 10
 * Baro D: Level of pressure difference leading to response. High value: More sensitive to small differences. Low value: Less sensitive to small gusts . Default value: 30.
 * Z acc: Compensation by changes in vertical acc values. High value: More sensitive to vertical acceleration changes. Low value: Less response to rapid descent. Default value: 30
 * Verstarkung: Gain, maximum altitude allowed: High value: Larger maximum altitude. Low value: Lower maximum altitude. Default values: 3-4
== Screen: Other ==
 * Min gas: Throttle level needed for stationary running of all motors on throttle on. High values: Higher stationary speed, no stopping of motors in flight. Low values: Some motors not starting on motor on, motors stopping in flight. Default values: 10-20. Note: for converted TowerPro's you tend to need values of 15 to 20.
 * Max gas: Maximum throttle allowed for user (remainder usable for control?). Higher values: Less stable on low battery, but more throttle for cushening of rapid descent and landing?. Low values: More stable on low battery, bet less ability to prevent hard landing? Default values: 230-250
== Screen: GPS ==
=== Explanation of GPS Parameters ===
The P-parameter defines the strength of the control for the position hold; therefore, our virtual GPS-helper-pilot steers more strongly towards the target when this factor increases. You can understand this by thinking of a pendulum. The further the pendulum is away from the center (the further the MK is away from the target), the stronger the force is to pull it back to the center. Increasing P would be like increasing gravity or the force to push it back to the center. It so happens that the pendulum accelerates in the direction toward the center. At the moment the center is reached, there is no applied force to move the pendulum in any direction. The pendulum though, would still have some velocity (momentum) at this point and the pendulum would then swing away from the center in the opposite direction (the MK would shoot past the target). Without any friction to dampen the swinging this little game would then continue for ever. The swinging could actually get worse. So, the higher the P-Parameter is the stronger the ‘push’ on the pendulum back towards the center. <<BR>>
Zeile 30: Zeile 33:
Having a MK swing/tilt back and forth like a pendulum would not be a good thing. What you would need is some friction. That’s where ‘D’ [Gyro-P] comes in. ‘D’ is trying to adjust for the rate of change of the angle and provide a force in the opposite direction to try and slow it down if it is approaching the center two fast. ‘D’ is trying to be more predictive. For the pendulum it is like adding friction. That way, as the pendulum swings to the center it is being slowed down and the oscillation die down quickly or don’t happen at all. If ‘D’ is two large its like having the friction to large and the pendulum just stops before it even gets to the center and it resists disturbances or is hard to push [MK tends to hold on to tilts]. If ‘D’ is too small the pendulum just swings back an forth [MK just oscillates for a while] So ‘D’ is like a friction force. This is why we have a D-parameter, it makes sure that it proportionally steers against the over ground speed. This is the ‘friction’ parameter in the control system. It works similarly to friction in a pendulum system. If the friction is too high, then a pendulum that was not at it center would very slowly move back and then just stop when it got close. If the friction is too light, then the pendulum would just swing back and forth for a while. <<BR>>
Zeile 32: Zeile 35:
Now what happens if winds blows a pendulum? Well, it would tend (even at rest) to be tilted. For a MK that would also not be good. What is needed is something that accounts for the long term error (average amount away from center) and provides a force to correct. This is the ‘I’ in the PID control. It is the integral of ‘P’. What is ‘I’ in the MK, well I have no clue and I have asked but been ignored many times (now starting to look at the code to figure it out). I would imagine it’s the Hauptregler I-Anteil. So ‘I’ is an adjustment for the average offset error. Now, there is just the right relationship from return-force (P) and friction (D) that would allow a pendulum to quickly swing back to the center and then just stay there. These are the settings that you are trying to find. This is impacted by the reaction of the MK to the virtual GPS-helper-pilot stick movements. This is not impacted by the P and D of the RC-Stick settings but from the Gyro Settings that defines the reaction/behavior of the MK. <<BR>>
Zeile 34: Zeile 37:
If your MK has a lot of vibration noise, what happens? Well for the ‘I’ portion since it is the average, any noise just gets average out. The ‘P’ porting simply just passes the noise on (so this is like having the angle reading jump around from 1, 4, 2, -1, 3, 1, -3,etc). For ‘D’ it’s a different story. ‘D’ is the rate of change of the angel so the jumping around from ‘P’ would mean that to ‘D’ it looks like it is moving one way then the other, slow then fast,etc. For ‘D’ the noise gets amplified. The MK would be jerky. On top of this is the fact that the GPS-Position and the over ground speed also changes even for a MK that is stationary. This is because of atmospheric disturbances and start point quality, etc. Putting this is terms of the pendulum example; it would be like the hanging point for the pendulum would also be moving. So for example, trying to hold a pendulum without swinging it at the end of an outreached arm would be very difficult. The pendulum would swing all over the place if the ‘friction’ (D) was not large enough. <<BR>>
Zeile 36: Zeile 39:
The goal is to have the pendulum very quickly swing back to center and then just stick. How you achieve that goal on a MK or what that looks like no one will say. === Setting GPS Parameters ===
 1. Set GPS-P (userparam5) to zero
 1. Set GPS-D (userparam6) to a Poti and move the Poti to zero (as seen from the Display-Menu)
 1. Manually hover in one spot
 1. Gradually increase the Poti (GPS-D) until you see some light jittering/wobbling. Then move the Poti back a little
 1. Read the Poti value in MK-Tools (from the Display-Menu) and set GPS-D (userparam6) to that value
 1. Set GPS-P (userparam5) to a Poti and move the Poti to zero (as seen from the Display-Menu)
 1. Again manually hover in one spot
 1. Gradually increase the Poti (GPS-P) until a noticeable position correction is obtained but not too much that the MK strongly over steers.
 1. Read the Poti value in MK-Tools (from the Display-Menu) and set GPS-P (userparam5) to that value
In general, the relationship between GPS D&P has to be correct. <<BR>>
Zeile 38: Zeile 51:
You can imagine that there are trade offs for all of these setting and changing one affects the others. Add to that the fact that the MK properties of YOUR MK affect this as well. How fast the motors can change RPM, the max thrust, the mass of the arm, the center of gravity, the efficiency of the drive system, sensitivity of the sensors, the wind resistance of the frame etc. You change these things and it’s like changing a portion of the PID control. Something as miniscule as changing the stiffness of the propeller would change the efficiency at various RPM and would then require a tweak on probably P (only then to be followed by checking the others). If P is too big and D too little the MK will start to swing. If D is too big then the MK will start to jitter/wobble. <<BR>>
Zeile 40: Zeile 53:
Now the gyros are not that accurate/stable (if I understand it correctly) so the accelerometers are used to adjust/correct gyro errors thru the ACC/Gyro Comp. parameter. This essentially determines how fast the gyros get brought back in line with the accelerometer readings. How does this affect the MK flying, I don’t have a clue. Played with it but can’t figure it out. Finally, you have to be certain that the compass actually points to North (about 350° to 10°) when the front of the MK actually is exactly pointing to the North. If this is not correct, then the GPS control will cause the MK to circle around the set point or the MK will just fly away. <<BR>>
Zeile 42: Zeile 55:
The Stick parameters and how the stick feels in terms of MK control is also related to how the MK PID control is set up. If the PID is very ‘hard’ then you would need a lot of stick amplification to move the MK. If the MK is set up ‘soft’ and you didn’t change the Stick settings the MK would feel very twitchy. All these things are interrelated. Even the GPS parameters. = Understanding PID Gyros =
<<BR>>
Zeile 44: Zeile 58:
I have continued working on the parameters. First I trimmed my MK so it would not drift one way or the other and I set Stick-D to 0. To set Gyro-I and Gyro-P, I started with Gyro-P at zero and Gyro-I at 60 with both on Potis and then took off. The MK will be sensitive to the controls and wobbly. I would give little taps to the sick and observe the behavior. In my case the MK would wobble once or twice and then be steady. I then cranked up Gyro-I until the MK almost continuously oscillated after the stick tap then moved Gyro-I down a notch. Don’t let the oscillations bother you, you can still control the MK (as long as you don’t get Gyro-I too big). I then started cranking up Gyro-P. This quickly started settling out the wobbles. I would increase Gyro-P and tap the stick to see how it would respond. If Gyro-P gets to big, you start to notice that the MK doesn’t really level itself out after the stick tap. If Gyro-P is too little it will wobble a little after the stick tap but it will level quickly. The goal is to not have any wobbles while still having the MK return quickly to level after the stick input. When I tap my stick (roll) I give it a good amount of input (especially once I start getting closer to what I think it should be). Just play with it,.the better it is set up the bigger the stick tap you can give and have the MK quickly level and start to slow back down. It will also start to feel solid, just don’t let it get to solid or it wont correct quickly enough. I ended up with Gyro_P=67 and Gyro-I=147. Hauptregler I-Anteil: is the ‘I’ for the PID of the Roll and Nick controller. I played with that as well (although not as much) and eventually landed on about 28. It will affect the other parameters so if you play with Hauptregler I-Anteil you will have to go back and re-adjust Gyro-P and Gyro-I. I only tried a couple setting here so no real feel here other that when I had it above 35 I didn’t like how the MK was flying. Acc/Gyro-Comp (or in the code is ‘GyroAccTrim’) controls how fast the difference between ACC and Gyro gets corrected. In the code it reads ‘CorrectionPitch = IntegralErrorPitch / ParamSet.GyroAccTrim’ where the IntegralErroPitch is the difference between the MeanIntegralPitch (gyro) and the InegralAccPitch, so it is the difference between the calculated angle (roughly) between the two. Big numbers in Acc/Gyro-Comp, it appears, diminishes the impact of the Acc on the correction. I played some (moved it around to some extremes) and ended up with Acc/Gyro-Comp=25 although I would say that this is closer for me but I think it needs more study. Once I got something I liked I transferred the values (using LCD Menu 9 to read off the Poti values) to the actual parameters and remapped the Poti to something else. {{attachment:matrix.gif}}
Zeile 46: Zeile 60:
I then went after the GPS. Again I set GPS-P and GPS-D on potis and both set to 0. This time I started with GPS-D (as outlined by kilaggreg) and adjusted GPS-D until I could see it moving the MK around and kind of holding but swinging. I then backed it down some and started to crank up GPS-P until I appeared to have a good hold. This was not easy since the GPS position is not stable as well, so it is hard to get a feel for what is really moving. If you get too much GPS-P you start to swing again, too much GPS-D and you swing… It is kind of a dance. Thinking of the P as the force to push it back and D as the friction, I kind of tweaked until I got something that appeared to hold (4 batteries it took me). I also notice that these setting are very sensitive so go slow and experiment. I finally ended up with GPS-P=26 and GPS-D=112. I now think I have GPS hold working (assuming I get a good GPS lock). It was some what windy and no circle just a good hold… I could walk up to it and push it out of the way and it would move back into position and stop. I could even drag it to a new location and let go and it would gracefully move back and stop. That’s not to say it was always in the same location, the GPS position would move a bit. (I might need some shielding to improve my GPS receiver sensitivity) I don’t think my GPS parameters will work for anyone else because they are dependent on the other parameters. Just like I had to go back and tweak my Stick parameters, the GPS gets affected the same way. These gyros spit out the rate of angular change. What this means is that (in terms of a PID control, see http://www.embedded.com/2000/0010/0010feat3.htm and http://en.wikipedia.org/wiki/PID_controller for starting info on PID controlers) that Gyro-P is the proportional factor of the gyro rate of change or ‘D’ in the PID control of the MK angle.
Zeile 48: Zeile 62:
I would definitely recommend going back and at least trying to set Gyro-I and Gyro-P correctly for your MK (even if you don’t change any of the others). The beginner settings with Gyro-P at 100 just makes my MK hold that orientation once the stick is released (also making the GPS control not work). I am now actually starting to be happy with how this thing is flying (like what I see in the videos and was expecting) and it is also a lot easier to fly. It was good before but now it is starting to be great. . Still more to go though.... <<BR>> Now, if you take the integral of the rate of angular change you get the angle, so that Gyro-I is then ‘P’ in the PID control of the MK angle. What does that mean? Well, think of a pendulum as an analogy ‘P’ is the force that tries to move the pendulum back to the center. The further away it is the stronger the force to move it back. When the pendulum gets to the center position the force exerted on it is zero but momentum carries it on and past center only to create a force in the opposite direction again to try and move it back. And a swing in created. If you increase ‘P’ [Gyro-I] you are essentially increasing the force to move the MK back to the correct orientation. If ‘P’ is too big it is like pushing someone on a swing and if you push too much the swinging just gets bigger and bigger [MK would oscillate]. If ‘P’ is too little it would be like turning down gravity and you would swing slowly [MK would correct slowly]. . So ‘P’ is the return force.
Zeile 50: Zeile 64:
These gyros spit out the rate of angular change. What this means is that (in terms of a PID control, see http://www.embedded.com/2000/0010/0010feat3.htm and http://en.wikipedia.org/wiki/PID_controller for starting info on PID controlers) that Gyro-P is the proportional factor of the gyro rate of change or ‘D’ in the PID control of the MK angle. Now, if you take the integral of the rate of angular change you get the angel, so that Gyro-I is then ‘P’ in the PID control of the MK angle. What does that mean? Well, think of a pendulum as an analogy (from kilagreg’s explanation about GPS-P/D) ‘P’ is the force that tries to move the pendulum back to the center. The further away it is the stronger the force to move it back. When the pendulum gets to the center position the force exerted on it is zero but momentum carries it on and past center only to create a force in the opposite direction again to try and move it back. And a swing in created. If you increase ‘P’ [Gyro-I] you are essentially increasing the force to move the MK back to the correct orientation. If ‘P’ is too big it is like pushing someone on a swing and if you push too much the swinging just gets bigger and bigger [MK would oscillate]. If ‘P’ is too little it would be like turning down gravity and you would swing slowly [MK would correct slowly]. . So ‘P’ is the return force. <<BR>> Having a MK swing/tilt back and forth like a pendulum would not be a good thing. What you would need is some friction. That’s where ‘D’ [Gyro-P] comes in. ‘D’ is trying to adjust for the rate of change of the angle and provide a force in the opposite direction to try and slow it down if it is approaching the center two fast. ‘D’ is trying to be more predictive. For the pendulum it is like adding friction. That way, as the pendulum swings to the center it is being slowed down and the oscillation die down quickly or don’t happen at all. If ‘D’ is two large its like having the friction to large and the pendulum just stops before it even gets to the center and it resists disturbances or is hard to push [MK tends to hold on to tilts]. If ‘D’ is too small the pendulum just swings back an forth [MK just oscillates for a while] So ‘D’ is like a friction force.
Zeile 52: Zeile 66:
Having a MK swing/tilt back and forth like a pendulum would not be a good thing. What you would need is some friction. That’s where ‘D’ [Gyro-P] comes in. ‘D’ is trying to adjust for the rate of change of the angle and provide a force in the opposite direction to try and slow it down if it is approaching the center two fast. ‘D’ is trying to be more predictive. For the pendulum it is like adding friction. That way, as the pendulum swings to the center it is being slowed down and the oscillation die down quickly or don’t happen at all. If ‘D’ is two large its like having the friction to large and the pendulum just stops before it even gets to the center and it resists disturbances or is hard to push [MK tends to hold on to tilts]. If ‘D’ is too small the pendulum just swings back an forth [MK just oscillates for a while] So ‘D’ is like a friction force. <<BR>> Now what happens if winds blows a pendulum? Well, it would tend (even at rest) to be tilted. For a MK that would also not be good. What is needed is something that accounts for the long term error (average amount away from center) and provides a force to correct. This is the ‘I’ in the PID control. It is the integral of ‘P’. What is ‘I’ in the MK, well I have no clue and I have asked but been ignored many times (now starting to look at the code to figure it out). I would imagine it’s the Hauptregler I-Anteil. So ‘I’ is an adjustment for the average offset error.
Zeile 54: Zeile 68:
Now what happens if winds blows a pendulum? Well, it would tend (even at rest) to be tilted. For a MK that would also not be good. What is needed is something that accounts for the long term error (average amount away from center) and provides a force to correct. This is the ‘I’ in the PID control. It is the integral of ‘P’. What is ‘I’ in the MK, it is the Hauptregler I-Anteil. So ‘I’ is an adjustment for the average offset error. <<BR>> If your MK has a lot of vibration noise, what happens? Well for the ‘I’ portion since it is the average, any noise just gets average out. The ‘P’ porting simply just passes the noise on (so this is like having the angle reading jump around from 1, 4, 2, -1, 3, 1, -3,etc). For ‘D’ it’s a different story. ‘D’ is the rate of change of the angel so the jumping around from ‘P’ would mean that to ‘D’ it looks like it is moving one way then the other, slow then fast,etc. For ‘D’ the noise gets amplified. The MK would be jerky.
Zeile 56: Zeile 70:
If your MK has a lot of vibration noise, what happens? Well for the ‘I’ portion since it is the average, any noise just gets average out. The ‘P’ porting simply just passes the noise on (so this is like having the angle reading jump around from 1, 4, 2, -1, 3, 1, -3,etc). For ‘D’ it’s a different story. ‘D’ is the rate of change of the angel so the jumping around from ‘P’ would mean that to ‘D’ it looks like it is moving one way then the other, slow then fast,etc. For ‘D’ the noise gets amplified. The MK would be jerky. <<BR>> The goal is to have the pendulum very quickly swing back to center and then just stick. How you achieve that goal on a MK or what that looks like no one will say.
Zeile 58: Zeile 72:
The goal is to have the pendulum very quickly swing back to center and then just stick. <<BR>> You can imagine that there are trade offs for all of these setting and changing one affects the others. Add to that the fact that the MK properties of YOUR MK affect this as well. How fast the motors can change RPM, the max thrust, the mass of the arm, the center of gravity, the efficiency of the drive system, sensitivity of the sensors, the wind resistance of the frame etc. You change these things and it’s like changing a portion of the PID control. Something as miniscule as changing the stiffness of the propeller would change the efficiency at various RPM and would then require a tweak on probably P (only then to be followed by checking the others).
Zeile 60: Zeile 74:
You can imagine that there are trade offs for all of these setting and changing one effects the others. Add to that the fact that the MK properties of YOUR MK affect this as well. How fast the motors can change RPM, the max thrust, the mass of the arm, the center of gravity, the efficiency of the drive system, sensitivity of the sensors, the wind resistance of the frame etc. You change these things and it’s like changing a portion of the PID control. Something as miniscule as changing the stiffness of the propeller would change the efficiency at various RPM and would then require a tweak on probably P (only then to be followed by checking the others). <<BR>> Now the gyros are not that accurate/stable (if I understand it correctly) so the accelerometers are used to adjust/correct gyro errors thru the ACC/Gyro Comp. parameter. This essentially determines how fast the gyros get brought back in line with the accelerometer readings. How does this affect the MK flying, I don’t have a clue. Played with it but can’t figure it out.
Zeile 62: Zeile 76:
Now the gyros are not that accurate/stable (so error can accumulate especially in the integral) so the accelerometers are used to adjust/correct gyro Integral errors thru the ACC/Gyro Comp. parameter. This essentially determines how fast the gyros get brought back in line with the accelerometer readings. <<BR>> The Stick parameters and how the stick feels in terms of MK control is also related to how the MK PID control is set up. If the PID is very ‘hard’ then you would need a lot of stick amplification to move the MK. If the MK is set up ‘soft’ and you didn’t change the Stick settings the MK would feel very twitchy. All these things are interrelated. Even the GPS parameters.
Zeile 64: Zeile 78:
The Stick parameters and how the stick feels in terms of MK control is also related to how the MK PID control is set up. If the PID is very ‘hard’ then you would need a lot of stick amplification to move the MK. If the MK is set up ‘soft’ and you didn’t change the Stick settings the MK would feel very twitchy. All these things are interrelated. Even the GPS parameters. <<BR>> '''Example Gyro setup:'''
Zeile 66: Zeile 80:
Setting the PID Parameters
I have continued working on the parameters. First I trimmed my MK so it would not drift one way or the other and I set Stick-D to 0. To set Gyro-I (like P) and Gyro-P (like D), I started with Gyro-P at zero and Gyro-I at 60 with both on Potis and then took off. (The Gyro spits out a voltage that is proportional to the rate of angular change. So Gyro-P (rate of angular change) is really D in a PD controller. If you take the integral of the rate of angular change you get the angle (approximately). This means that the Gyro-I is really P. You have PD control not PI) The MK will be sensitive to the controls and wobbly. I would give little taps to the sick and observe the behavior. In my case the MK would wobble once or twice and then be steady. I then cranked up Gyro-I until the MK almost continuously oscillated after the stick tap then moved Gyro-I down a notch. Don’t let the oscillations bother you, you can still control the MK (as long as you don’t get Gyro-I too big). I then started cranking up Gyro-P. This quickly started settling out the wobbles. I would increase Gyro-P and tap the stick to see how it would respond. If Gyro-P gets to big, you start to notice that the MK doesn’t really level itself out after the stick tap. If Gyro-P is too little it will wobble a little after the stick tap but it will level quickly. The goal is to not have any wobbles while still having the MK return quickly to level after the stick input. When I tap my stick (roll) I give it a good amount of input (especially once I start getting closer to what I think it should be see http://www.rcgroups.com/forums/showa...mentid=1845769). Just play with it,.the better it is set up the bigger the stick tap you can give and have the MK quickly level and start to slow back down. It will also start to feel solid, just don’t let it get to solid or it wont correct quickly enough. I ended up with Gyro_P=67 and Gyro-I=147. Hauptregler I-Anteil: is the ‘I’ for the PID of the Roll and Nick controller. I played with that as well (although not as much) and eventually landed on about 28. It will affect the other parameters so if you play with Hauptregler I-Anteil you will have to go back and re-adjust Gyro-P and Gyro-I. I only tried a couple setting here so no real feel here other that when I had it above 35 I didn’t like how the MK was flying. Acc/Gyro-Comp (or in the code is ‘GyroAccTrim’) controls how fast the difference between ACC and Gyro gets corrected. In the code it reads ‘CorrectionPitch = IntegralErrorPitch / ParamSet.GyroAccTrim’ where the IntegralErroPitch is the difference between the MeanIntegralPitch (gyro) and the InegralAccPitch, so it is the difference between the calculated angle (roughly) between the two. Big numbers in Acc/Gyro-Comp, it appears, diminishes the impact of the Acc on the correction. I played some (moved it around to some extremes) and ended up with Acc/Gyro-Comp=25 although I would say that this is closer for me but I think it needs more study. Once I got something I liked I transferred the values (using LCD Menu 9 to read off the Poti values) to the actual parameters and remapped the Poti to something else.
<<BR>>
Zeile 69: Zeile 82:
--------------------------------------------------------------------------------------------------------  1. First trim the MK so it would not drift one way or the other and set Stick-D to 0.
Zeile 71: Zeile 84:
GPS: (Note, this is for the killagreg older code using Conrad GPS. Although the parameters for NaviCtr for GPS-PID are similar, it would appear that most people are having great success using the std H&I GPS parameters while using the NaviCtr and MK-GPS. The MK must be very stable for the GPS to work well)  1. To set Gyro-I and Gyro-P, start with Gyro-P at zero and Gyro-I at 60 with both on Potis and then took off.
The MK will be sensitive to the controls and wobbly. Give little taps to the sick and observe the behavior.
Zeile 73: Zeile 87:
Explanation of GPS Parameters: (tranlation from killegreg)
The P-parameter defines the strength of the control for the position hold; therefore, our virtual GPS-helper-pilot steers more strongly towards the target when this factor increases. You can understand this by thinking of a pendulum. The further the pendulum is away from the center (the further the MK is away from the target), the stronger the force is to pull it back to the center. Increasing P would be like increasing gravity or the force to push it back to the center. It so happens that the pendulum accelerates in the direction toward the center. At the moment the center is reached, there is no applied force to move the pendulum in any direction. The pendulum though, would still have some velocity (momentum) at this point and the pendulum would then swing away from the center in the opposite direction (the MK would shoot past the target). Without any friction to dampen the swinging this little game would then continue for ever. The swinging could actually get worse. So, the higher the P-Parameter is the stronger the ‘push’ on the pendulum back towards the center.
 * If the MK wobbles once or twice and then steadies then crank up Gyro-I until the MK almost continuously oscillated after the stick tap then moved Gyro-I down a notch. Don’t let the oscillations bother you, you can still control the MK (as long as you don’t get Gyro-I too big).
 * Then start cranking up Gyro-P. This quickly settles out wobbles.
 * Increase Gyro-P and tap the stick to see how it would respond. If Gyro-P gets to big, notice that the MK doesn’t really level itself out after the stick tap. If Gyro-P is too little it will wobble a little after the stick tap but it will level quickly.
 * The goal is to not have any wobbles while still having the MK return quickly to level after the stick input.
 * The better it is set up the bigger the stick tap you can give and have the MK quickly level and start to slow back down.
 * It will also start to feel solid, just don’t let it get to solid or it wont correct quickly enough.
 * Hauptregler I-Anteil is the ‘I’ for the PID of the Roll and Nick controller. It will affect the other parameters so if you play with Hauptregler I-Anteil you will have to go back and re-adjust Gyro-P and Gyro-I.
 * Acc/Gyro-Comp (or in the code is ‘GyroAccTrim’) controls how fast the difference between ACC and Gyro gets corrected.
 * In the code it reads ‘CorrectionPitch = IntegralErrorPitch / ParamSet.GyroAccTrim’ where the IntegralErroPitch is the difference between the MeanIntegralPitch (gyro) and the InegralAccPitch
 * It is the difference between the calculated angle (roughly) between the two.
 * Big numbers in Acc/Gyro-Comp diminishes the impact of the Acc on the correction.
 * Moving on to GPS, set GPS-P and GPS-D on potis and both set to 0. This time start with GPS-D and adjust GPS-D until the MK begins moving around and kind of holding but swinging.
 * Then back down some and start to crank up GPS-P until it appeared to have a good hold.
 * If you get too much GPS-P you start to swing again, too much GPS-D and you swing…
 * Think of the P as the force to push it back and D as the friction
<<BR>>
Zeile 76: Zeile 104:
This is why we have a D-parameter, it makes sure that it proportionally steers against the over ground speed. This is the ‘friction’ parameter in the control system. It works similarly to friction in a pendulum system. If the friction is too high, then a pendulum that was not at it center would very slowly move back and then just stop when it got close. If the friction is too light, then the pendulum would just swing back and forth for a while. = Understanding Acc/Gyro-Factor = <<BR>>
Zeile 78: Zeile 106:
Now, there is just the right relationship from return-force (P) and friction (D) that would allow a pendulum to quickly swing back to the center and then just stay there. These are the settings that you are trying to find. This is impacted by the reaction of the MK to the virtual GPS-helper-pilot stick movements. This is not impacted by the P and D of the RC-Stick settings but from the Gyro Settings that defines the reaction/behavior of the MK. Acc/Gyro-Factor (or GyroAccFactor below) is simply a scaling factor that allows the ACC and Gyro integral sensor values to be compared. If the ACC and Gyro Integral lines in MK-Tools do not line up then it can be corrected with this scaling factor. <<BR>>
Zeile 80: Zeile 108:
On top of this is the fact that the GPS-Position and the over ground speed also changes even for a MK that is stationary. This is because of atmospheric disturbances and start point quality, etc. Putting this is terms of the pendulum example; it would be like the hanging point for the pendulum would also be moving. So for example, trying to hold a pendulum without swinging it at the end of an outreached arm would be very difficult. The pendulum would swing all over the place if the ‘friction’ (D) was not large enough. Once the two sensor values (from Gyro and Acc) are scaled correctly, they can then be compared and used to determine orientation of the MK (pitch/roll). The Acc/Gyro-Com (or GyroAccTrim below) controls the fusion of the two readings (ACC vs Gyro). The larger the number the smaller the impact that the ACC have (it scales the error between the two reading down), the smaller the number the bigger the impact the ACC have. According to the Wiki, larger numbers are better for hovering. The ACC are more suseptable to vibration noise so this is also a factor for MK jitters depending on your setup and vibration levels. <<BR>>
Zeile 82: Zeile 110:
Setting GPS Parameters
Set GPS-P (userparam5) to zero
Set GPS-D (userparam6) to a Poti and move the Poti to zero (as seen from the Display-Menu)
Manually hover in one spot
Gradually increase the Poti (GPS-D) until you see some light jittering/wobbling. Then move the Poti back a little
Read the Poti value in MK-Tools (from the Display-Menu) and set GPS-D (userparam6) to that value
Set GPS-P (userparam5) to a Poti and move the Poti to zero (as seen from the Display-Menu)
Again manually hover in one spot
Gradually increase the Poti (GPS-P) until a noticeable position correction is obtained but not too much that the MK strongly over steers.
Read the Poti value in MK-Tools (from the Display-Menu) and set GPS-P (userparam5) to that value
The Drift Compensation limits the amount of correction that can be added to what the MK thinks is its Nuetral position. 0 = no correction. The correction is from a longer term (500ms) comparison of the ACC (using gravity) and the Gyro pitch/roll readings. There might be Gyro drift but gravity should not change and this allows some correction for the long term diff. between the Gyro and ACC for Nutral. When you push your stick to the uper left to cal the Gyro sensors you are essentially calculating Gyro Neutral using the ACC cal values. The Drift Compensation is an attempt to keep the Gyros Neutral in cal during flight. <<BR>>
Zeile 93: Zeile 112:
In general, the relationship between GPS D&P has to be correct. If P is too big and D too little the MK will start to swing. If D is too big then the MK will start to jitter/wobble. Finally, you have to be certain that the compass actually points to North (about 350° to 10°) when the front of the MK actually is exactly pointing to the North. If this is not correct, then the GPS control will cause the MK to circle around the set point or the MK will just fly away.

My GPS Settings
Again I set GPS-P and GPS-D on potis and both set to 0. This time I started with GPS-D (as outlined by kilaggreg) and adjusted GPS-D until I could see it moving the MK around and kind of holding but swinging. I then backed it down some and started to crank up GPS-P until I appeared to have a good hold. This was not easy since the GPS position is not stable as well it is hard to get a feel for what is really moving. If you get too much GPS-P you start to swing again, too much GPS-D and you swing… It is kind of a dance. Thinking of the P as the force to push it back and D as the friction, I kind of tweaked until I got something that appeared to hold (4 batteries it took me). I also notice that these setting are very sensitive so go slow and experiment. I finally ended up with GPS-P=26 and GPS-D=112. I now think I have GPS hold working (assuming I get a good GPS lock). It was some what windy and no circle just a good hold… I could walk up to it and push it out of the way and it would move back into position and stop. I could even drag it to a new location and let go and it would gracefully move back and stop. That’s not to say it was always in the same location, the GPS position would move a bit. (my need some shielding to improve my GPS receiver sensitivity) I don’t think my GPS parameters will work for anyone else because they are dependent on the other parameters. Just like I had to go back and tweak my Stick parameters, the GPS gets affected the same way.

I would definitely recommend going back and at least trying to set Gyro-I and Gyro-P correctly for your MK (even if you don’t change any of the others). The beginner settings with Gyro-P at 100 just makes my MK hold that orientation once the stick is released. I am now actually starting to be happy with how this thing is flying and it is also a lot easier to fly.


The Acc/Gyro-Factor (or GyroAccFactor below) is simply a scaling factor that allows the ACC and Gyro integral sensor values to be compared. If the ACC and Gyro Integral lines in MK-Tools do not line up then it can be corrected with this scaling factor.

Once the two sensor values (from Gyro and Acc) are scaled correctly, they can then be compared and used to determine orientation of the MK (pitch/roll). The Acc/Gyro-Com (or GyroAccTrim below) controls the fusion of the two readings (ACC vs Gyro). The larger the number the smaller the impact that the ACC have (it scales the error between the two reading down), the smaller the number the bigger the impact the ACC have. According to the Wiki, larger numbers are better for hovering. The ACC are more suseptable to vibration noise so this is also a factor for MK jitters depending on your setup and vibration levels.

The Drift Compensation limits the amount of correction that can be added to what the MK thinks is its Nuetral position. 0 = no correction. The correction is from a longer term (500ms) comparison of the ACC (using gravity) and the Gyro pitch/roll readings. There might be Gyro drift but gravity should not change and this allows some correction for the long term diff. between the Gyro and ACC for Nutral. When you push your stick to the uper left to cal the Gyro sensors you are essentially calculating Gyro Neutral using the ACC cal values. The Drift Compensation is an attempt to keep the Gyros Neutral in cal during flight.

Richard

..............
// ++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++
 . === Correction Formula: ===
{{{
Zeile 132: Zeile 135:
............... }}}
<<BR>>
Zeile 134: Zeile 138:
For the Gyro / ACC Factor: It appears to be a ‘scaling factor’ to allow for the comparison of the Acc (essentially using gravity to measure the angle of the MK) and the Gyro Integral (since the gyros spit out the rate of angular change the Gyro Integral [sum of the angular changes] is just proportional to angle of the MK) This difference allows the Current Reding_Integral_Gyro value to be corrected by the difference between the two. The Acc essentially keeps the Gyro Integral (sum of rate of angular changes) in check. In the code it looks like this. For the Gyro / ACC Factor: It appears to be a ‘scaling factor’ to allow for the comparison of the Acc (essentially using gravity to measure the angle of the MK) and the Gyro Integral (since the gyros spit out the rate of angular change the Gyro Integral [sum of the angular changes] is just proportional to angle of the MK) This difference allows the Current Reding_Integral_Gyro value to be corrected by the difference between the two. The Acc essentially keeps the Gyro Integral (sum of rate of angular changes) in check. In the code it looks like this. <<BR>>
Zeile 136: Zeile 140:
{{{
Zeile 138: Zeile 143:
}}}
<<BR>>
Zeile 139: Zeile 146:
Later in the code IntegralAccPitch = (ParamSet.GyroAccFactor * IntegralAccPitch ) / BALANCE_NUMBER; So InegralAccPitch gets scaled up to the IntegralGyro level. (BALANCE_NUMBER is just used to calculate the average value) Later in the code
Zeile 141: Zeile 148:
To me it only made sense then that if I wanted to set Gyro / ACC Factor correctly that I would calculate the average ratio of IntegralPitch/Mean_ACCPitch. The resultant average is then the correct scaling factor to be used as Gyro / ACC Factor. I did this by first setting Gyro/Acc factor to ‘1’ (note that the debug_out funtion uses the ‘Factor’ to scale the Integral value before outputting it so you need to set it to 1 to get this to work) and then running the MK-Tool scope and moving the MK through about 6 or 7 tilted positions (letting it rest for about 10-20 sec at each) and then exporting the resultant data (using ‘Export’ button in MK-Tools). I loaded the data into Excel, removed the periods where the MK was moving or level, calculated the ratio of IntegralPitch/Mean_AccPitch and averaged them (for both Roll and Pitch). {{{
IntegralAccPitch = (ParamSet.GyroAccFactor * IntegralAccPitch ) / BALANCE_NUMBER; So InegralAccPitch gets scaled up to the IntegralGyro level. (BALANCE_NUMBER is just used to calculate the average value)
}}}
<<BR>>
Zeile 143: Zeile 153:
I don’t know if that makes sense to anyone else but to me it seamed more appropriate than just looking at the scope traces. In any event, what you really want are the Mean_AccPitch and IntegralPitch (or Roll) traces to match when the MK is tilted and at rest. I always thought it was supposed to be the IntegralPitch and AccPitch. If you want to set Gyro / ACC Factor correctly then you should calculate the average ratio of IntegralPitch/Mean_ACCPitch. The resultant average is then the correct scaling factor to be used as Gyro / ACC Factor. <<BR>>
Zeile 145: Zeile 155:
 1. First set Gyro/Acc factor to ‘1’ (note that the debug_out funtion uses the ‘Factor’ to scale the Integral value before outputting it so you need to set it to 1 to get this to work)
 1. Then run the MK-Tool scope and move the MK through about 6 or 7 tilted positions (letting it rest for about 10-20 sec at each) and then export the resulting data (using ‘Export’ button in MK-Tools).
 1. Load the data into Excel, remove the periods where the MK was moving or level, calculate the ratio of IntegralPitch/Mean_AccPitch and average them (for both Roll and Pitch).
<<BR>>
Zeile 146: Zeile 160:
"If you push the Gas/Yaw stick up and to the right, the zero level of the ACC sensors get stored in EEProm (since V0.68). Every time you turn on the MK, the ACC settings (calibration offsets) are reloaded from the EEProm. For the ACC calibration it is very important that the MK is as horizontal and still as possible. As a rule, the ACC only needs to be calibrated once, after that you can start from an embankment or sloping surface without problems. The Mean_AccPitch and IntegralPitch (or Roll) traces should match when the MK is tilted and at rest. <<BR>>
Zeile 148: Zeile 162:
Before ever start (take off) the Gyros need to be re-calibrated. To do this, move the Gas/Yaw stick up and to the left until you hear the beep/s and the green LED lights up (during this process only the Gyros get calibrated not the ACC). It is very important that the MK is not moved during this process. The position is not important."
-----------------
= ACC Setup = <<BR>>
Zeile 151: Zeile 164:
Gravity and the ACC sensors along with the stored offsets in EEProm then take care of of the MK knowing its orientation. The Gyro Integrals (angle) need to have a valid starting point so calibrating them before take off takes care of that. If you push the Gas/Yaw stick up and to the right, the zero level of the ACC sensors get stored in EEProm (since V0.68). Every time you turn on the MK, the ACC settings (calibration offsets) are reloaded from the EEProm. For the ACC calibration it is very important that the MK is as horizontal and still as possible. As a rule, the ACC only needs to be calibrated once, after that you can start from an embankment or sloping surface without problems. <<BR>>
Zeile 153: Zeile 166:
attachment:matrix.gif Before ever start (take off) the Gyros need to be re-calibrated. To do this, <<BR>>
Zeile 155: Zeile 168:
For the drifting - vibration, vibration, vibration.....you have to work on it and this would be the first thing to look at. Its hard to try and diagnose from a distance but here are a few things...  1. Move the Gas/Yaw stick up and to the left until you hear the beep/s and the green LED lights up (during this process only the Gyros get calibrated not the ACC).
 1. It is very important that the MK is not moved during this process. The position is not important."
Zeile 157: Zeile 171:
1) If D is too large (Gyro-P in MK-Tools) then the MK can 'stick' at an angle and not return back to full neutral (this would be like flying a normal heli) and if you dont have the experience then you would probably be touching the controls all the time and overcorrecting the craft. Also, D amplifies noise and vibration could have a bigger impact. [you will aslo need enough P (Gyro-I in MK-Tools) to make sure your craft responds quick enough to return to neutral)  1. Gravity and the ACC sensors along with the stored offsets in EEProm then take care of of the MK knowing its orientation. The Gyro Integrals (angle) need to have a valid starting point so calibrating them before take off takes care of that.
<<BR>>
Zeile 159: Zeile 174:
2) Assuming you have your PID set up nicely then you could also try minimizing the impact of the ACC sensors by increasing ACC/Gyro-Comp. Again, this will minimize the noise from vibration since the ACC are obviously designed to measure it. The disadvantage is that your craft will then also be more susceptible to wind drifting. If you set ACC/Gyro-Comp to 1 and fly it you will see the thing jittering all over the place. This is the noise from the ACC sensors (vibration). You want ACC/Gyro-Comp as low as you can go without it impacting the stability of the flight and the number is different for each mk and vibration level. = Managing Vibrations =
 * If D is too large (Gyro-P in MK-Tools
) then the MK can 'stick' at an angle and not return back to full neutral (this would be like flying a normal heli) and if you dont have the experience then you would probably be touching the controls all the time and overcorrecting the craft. Also, D amplifies noise and vibration could have a bigger impact. [you will aslo need enough P (Gyro-I in MK-Tools) to make sure your craft responds quick enough to return to neutral)
 *
Assuming you have your PID set up nicely then you could also try minimizing the impact of the ACC sensors by increasing ACC/Gyro-Comp. Again, this will minimize the noise from vibration since the ACC are obviously designed to measure it. The disadvantage is that your craft will then also be more susceptible to wind drifting. If you set ACC/Gyro-Comp to 1 and fly it you will see the thing jittering all over the place. This is the noise from the ACC sensors (vibration). You want ACC/Gyro-Comp as low as you can go without it impacting the stability of the flight and the number is different for each mk and vibration level.
 * Don’t set ‘Hauptregler I-Anteil’ too high. If set too high it tends to overcorrect for the difference between stick and actual MK attitude and after you move the stick back to neutral the MK will still be trying to correct for the error cause by the MK not being able to move as fast as your finger.
<<BR>>
Zeile 161: Zeile 180:
3) Don’t have ‘Hauptregler I-Anteil’ to high. If to big it tends to overcorrect for the difference between stick and actual MK attitude and after you move the stick back to neutral the MK will still be trying to correct for the error cause by the MK not being able to move as fast as your finger. Try setting it to say 150 and see how flying it feels. You will want to land it quickly. = Content Credits =
 * Arthur P.
 * Brashley
 * Old Man Mike
 * Rusty (13brv3)
/!\ ToDo: cleanup, update with new features
Zeile 163: Zeile 187:
/!\ ToDo: Organize into sections, cleanup ----
 . KategorieEnglish KategorieEnglish

Understanding MKTools Parameters

Mikrokopter Tools (MKTools) allows the user to configure settings on the Mikrokopter such as gyro gains, gps holding thresholds, camera motion settings, and many others. The purpose of this page is to present a deeper understanding of the MKTools settings. General information about MKTools can be found here.

The table below can be tracked here. This table summarizes popular setups, MKTools settings, and performance of those settings in the real world. This is a good place to start when learning how to configure your Mikrokopter using MKTools. mkparametertable.jpg

Screen: Stick

  • Stick nick/roll P: Response to degree of stick movement. High value: Needs small stick novements. Low value: Needs large stick movements. Default values: 8-15.
  • Stick nick/roll D: Response to speed of stick movement. High value: very twitchy on overcontrol. Low value: sluggish. Default values: 16-30
  • Gier P: Yaw response to stick movement. High value: Fast yaw. Low value: Slow yaw. Default values: 6-12.

Screen: Gyro

  • Gyro P: Speed of response to gyro angle changes. High value: Fast response, dampending oscillations. Low value: Sluggish response. Default values: 80-100.
  • Gyro I: Level of gyro control. High values: Very strong control, wagging if too high. Low values: Oscillations and wind sensitivity. Default values: 120-150
  • Gyro D: ??
  • Acc/gyro factor: Accurateness of overlay of gyro and acc curves. Check by looking at curves in MKTool. Default value: 30.
  • Acc/gyro comp: Frequency of acc/gyro correction. High value: High frequency, more stable. Low value: Less stable. Default values: 16-32. Extended values: Up to 100.
  • Dynamic stability: Throttle level for control relative to current throttle position. High value: Can exceed throttle, ballooning in wind gusts. Low value: Remains below throttle, no bouncing in wind. 50-100. Value of 64 should be neutral.
  • Haupt I: Level of accurateness between stick and craft attitude. High value: Heading hold. Low value: Less heading hold effect. Default values: 16-32

Screen: Hohe

  • Hohe min gas: Minimum throttle if altitude hold active. High value: Less rapid descent on exceeding altitude, even balloon in wind if too high. Low value: More rapid drop on exceeding altitude. Default values: 30-100. Note: test for hover throttle, then set value to just under hover value.
  • Hohe P: Rapidity of response to exceeding of altitude. High value: More rapid response. Low value: Slower response, more exceeding of set altitude. Default value: 10
  • Baro D: Level of pressure difference leading to response. High value: More sensitive to small differences. Low value: Less sensitive to small gusts . Default value: 30.
  • Z acc: Compensation by changes in vertical acc values. High value: More sensitive to vertical acceleration changes. Low value: Less response to rapid descent. Default value: 30
  • Verstarkung: Gain, maximum altitude allowed: High value: Larger maximum altitude. Low value: Lower maximum altitude. Default values: 3-4

Screen: Other

  • Min gas: Throttle level needed for stationary running of all motors on throttle on. High values: Higher stationary speed, no stopping of motors in flight. Low values: Some motors not starting on motor on, motors stopping in flight. Default values: 10-20. Note: for converted TowerPro's you tend to need values of 15 to 20.

  • Max gas: Maximum throttle allowed for user (remainder usable for control?). Higher values: Less stable on low battery, but more throttle for cushening of rapid descent and landing?. Low values: More stable on low battery, bet less ability to prevent hard landing? Default values: 230-250

Screen: GPS

Explanation of GPS Parameters

The P-parameter defines the strength of the control for the position hold; therefore, our virtual GPS-helper-pilot steers more strongly towards the target when this factor increases. You can understand this by thinking of a pendulum. The further the pendulum is away from the center (the further the MK is away from the target), the stronger the force is to pull it back to the center. Increasing P would be like increasing gravity or the force to push it back to the center. It so happens that the pendulum accelerates in the direction toward the center. At the moment the center is reached, there is no applied force to move the pendulum in any direction. The pendulum though, would still have some velocity (momentum) at this point and the pendulum would then swing away from the center in the opposite direction (the MK would shoot past the target). Without any friction to dampen the swinging this little game would then continue for ever. The swinging could actually get worse. So, the higher the P-Parameter is the stronger the ‘push’ on the pendulum back towards the center.

This is why we have a D-parameter, it makes sure that it proportionally steers against the over ground speed. This is the ‘friction’ parameter in the control system. It works similarly to friction in a pendulum system. If the friction is too high, then a pendulum that was not at it center would very slowly move back and then just stop when it got close. If the friction is too light, then the pendulum would just swing back and forth for a while.

Now, there is just the right relationship from return-force (P) and friction (D) that would allow a pendulum to quickly swing back to the center and then just stay there. These are the settings that you are trying to find. This is impacted by the reaction of the MK to the virtual GPS-helper-pilot stick movements. This is not impacted by the P and D of the RC-Stick settings but from the Gyro Settings that defines the reaction/behavior of the MK.

On top of this is the fact that the GPS-Position and the over ground speed also changes even for a MK that is stationary. This is because of atmospheric disturbances and start point quality, etc. Putting this is terms of the pendulum example; it would be like the hanging point for the pendulum would also be moving. So for example, trying to hold a pendulum without swinging it at the end of an outreached arm would be very difficult. The pendulum would swing all over the place if the ‘friction’ (D) was not large enough.

Setting GPS Parameters

  1. Set GPS-P (userparam5) to zero
  2. Set GPS-D (userparam6) to a Poti and move the Poti to zero (as seen from the Display-Menu)
  3. Manually hover in one spot
  4. Gradually increase the Poti (GPS-D) until you see some light jittering/wobbling. Then move the Poti back a little
  5. Read the Poti value in MK-Tools (from the Display-Menu) and set GPS-D (userparam6) to that value
  6. Set GPS-P (userparam5) to a Poti and move the Poti to zero (as seen from the Display-Menu)
  7. Again manually hover in one spot
  8. Gradually increase the Poti (GPS-P) until a noticeable position correction is obtained but not too much that the MK strongly over steers.
  9. Read the Poti value in MK-Tools (from the Display-Menu) and set GPS-P (userparam5) to that value

In general, the relationship between GPS D&P has to be correct.

If P is too big and D too little the MK will start to swing. If D is too big then the MK will start to jitter/wobble.

Finally, you have to be certain that the compass actually points to North (about 350° to 10°) when the front of the MK actually is exactly pointing to the North. If this is not correct, then the GPS control will cause the MK to circle around the set point or the MK will just fly away.

Understanding PID Gyros


matrix.gif

These gyros spit out the rate of angular change. What this means is that (in terms of a PID control, see http://www.embedded.com/2000/0010/0010feat3.htm and http://en.wikipedia.org/wiki/PID_controller for starting info on PID controlers) that Gyro-P is the proportional factor of the gyro rate of change or ‘D’ in the PID control of the MK angle.


Now, if you take the integral of the rate of angular change you get the angle, so that Gyro-I is then ‘P’ in the PID control of the MK angle. What does that mean? Well, think of a pendulum as an analogy ‘P’ is the force that tries to move the pendulum back to the center. The further away it is the stronger the force to move it back. When the pendulum gets to the center position the force exerted on it is zero but momentum carries it on and past center only to create a force in the opposite direction again to try and move it back. And a swing in created. If you increase ‘P’ [Gyro-I] you are essentially increasing the force to move the MK back to the correct orientation. If ‘P’ is too big it is like pushing someone on a swing and if you push too much the swinging just gets bigger and bigger [MK would oscillate]. If ‘P’ is too little it would be like turning down gravity and you would swing slowly [MK would correct slowly]. . So ‘P’ is the return force.


Having a MK swing/tilt back and forth like a pendulum would not be a good thing. What you would need is some friction. That’s where ‘D’ [Gyro-P] comes in. ‘D’ is trying to adjust for the rate of change of the angle and provide a force in the opposite direction to try and slow it down if it is approaching the center two fast. ‘D’ is trying to be more predictive. For the pendulum it is like adding friction. That way, as the pendulum swings to the center it is being slowed down and the oscillation die down quickly or don’t happen at all. If ‘D’ is two large its like having the friction to large and the pendulum just stops before it even gets to the center and it resists disturbances or is hard to push [MK tends to hold on to tilts]. If ‘D’ is too small the pendulum just swings back an forth [MK just oscillates for a while] So ‘D’ is like a friction force.


Now what happens if winds blows a pendulum? Well, it would tend (even at rest) to be tilted. For a MK that would also not be good. What is needed is something that accounts for the long term error (average amount away from center) and provides a force to correct. This is the ‘I’ in the PID control. It is the integral of ‘P’. What is ‘I’ in the MK, well I have no clue and I have asked but been ignored many times (now starting to look at the code to figure it out). I would imagine it’s the Hauptregler I-Anteil. So ‘I’ is an adjustment for the average offset error.


If your MK has a lot of vibration noise, what happens? Well for the ‘I’ portion since it is the average, any noise just gets average out. The ‘P’ porting simply just passes the noise on (so this is like having the angle reading jump around from 1, 4, 2, -1, 3, 1, -3,etc). For ‘D’ it’s a different story. ‘D’ is the rate of change of the angel so the jumping around from ‘P’ would mean that to ‘D’ it looks like it is moving one way then the other, slow then fast,etc. For ‘D’ the noise gets amplified. The MK would be jerky.


The goal is to have the pendulum very quickly swing back to center and then just stick. How you achieve that goal on a MK or what that looks like no one will say.


You can imagine that there are trade offs for all of these setting and changing one affects the others. Add to that the fact that the MK properties of YOUR MK affect this as well. How fast the motors can change RPM, the max thrust, the mass of the arm, the center of gravity, the efficiency of the drive system, sensitivity of the sensors, the wind resistance of the frame etc. You change these things and it’s like changing a portion of the PID control. Something as miniscule as changing the stiffness of the propeller would change the efficiency at various RPM and would then require a tweak on probably P (only then to be followed by checking the others).


Now the gyros are not that accurate/stable (if I understand it correctly) so the accelerometers are used to adjust/correct gyro errors thru the ACC/Gyro Comp. parameter. This essentially determines how fast the gyros get brought back in line with the accelerometer readings. How does this affect the MK flying, I don’t have a clue. Played with it but can’t figure it out.


The Stick parameters and how the stick feels in terms of MK control is also related to how the MK PID control is set up. If the PID is very ‘hard’ then you would need a lot of stick amplification to move the MK. If the MK is set up ‘soft’ and you didn’t change the Stick settings the MK would feel very twitchy. All these things are interrelated. Even the GPS parameters.


Example Gyro setup:


  1. First trim the MK so it would not drift one way or the other and set Stick-D to 0.
  2. To set Gyro-I and Gyro-P, start with Gyro-P at zero and Gyro-I at 60 with both on Potis and then took off.

The MK will be sensitive to the controls and wobbly. Give little taps to the sick and observe the behavior.

  • If the MK wobbles once or twice and then steadies then crank up Gyro-I until the MK almost continuously oscillated after the stick tap then moved Gyro-I down a notch. Don’t let the oscillations bother you, you can still control the MK (as long as you don’t get Gyro-I too big).
  • Then start cranking up Gyro-P. This quickly settles out wobbles.
  • Increase Gyro-P and tap the stick to see how it would respond. If Gyro-P gets to big, notice that the MK doesn’t really level itself out after the stick tap. If Gyro-P is too little it will wobble a little after the stick tap but it will level quickly.
  • The goal is to not have any wobbles while still having the MK return quickly to level after the stick input.
  • The better it is set up the bigger the stick tap you can give and have the MK quickly level and start to slow back down.
  • It will also start to feel solid, just don’t let it get to solid or it wont correct quickly enough.
  • Hauptregler I-Anteil is the ‘I’ for the PID of the Roll and Nick controller. It will affect the other parameters so if you play with Hauptregler I-Anteil you will have to go back and re-adjust Gyro-P and Gyro-I.
  • Acc/Gyro-Comp (or in the code is ‘GyroAccTrim’) controls how fast the difference between ACC and Gyro gets corrected.

  • In the code it reads ‘CorrectionPitch = IntegralErrorPitch / ParamSet.GyroAccTrim’ where the IntegralErroPitch is the difference between the MeanIntegralPitch (gyro) and the InegralAccPitch

  • It is the difference between the calculated angle (roughly) between the two.
  • Big numbers in Acc/Gyro-Comp diminishes the impact of the Acc on the correction.
  • Moving on to GPS, set GPS-P and GPS-D on potis and both set to 0. This time start with GPS-D and adjust GPS-D until the MK begins moving around and kind of holding but swinging.
  • Then back down some and start to crank up GPS-P until it appeared to have a good hold.
  • If you get too much GPS-P you start to swing again, too much GPS-D and you swing…
  • Think of the P as the force to push it back and D as the friction


= Understanding Acc/Gyro-Factor =

Acc/Gyro-Factor (or GyroAccFactor below) is simply a scaling factor that allows the ACC and Gyro integral sensor values to be compared. If the ACC and Gyro Integral lines in MK-Tools do not line up then it can be corrected with this scaling factor.

Once the two sensor values (from Gyro and Acc) are scaled correctly, they can then be compared and used to determine orientation of the MK (pitch/roll). The Acc/Gyro-Com (or GyroAccTrim below) controls the fusion of the two readings (ACC vs Gyro). The larger the number the smaller the impact that the ACC have (it scales the error between the two reading down), the smaller the number the bigger the impact the ACC have. According to the Wiki, larger numbers are better for hovering. The ACC are more suseptable to vibration noise so this is also a factor for MK jitters depending on your setup and vibration levels.

The Drift Compensation limits the amount of correction that can be added to what the MK thinks is its Nuetral position. 0 = no correction. The correction is from a longer term (500ms) comparison of the ACC (using gravity) and the Gyro pitch/roll readings. There might be Gyro drift but gravity should not change and this allows some correction for the long term diff. between the Gyro and ACC for Nutral. When you push your stick to the uper left to cal the Gyro sensors you are essentially calculating Gyro Neutral using the ACC cal values. The Drift Compensation is an attempt to keep the Gyros Neutral in cal during flight.

  • === Correction Formula: ===

// MeasurementCounter is incremented in the isr of analog.c
if(MeasurementCounter >= BALANCE_NUMBER) // averaging number has reached
{
static int16_t cnt = 0;
static int8_t last_n_p, last_n_n, last_r_p, last_r_n;
static int32_t MeanIntegralPitch_old, MeanIntegralRoll_old;
// if not lopping in any direction (this should be alwais the case,
// because the Measurement counter is reset to 0 if looping in any direction is active.)
if(!Looping_Pitch && !Looping_Roll)
{
// Calculate mean value of the gyro integrals
MeanIntegralPitch /= BALANCE_NUMBER;
MeanIntegralRoll /= BALANCE_NUMBER;
// Calculate mean of the acceleration values
IntegralAccPitch = (ParamSet.GyroAccFactor * IntegralAccPitch) / BALANCE_NUMBER;
IntegralAccRoll = (ParamSet.GyroAccFactor * IntegralAccRoll ) / BALANCE_NUMBER;
// Pitch ++++++++++++++++++++++++++++++++++++++++++++++++
// Calculate deviation of the averaged gyro integral and the averaged acceleration integral
IntegralErrorPitch = (int32_t)(MeanIntegralPitch - (int32_t)IntegralAccPitch);
CorrectionPitch = IntegralErrorPitch / ParamSet.GyroAccTrim;
AttitudeCorrectionPitch = CorrectionPitch / BALANCE_NUMBER


For the Gyro / ACC Factor: It appears to be a ‘scaling factor’ to allow for the comparison of the Acc (essentially using gravity to measure the angle of the MK) and the Gyro Integral (since the gyros spit out the rate of angular change the Gyro Integral [sum of the angular changes] is just proportional to angle of the MK) This difference allows the Current Reding_Integral_Gyro value to be corrected by the difference between the two. The Acc essentially keeps the Gyro Integral (sum of rate of angular changes) in check. In the code it looks like this.

// determine the deviation of gyro integral from averaged acceleration sensor
tmp_long = (int32_t)(IntegralPitch / ParamSet.GyroAccFactor - (int32_t)Mean_AccPitch);


Later in the code

IntegralAccPitch = (ParamSet.GyroAccFactor * IntegralAccPitch ) / BALANCE_NUMBER; So InegralAccPitch gets scaled up to the IntegralGyro level. (BALANCE_NUMBER is just used to calculate the average value)


If you want to set Gyro / ACC Factor correctly then you should calculate the average ratio of IntegralPitch/Mean_ACCPitch. The resultant average is then the correct scaling factor to be used as Gyro / ACC Factor.

  1. First set Gyro/Acc factor to ‘1’ (note that the debug_out funtion uses the ‘Factor’ to scale the Integral value before outputting it so you need to set it to 1 to get this to work)
  2. Then run the MK-Tool scope and move the MK through about 6 or 7 tilted positions (letting it rest for about 10-20 sec at each) and then export the resulting data (using ‘Export’ button in MK-Tools).
  3. Load the data into Excel, remove the periods where the MK was moving or level, calculate the ratio of IntegralPitch/Mean_AccPitch and average them (for both Roll and Pitch).


The Mean_AccPitch and IntegralPitch (or Roll) traces should match when the MK is tilted and at rest.

= ACC Setup =

If you push the Gas/Yaw stick up and to the right, the zero level of the ACC sensors get stored in EEProm (since V0.68). Every time you turn on the MK, the ACC settings (calibration offsets) are reloaded from the EEProm. For the ACC calibration it is very important that the MK is as horizontal and still as possible. As a rule, the ACC only needs to be calibrated once, after that you can start from an embankment or sloping surface without problems.

Before ever start (take off) the Gyros need to be re-calibrated. To do this,

  1. Move the Gas/Yaw stick up and to the left until you hear the beep/s and the green LED lights up (during this process only the Gyros get calibrated not the ACC).
  2. It is very important that the MK is not moved during this process. The position is not important."
  3. Gravity and the ACC sensors along with the stored offsets in EEProm then take care of of the MK knowing its orientation. The Gyro Integrals (angle) need to have a valid starting point so calibrating them before take off takes care of that.


Managing Vibrations

  • If D is too large (Gyro-P in MK-Tools) then the MK can 'stick' at an angle and not return back to full neutral (this would be like flying a normal heli) and if you dont have the experience then you would probably be touching the controls all the time and overcorrecting the craft. Also, D amplifies noise and vibration could have a bigger impact. [you will aslo need enough P (Gyro-I in MK-Tools) to make sure your craft responds quick enough to return to neutral)
  • Assuming you have your PID set up nicely then you could also try minimizing the impact of the ACC sensors by increasing ACC/Gyro-Comp. Again, this will minimize the noise from vibration since the ACC are obviously designed to measure it. The disadvantage is that your craft will then also be more susceptible to wind drifting. If you set ACC/Gyro-Comp to 1 and fly it you will see the thing jittering all over the place. This is the noise from the ACC sensors (vibration). You want ACC/Gyro-Comp as low as you can go without it impacting the stability of the flight and the number is different for each mk and vibration level.
  • Don’t set ‘Hauptregler I-Anteil’ too high. If set too high it tends to overcorrect for the difference between stick and actual MK attitude and after you move the stick back to neutral the MK will still be trying to correct for the error cause by the MK not being able to move as fast as your finger.


Content Credits

  • Arthur P.
  • Brashley
  • Old Man Mike
  • Rusty (13brv3)

/!\ ToDo: cleanup, update with new features