• How to reverse motor direction

    You finished your build, you connect LiPo, power up flight controller, apply throttle (no propellers of course) and you see that one or motors are spinning in wrong direction. How to fix that? You can not do it, for example in Cleanflight Configurator. ESC communication protocol does not allow to change BLC motor direction.

    There are 4 ways of dealing with this problem:

    1. Hardware way that works all the time: swap any two motor wires. Does not matter which, just take any two and swap them between motor and ESC: A with B, B with C or A with C. If you have bullet connectors, it's simple. If you soldered wires to ESC pads, you would have to resolder them. How to change motor direction
    2. If you have BLHeli ESC software, BLHeliSuite allows to change motor direction without swapping any wires. Connect to ESC with BLHeliSuite, and change Motor Direction option. blheli motor direction This works only with BLHeli enabled ESC, and only on Windows.
    3. Most of ESC allows to change options like motor direction via transmitter. Exact procedure differs from manufacturer to manufacturer, but usually it looks like below. For exact procedure and possible options refer to ESC user manual!
      1. Connect ESC to radio receiver throttle channel or use flight controller configurator software Live mode. Remember to remove propellers!
      2. Throttle UP
      3. Power ESC, it will start to beep signaling number of cells
      4. Keep throttle up until you hear a sequence that confirms programming mode has been entered
      5. Wait to hear beeping sequence indicating Motor Direction option
      6. Throttle DOWN
      7. Wait until you hear beeping sequence indicating desired rotation direction (normal or reversed)
      8. Throttle UP
      9. Setting will be changed and after next power cycle rotation direction will be changed
    4. Sometimes special programming cards for ESC can be acquired. They somehow automate procedure from point 3 but work on the same principle. For exact programming procedure refer to programming card user manual.

    EMAX esc programming card

    EMAX programming card photo [1]

    Read more...
  • Which sensors drones use to fly?

    Modern drones utilize many different sensors to archive flight. Some of them are required to fly, some are only optional and they can only improve flight performance. This entry will be a summary of those sensors, with short description and information how UAV utilizes data from them.

    Gyroscope

    Gyroscope, or shorter gyro, is the only sensor that drone really needs for stable flight. It feeds flight controller with extremely important information: how fast aircraft is rotating around its own axises: roll, pitch and yaw. Inner loop of PID controller utilizes his information to stabilize the craft.

    When pilot is not applying any deflection to roll, pitch and yaw control sticks (they are in neutral positions), drone should not rotate. It should keep current attitude, do not wobble, do not have rotation drift. If it starts to rotate, this information is taken from gyros and counteraction is applied to stop unintended rotation and event to rotate back to desired attitude.

    Read more...

  • Cleanflight low pass filters part 2

    Quite a lot things changed in the world of low pass filtering since my previous port on this topic was published. So, here is the updated guide to Cleanflight LPF filters:

    gyro_lpf

    gyro_lpf is the most important low pass filter for gyroscope readouts. First of all, it is not part of Cleanflight, but is done by gyroscope itself. Cleanflight only initializes gyro with desired cutoff frequency. Allowed values are:

    • OFF
    • 188HZ
    • 98HZ
    • 42HZ
    • 20HZ
    • 10HZ

    When OFF is selected, gyro offers fastest possible sampling rate (8kHz, new data every 125us) and smaller possible delay. But, it is extremely prone to any vibrations. Any noise from motor or propeller will be visible in gyro output. All other values of this filter allows gyro to provide new data every 1000us (1kHz).

    42Hz is lowest 'flyable' cutoff frequency. It does not makes sense to go lower, since signal delay will be too big and filter will attenuate frequencies that are important from 'flight' point of view. So, 188Hz, 98Hz and 42Hz are the ones that are interesting for us. Exact value depends on propellers, motors, balancing, bearings state, frame rigidness and few other aspects. Let's say, that 250mm or smaller frames can use 188Hz, 450mm and bigger frames should use 98Hz or 42Hz.

    gyro_soft_lpf

    gyro_soft_lpf is a second state of gyro readout filtering before they are introduced to PID controller. One might ask: why two filters? After all, gyro_lpf does the same thing. Yes, it does the same thing. But using 2 LPFs in this case has some advantages. gyro_lpf can not be tuned. It's either: off, 188Hz, 98Hz, 42Hz. But what if, for example, main source of gyro noise is at about 90Hz? Cutoff at 98Hz would be pretty useless. One would have to use 42Hz, loosing a lot of usable frequencies and having to suffer from noticeable (from PID controller point of view) delay. This is why fully configurable second stage of LPF was added.

    gyro_soft_lpf should be kept below gyro_lpf, and below frequency of main noise source. Usually between 50 and 100Hz. Frequencies below 50Hz are too important for stable flight to attenuate them. On the other hand, everything above 100Hz is useless and can be cut off.

    pterm_cut_hz

    This software LPF filter was removed and is no longer available.

    dterm_cut_hz

    Here, let me just quote my previous post:

    (..) D term of PID controller, since it is trying to look into a future, can be a source of huge noise and vibrations. After all, looking into a future is always a tricky business. This is why D term can change with totally different frequency than gyro input and there is a very good reason to limit D term change. Too see how excess D noise can affect gyro traces take a look at my Blackbox tutorial.
    (...) Rule of thumb is: smaller and more rigid frames allows for higher D term cutoff frequency and 42Hz is a good place to start. Bigger frames might require lower cutoff frequency and 10Hz is lower boundary.

    If only frame and noise level allows, D term cutoff frequency should be kept as high as possible. This allows D term to reacts faster to changing flight conditions and can greatly improve UAV behavior in prop wash and rapid maneuvers.

    Read more...
  • How to cut Depron

    Depron is an amazing material. Light, cheap, waterproof, easy to process and quite durable. Almost everything in RC world can be made from Depron. All one needs is imagination, glue and proper knife. Like I mentioned few times before, I'm cheap, so at the beginning of my adventure with Depron, I was choosing cheap modeling knives. Usually no-name. They had one very serious flaw: knife's blade had to be replaced every few cuts. And even so, cut was far from perfect.

    olfa knives SK-9 and SKB-2

    Luckily, I've found a perfect, more expensive but cheaper on a long run, solution: Olfa Knives. Especially Olfa SK-9 Knife with SKB-2 Blades. They are sharp, strong and lasts for a long time. When needed, SKB-2 blade can be used without a knife. SK-9 has one disadvantage: there is no lock, so keeping blade extended all the time requires thumb to be used. And that make it hard to switch knife between hands.

    But the bottom line is: I love Olfa knives. Not only when working with Depron. They are very useful with dealing with cables, unpacking and so on...

    Read more...
  • Beitian BN-880 GPS 3D Printed Case

    Beitian BN-880 (I've bought mine from Banggood) is an excellent, cheap and accurate Ublox NEO-M8N GPS module. I'm using it for last few months and I'm very happy with it. But is has one serious flaw: there are no cases/enclosures for it. So, in most applications it is naked. I've decided to fix that and designed 3D printed Beitian BN-880 case.

    Beitian BN-880 3D printed case

    Beitian BN-880 Case in Cura

    Case can be dowloaded from Thingverse

    Read more...
  • 850m for $20

    Short update on my DIY telemetry link for $20 from my previous post. In theory, it should be able to work up to 500m. Today I archived range of 850m. And I'm pretty sure it's not the end if I was flying higher. At this distance signal was attenuated by 1st Fresnel zone. Next time, more altitude and higher mounted receiver antenna!

    850m for $20

    Read more...
  • DIY wireless telemetry link for UAV

    Telemetry link between UAV (drone, airplane, boat) and laptop/mobile/ground station device can be very useful. Not only to get current drone position, altitude or battery level, but also, when wireless link provides such a possibility, to update drone parameters in-flight. Some radio links, like OpenLRS provides such a possibility out of the box. They include transparent serial bridge and almost any kind of device can use it to communicate with flight controller. Unfortunately, most RC radio systems lacks this functionality and additional telemetry links have to be used. Like 3DR 433Mhz radio link.

    One can buy or one can build something by his own. Some time ago I've chosen the second way and decided to build my own wireless serial link to archive 2 way communication between drone and ground station software. My objectives were:

    • 433MHz since it is legal in my country
    • has to allow to use my phone with EZ-GUI, since I do not like to carry my notebook to an airfield
    • as cheap as possible
      To satisfy those objectives I've decided as follows:

    Read more...

  • Generate PPM signal with Arduino

    In the beginning of this year I've written a short tutorial how to read PWM signals from RC radio with Arduino. While it is can be useful when building own RC equipment, it does not help much when one has to deal with PPM (CPPM) signal. Let's be honest, PPM is much more useful than PWM: all RC channels are sent over single wire. On one side, it simplifies electrical design. On the other, it makes software part more "complicated", since there is a need to encode multiple PWM channels into single PPM line in transmitter, and then decode PPM signal into multiple PWMs in receiver. And there are very little "ready and working out of the box" solutions in Arduino world.

    In this short article I will show how to generate PPM (CPPM) signal using solution prepared few years ago by David Hasko. Originally it was posted of Google Code. But Google Code is not closed and who knows for how long it still will be available. So, let's not let the knowledge got lost.

    Code is relatively simple, and almost all work is done inside ISR(TIMER1_COMPA_vect) that is executed in the background by timer . Everything user has to do, is to put desired values to ppm array inside loop function. This code can generate both positive and negative signal. It can be easily ported to almost any project, as long as TIME1 is free to use.

    Slightly more advanced example is available on GitHub.

    Read more...
  • Video: 6 waypoints automatic mission with INAV

    Below is a video I've recorder 2 weeks ago, showing almost fully automatic mission performed by INAV. The only "non automatic" phase in this flight was take off.

    Besides regular nice views, this video presents a feature that will be available in future INAV 1.2: refactored and greatly improved MAGHOLD controller. MAGHOLD known from previous versions was very simple: rotation rate was dependent on a difference between actual and desired heading without any processing. Not only that, rotation speed was also strictly dependent on MAGHOLD P-gain and yaw rate. While this worked pretty nice for holding desired heading, it did not worked well in WAYPOINT or RTH modes when UAV was forced to rapidly change heading. Turns were usually too fast, could have caused roll/pitch instability and not smooth.

    Because of that, INAV 1.2 will introduce new CLI setting mag_hold_rate_limit that limits the angular speed of rotation that MAGHOLD can require from UAV. At default 90 degrees per second it behaves almost like before. But it can be lowered to, for example, 30 degrees per second, and then, 180 degrees turn will take whole 6 seconds, instead of 2 or less like in older versions of INAV. Additionally LPF filter has been added to prevent any rapid heading jumps in MAGHOLD mode. And it does not affect manual turning. Pilot can still have fast yaw response in manual mode, and slow in WAYPOINT/RTH.

    Effect? Take a look at this video recorder with mag_hold_rate_limit lowered to 25 degrees per second. Nice, smooth and long cinematic turns.

    But that's not all planned for INAV 1.2. There will be more!

    Read more...
  • Hands on: Emax SimonK Series 30A ESC

    You want to know the secret? I'm cheap. I almost never buy expensive stuff. It's not that I can not afford it and buy cheapest stuff available. In my opinion, both ways are wrong. I buy things that position themselves somewhere in the middle. Not the cheapest, not "the best" and most expensive? Why not the cheapest? Because of very low quality. Why not the best? Because I have to pay a lot a little of additional quality or performance I do not really need. And things in a middle usually provide enough for reasonable price. For me it makes sense...

    Thanks to GearBest I've received a set of EMAX SimonK Series 30A ESC for a review. They are not the cheapest 30A ESC for multirotors. You can easily buy some no-name for almost half a price. You can also but "the best" for almost twice as much. But are they worth the price? I will try to find out in the next couple of weeks while using them on my 600mm quadcopter.

    "Unboxing"

    EMAX SimonK Series 30A ESCs are packed in antistatic bags with a user's manual in Chinese and English.

    EMAX ESC SimonK 30A boxed Read more...

Paweł Spychalski

I'm Paweł Spychalski and I do things. Mainly software development, FPV drones and amateur cinematography. Here are my YouTube channels: