Jakub Steiner Designer. Camera Pilot. http://jimmac.musichall.cz/blog 2015-08-04T14:21:00+02:00 Jakub Steiner FPV Addicts http://jimmac.musichall.cz/blog/2015-08-04-fpv-addicts/ 2015-08-04T14:21:00+02:00 2015-08-04T14:28:24+02:00 Article Author <p>I&rsquo;ve started doing longer edits of the 15&nbsp;second clips I usually put on Instagram. I&rsquo;ve been really creative with the naming so far.</p> <p> <iframe width="100%" height="500" src="https://www.youtube.com/embed/O98xIhGNZ-E" frameborder="0" allowfullscreen> <a href="https://www.youtube.com/watch?v=O98xIhGNZ-E">FPV Addicts</a></iframe> </p> <p> <iframe width="100%" height="500" src="https://www.youtube.com/embed/epWgi7uUxE4" frameborder="0" allowfullscreen> <a href="https://www.youtube.com/watch?v=epWgi7uUxE4">FPV Addict</a></iframe> </p> The chore of tuning PIDs http://jimmac.musichall.cz/blog/2015-04-14-the-chore-of-tuning-pids/ 2015-04-14T13:47:00+02:00 2015-05-05T15:13:31+02:00 Article Author <p>Tuning PIDs is one of those things you really don&rsquo;t want to do, but can&rsquo;t avoid it in the acrobatic quad space. Flying camera operators don&rsquo;t usually have to deal with this, but the power/weight ratio is so varied in the world of acro flying you&rsquo;ll have hard time avoiding it there. Having a multirotor &ldquo;locked in&rdquo; for doing fast spins is a must. Milliseconds count.</p> <p> <iframe width="100%" height="500" src="https://www.youtube.com/embed/XX9hzDJB3Pg" frameborder="0" allowfullscreen> <a href="https://www.youtube.com/watch?v=XX9hzDJB3Pg">FPV Weekend</a></iframe> </p> <p>So what is PID tuning? The flight controller&rsquo;s job is to maintain a certain position of the craft. It has sensors to tell it how the craft is angled and how it&rsquo;s accellerating, and there&rsquo;s external forces acting on the quad. Gravity, wind. Then there&rsquo;s a human giving it RC orders to change its state. All this happens in a PID loop. The FC either wants to maintain its position or is given an updated position. That&rsquo;s the <em>target</em>. All the sensors give it the actual <em>current state</em>. Magic happens here, as the controller gives orders to individual ESCs to spin the motors so we get to there. Then we look at what the sensors say again. Rinse and repeat.</p> <p>PID loop is actually a common process you can find in all sorts of computer controllers. Even something as simple as a thermostat does this. You have a temperature sensor and you drive a heater or an air conditioner to reach and maintain a target state.</p> <p>The trick to a solid control is to apply just the right amount of action to get to our target state. If there is difference between where we <em>are</em> and where we <em>want to be</em>, we need to apply some force. If this difference is smaller, only a small force is required. If it&rsquo;s big, a powerful force is needed. This is essentially what the P means, <em>proprotional</em>. In most cases, as a controller, you are truly unhappy if you are elsewhere to where you were told to be. You want to correct this difference fast, so you provide a high proportional value/force. However, in the case of a miniquad, the momentum will continue pulling you when you reached your target point and don&rsquo;t apply any force anymore. At this point the difference occurs again and the controller will start correcting the craft pulling it back in the opposite direction. This results in an unstable state as the controller will be bouncing the quad back and forth, never reaching the target state of &ldquo;not having to do anything&rdquo;. The P is too big. So what you need is a value that&rsquo;s high enough to correct the difference fast, but not as much so the momentum gets you oscillating around the target.</p> <p>So if we found our P value, why do we need to bother with anything else? Well sadly pushing air around with props is a complicated way to remain stationary. The difference between where you are and where you want to be isn&rsquo;t just determined by the aircraft itself. There are external forces that are in play and those change. We can get a gust of wind. So what we do is we correct that P value based on the changed conditions. Suddenly we don&rsquo;t have a fixed P contoller, we have one that has variable P. Let&rsquo;s move on how P is dynamically corrected.</p> <p>The <em>integral</em> part of the controller corrects the difference that suddenly appears due to the new external forces coming into play. I would probably do a better job explaining this if I enjoyed maths, but don&rsquo;t hate me, I&rsquo;m a graphics designer. Magic maths corrects this offset. Having just the proprotional and integral part of the corrective measure is enough to form a capable controller perfectly able to provide a stable system.</p> <p>However for something as dynamic as an acrobatic flight controller, you want to improve on the final stage of the correction where you are close to reaching your target after a fast dramatic correction. Typically what a PI controller would get you is a bit of a wobble at the end. To correct it, we have the <em>derivative</em> part of the correction. It&rsquo;s a sort of a predictive measure to lower the P as you&rsquo;re getting close to the target state. D gives you the nice smooth &ldquo;locked in&rdquo; feeling, despite having high P and I values, giving you really fast corrective ability.</p> <p>There are three major control motions of a quad that the FC needs to worry about. Pitch for forward motion is controlled by spinning the back motors faster than the front two motors thus angling the quad forward. Roll motion is achieved exactly the same way, but with the two motors on one side spinning faster than the other two. The last motion is spinning in the Z axis, the yaw. That is achieved by torgue and the fact than the propellers and motors spin in different directions. Typically the front left and back right motor are clockwise spinning and the front right and back left motor are spinning counter clockwise. Thus spinning up/accellerating the front left and back right motors will turn the whole craft counter clockwise (counter motion).</p> <p>I prepared a little cheat sheet on how to go about tuning PIDs on the NAZE32 board. Before you start though, make sure you set the PID looptime as low as your ESC allow. Usually ESC send the pulses <em>400 times a second</em> which is equivalent to a looptime of 2500. The more expensive ESC can do 600Hz and some, such as the miniscule KISS ESCs, can go as low as 1200.</p> <table><thead> <tr> <th style="text-align: center">ESC refresh rate</th> <th style="text-align: center">NAZE32 Looptime</th> </tr> </thead><tbody> <tr> <td style="text-align: center">286Hz</td> <td style="text-align: center"><strong>3500</strong></td> </tr> <tr> <td style="text-align: center">333Hz</td> <td style="text-align: center">3000</td> </tr> <tr> <td style="text-align: center">400Hz</td> <td style="text-align: center">2500</td> </tr> <tr> <td style="text-align: center">500Hz</td> <td style="text-align: center">2000</td> </tr> <tr> <td style="text-align: center">600Hz</td> <td style="text-align: center">1600</td> </tr> </tbody></table> <p>You do this in the CLI tab of baseflight:</p> <pre><code>set looptime=2500 save </code></pre> <p>Hope this has been helpful for some as it was for me :).</p> <p class="image full"> <a href="/blog/2015-04-14-the-chore-of-tuning-pids/index/pids.pdf"><img type="image/svg+xml" alt="" src="/blog/2015-04-14-the-chore-of-tuning-pids/index/pids.svg"></a> <small>Quick Guide on PID tuning</small> </p> <ul> <li><a href="https://www.youtube.com/watch?v=UR0hOmjaHp0">PID controller explained</a></li> <li><a href="https://www.youtube.com/watch?v=30Au6sEv6-o">practical PID tuning with Cleanflight</a></li> </ul> Minis and FPV http://jimmac.musichall.cz/blog/2015-04-02-minis-and-fpv/ 2015-04-02T10:09:00+02:00 2015-05-05T15:13:31+02:00 Article Author <p> <iframe width="100%" height="500" src="https://www.youtube.com/embed/NtBpe_uziIY" frameborder="0" allowfullscreen> <a href="https://www.youtube.com/watch?v=NtBpe_uziIY">FPV</a></iframe> </p> <p>I&rsquo;ve got some time into the hobby to actually share some experiences that could perhaps help someone who is just starting.</p> <p class="row"> <a class="4u image" href="https://instagram.com/jimmacfx/p/0JkTvEEKHb/"><img alt="" src="https://igcdn-photos-c-a.akamaihd.net/hphotos-ak-xfa1/t51.2885-15/10948628_1420824761546554_1382951056_n.jpg"></a> <a class="4u image" href="https://instagram.com/jimmacfx/p/0FrP-ZEKC3/"><img alt="" src="https://igcdn-photos-a-a.akamaihd.net/hphotos-ak-xfa1/t51.2885-15/914465_838169696255032_386569031_n.jpg"></a> <a class="4u image" href="https://instagram.com/jimmacfx/p/0IgjtUEKFu/"><img alt="" src="https://igcdn-photos-c-a.akamaihd.net/hphotos-ak-xaf1/t51.2885-15/10787760_1558521487734426_825073115_n.jpg"></a> </p> <h1>Cheap parts</h1> <p>I like cheap parts just like the next guy, but in the case of electronics, avoid it. Frame is one thing. Get the ZMR250. Yes it won&rsquo;t be near as tough as the original <a href="http://www.minihquad.com">Blackout</a>, but it will do the job just fine for a few crashes. Rebuilding aside, you can get about 4 for the price of the original. Then the plates give. But electronics is a whole new category. If you buy cheap ESCs they will work fine. Until they smoke mid flight. They will claim to deal with 4S voltage fine. Until you actually attach a 4S and blue smoke makes its appearance. Or you get a random motor/ESC sync issue. And for FPV, when a component dies mid flight, it&rsquo;s the end of the story if it&rsquo;s the drive (motor/esc) or the VTX or a board cam. </p> <p>No need to go straight to T-motor, which usually means paying twice as much of a comparable competitor. But avoid the really cheap sub $10 motors like RCX, RCTimer (although they make some decent bigger motors), generic chinese ebay stuff. In case of motors, paying $20 for a motor means it&rsquo;s going to be balanced and the pain of vibration aleviated. Vibrations for minis don&rsquo;t just ruin the footage due to rolling shutter. They actually mess up the IMU in the FC considerably. I like Sunnysky x2204s 2300kv for a 3S setup and the Cobra 2204 1960kv for a 4S. Also rather cheap DYS 1806 seem really well balanced. </p> <!-- # Fear of the PIDs When your quad or hex doesn't behave the way it should, it may be an actual hardware problem, but many times it's simply a power/weight ratio that is outside of the default PIDs of your flight controller. You quad may feel jittery, getting high frequency vibrations that get exagerrated as you push the throttle up. On the other side of the spectrum, it can feel uncontrollable, totally disregarding your RC input or roll onto one side when you throttle up. It can oversteer when you roll, pitch or yaw, meaning it will continue with motion even if you have stopped turning. The bad news is that there's maths involved and I've never grown to like maths. But here's a workflow I've applied to get a locked in, vibration free --> <h1>Embrace the rate</h1> <p>Rate mode is giving up the auto-leveling of the flight controller and doing it yourself. I can&rsquo;t imagine flying line of sight (LOS) on rate, but for first person view (FPV) there is no other way. NAZE32 has a cool mode called HORI that allows you to do flips and rolls really easily as it will rebalance it for you, but flying HORI will never get you the floaty smoothness that makes you feel like a bird. The footage will always have this jerky quality to it. On rate a tiny little 220 quad will feel like a 2 meter glider, but will fit inbetween those trees. I was flying hori when doing park proximity, but it was a time wasted. Go rate straight from the ground, you will have way more fun.</p> <h1>Receiver woes</h1> <p>For the flying camera kites, it&rsquo;s usually fine to keep stuff dangling. Not for minis. Anything that could, will get chopped off by the mighty blades. These things are spinning so fast than antennas have no chance and if your VTX gets loose, it will get seriously messed up as well. You would not believe what a piece of plastic can do when it&rsquo;s spinning 26 <em>thousand</em> times a minute. On the other hand you can&rsquo;t bury your receiver antenna on the frame. Carbon fibre is super strong, but also super RF insulating. So you have to bring it outside as much as possible. Those two don&rsquo;t quite go together, but the best practice I found was taping one of the antennas to the bottom of the craft and have the other stick out sideways on top. The cheapest and best way I found was using a zip tie to hold the angle and heatshrink the antenna onto it. Looks decent and holds way better than a straw os somesuch.</p> <p>Next time we&rsquo;ll dive into PID tuning, the most annoying part of the hobby (apart from looking for a crashed bird ;).</p> <ul> <li>Flite test <a href="https://www.youtube.com/watch?v=8A3pGJi_ih8">episode with Charpu</a> giving some useful tips.</li> </ul> High Contrast Refresh http://jimmac.musichall.cz/blog/2015-03-24-high-contrast-refresh/ 2015-03-24T10:14:00+01:00 2015-04-02T18:04:49+02:00 Article Author <p class="image full"> <img type="image/svg+xml" alt="" src="/blog/2015-03-24-high-contrast-refresh/index/hc-shell.png"> </p> <p>One of the major visual updates of the 3.16 release is the high contrast accessible theme. Both the shell and the toolkit have received attention in the HC department. One noteworthy aspect of the theme is the icons. To guarantee some decent amount of contrast of an icon against any background, back in <a href="/old/high-contrast/index.xhtml">GNOME 2 days</a>, we solved it by &ldquo;double stroking&rdquo; every shape. The term double stroke comes from a special case, when a shape that was open, having only an outline, would get an additional inverted color outline. Most of the time it was a white outline of a black silhouette though.</p> <p class="image full"> <img type="image/svg+xml" alt="" src="/blog/2015-03-24-high-contrast-refresh/index/old-style.png"> <small>Fuzzy doublestroke PNGs of the old HC theme</small> </p> <p>In the new world, we actually treat icons the same way we treat text. We can adjust the best contrast by controlling the color at runtime. We do this the same way we&rsquo;ve done it for symbolic icons, using and embedded CSS stylesheet inside SVG icons. And in fact we are using the very same symbolic icons for the HC variant. You would be right arguing that there are specific needs for high contrast, but in reality majority of the double stroked icons in HC have already been <a href="https://git.gnome.org/browse/gnome-themes-standard/tree/themes/HighContrast/create-highcontrast.c?h=gnome-3-14">direct conversions of their symbolic counterparts</a>.</p> <p class="image full"> <img type="image/svg+xml" alt="" src="/blog/2015-03-24-high-contrast-refresh/index/new-hc.svg"> <small>Crisp recolorable SVGs of the post 3.16 world</small> </p> <p>While centralized theme that overrides all application never seemed like a good idea, as the application icon is part of its identity and should be distributed and maintained alongside the actual app, the process to create a high contrast variant of an icon was extremely cumbersome and required quite a bit of effort. With the changes in place for both the toolkit and the shell, it&rsquo;s far more reasonable to mandate applications to include a symbolic/high contrast variant of its app icon now. I&rsquo;ll be spending my time transforming the existing double stroke assets into symbolic, but if you are an application author, please look into providing a scalable stencil variant of your app icon as well. Thank you!</p> <ul> <li><a href="https://developer.gnome.org/hig/stable/icons-and-artwork.html.en">GNOME icon design guidelines</a></li> <li><a href="https://wiki.gnome.org/Initiatives/GnomeGoals/HighContrastAppIcons">High Contrast App Icon Initiative</a></li> </ul> Audi Quattro http://jimmac.musichall.cz/blog/2015-03-12-audi-quattro/ 2015-03-12T13:52:00+01:00 2015-04-02T18:04:29+02:00 Article Author <p>Winter is definitelly losing its battle and last weekend we had some fun filming with my new folding Xu Gong v2 quad. </p> <iframe src="https://player.vimeo.com/video/121668165" class="image full" width="500" height="500" frameborder="0"> <a href="https://vimeo.com/121668165">Audi Quattro</a> from <a href="http://vimeo.com/jimmacfx">jimmac</a> on <a href="https://vimeo.com">Vimeo</a>. </iframe> Making of GNOME 3.14 http://jimmac.musichall.cz/blog/2014-09-17-making-of-gnome-3-14/ 2014-09-17T15:37:00+02:00 2015-04-02T18:04:29+02:00 Article Author <p>The release of GNOME 3.14 is slowly approaching, so I stole some time from actual design work and created this little promo to show what goes into a release that probably isn&rsquo;t immediately obvious (and a large portion of it doesn&rsquo;t even make it in).</p> <p> <iframe class="image full" src="//www.youtube.com/embed/Co4i_d47e1I" height="500" frameborder="0"> <a href="http://www.youtube.com/watch?v=Co4i_d47e1I">Watch on Youtube</a> </iframe> </p> <p>I&rsquo;d like to thank all the usual suspects that make the wheels spinning, <a href="http://blogs.gnome.org/mclasen/">Matthias</a>, <a href="http://blogs.gnome.org/otte/">Benjamin</a> and <a href="http://blogs.gnome.org/aday/">Allan</a> in particular. The crown goes to Lapo Calamandrei though, because the amount of work he&rsquo;s done on Adwaita this cycle will really benefit us in the next couple of releases. Thanks everyone, 3.14 will be a great release*!</p> <p><footnote>* I keep saying that every release, but you simply feel it when you&rsquo;re forced to log in to your &ldquo;old&rdquo; GNOME session rather than jhbuild.</footnote></p>