Sunday, 4 January 2015

Multicopter. More control and stability (Part 5)

The great achievement of the Wright Brothers was in achieving controlled, stable flight. At that time and up to about 1943 the only way to ensure stability in an aircraft was through the geometry and weight distribution of the airframe. Through wind tunnel testing and lots of trial and error the Wright's managed to come up with an inherently stable airframe. Then, in 1943, in the early stone age of electronics, electronic stability systems for aircraft started to appear.

Electronic stability systems require control theory. And this had got going a little earlier. Automatic control systems were developed for ship steering in the 1930s.  Obviously, with something like a ship there is a time lag between the helmsman turning the wheel and the ship changing direction. Perhaps this makes a good illustration of what control systems are all about.

Imagine, if you will, that you are the helmsman of a large ship. The Captain rings down and tells you to change course to steer 080 degrees. You take a look at the compass and see that the ship is currently heading, due east - 090. You put on some left rudder and wait for the ship to change course. And wait and wait. You put on still more left rudder until finally the ship starts changing direction and the compass now reads 089.

The inertia of the huge ship has meant that it's taken all the turning power of the rudder at maximum deflection to start the ship changing direction. You watch the compass and see the heading slowly change, 088 degrees, 087 and you realise that somehow you need to start thinking about backing off the rudder or you may well overshoot the new, demanded, heading.

The sketch above relates to the problem (ignore the numbers on the vertical scale). The blue square edge being a new demanded heading. The purple curve could be the result of your first attempt at supertanker steering. You overshoot the required heading and have to put on opposite rudder to correct. 3 more overshoots later and we've finally got the ship on the Captain's requested heading. The smooth brown curve could be a good solution. The ship would come smoothly onto its new heading without overshooting. But this would take as long as our first attempt. The green line might be better. We overshoot once but end up on the demanded heading much sooner.

Much the same problem exists in Multicopter control. The machine has inertia and the control setup must be tuned to ensure that the machines responds swiftly to control demands but without overshooting. The KK2 has variables that set the control systems response. These can be accessed and changed via the display and the 4 button keyboard. Differences in weight distribution and the lengths of the arms holding the motors make all multicopters different and they each need their own setups.

With the KK2 the user can access various key parameters within the control system. Changes to the response rate are made by adjusting the P gains of each of the roll and pitch channels. The gain sets the rate at which the system responds to a new demand. In terms of our ship metaphor the P gain could represent the size of the rudder - the bigger the rudder the more quickly the ship starts it's turn. A key adjustment to setting up a well flying copter is getting that P gain correct. Too much gain and we may continue to swing past the demanded error. Too little gain and we'll take ages to achieve the desired direction. 

Small controllers like this have been around for a few years now. One of the first of these was derived from the Wii game controller which has the same type of sensors as the KK2. But the Wii was actually intended for use in a computer game. The angle and motion sensors were designed for simulating games such as tennis. The Wii controller was 'repurposed', reprogrammed by some clever boys who recognised that the built in hardware was also suited to multicopter control. Moreover, the vastly larger commercial game market offered economies of manufacturing scale which meant that the base hardware was available very cheaply.

Having shown what could be done purpose built flight controllers like the KK2 then appeared. The card is manufactured in China and the Honk Kong distributer has brought the price right down. Then, some more clever boys used this hardware as a starting point for more software development. Hence the Steveis, open source firmware that improves on the original factory software -  Steveis firmware for KK2

That such controllers are available for model use is remarkable. Such a control system would have astonished the Wright Brothers. Control theory seems so complex and esoteric. Indeed, the Wiki page on Control Theory opens with a picture of the Space Shuttle. However, the basic principles are now embodied in a circuit card that retails for less than 25 euros. 

No comments:

Post a Comment