PPM output on FrSky X4R and X4R-SB receivers

FrSky sells 2 small Taranis compatible receivers: X4R and X4RSB. By default, they offer only PWM signal. 4 channels on X4R and 3 channels plus S.Bus (16 channels over S.Bus) on X4RSB. And that is problematic. Many flight controllers does not support S.Bus very well (no inverters) or just does not offer enough UART ports. When speaking of small multirotors, PPM signal is often the best choice. That made X4R almost useless. For X4RSB additional S.Bus-PPM conversion cable had to be used.

Luckily, this has changed, since FrSky started offering custom X4R/X4RSB firmware that allows 8 channel PPM signal on receivers port 1. The only thing you have to do is to flash you receiver. And those are the steps to do it:

  1. Download CPPM firmware from this site. Remember that you need proper EU/non-EU version. It all depends if your Taranis and it’s built in XJT module has EU or non-EU firmware. How to determine EU/non-EU Taranis? If you are living outside EU you probably have non-EU firmware. If you are living in EU but bought from non-EU country (China probably) you have non-EU. Also, if in menu you can select D8 or LR12 internal radio mode, you have non-EU firmware. EU firmware allows only D16 mode,
  2. Follow those steps to flash X4R/X4RSB using Taranis built in port,
  3. Put a jumper on signal pins 2 and 3,
  4. Bind receiver with Taranis,
  5. Remove jumper.

From now on, pin 1 outputs PPM channels 1-8, pin 2 outputs PWM CH9, pin 3 outputs PWM CH 10, and pin 4 outputs either PWM CH11 in X4R or S.Bus on X4RSB. If you want to go back to non-PPM mode, bind receiver again, without jumper on pins 2 and 3.

Multiple flight modes for Cleanflight with Taranis

FrSky X9D Plus Taranis or cheaper FrSky Taranis Q X7 or even more expensive X10S Horus, are incredible radios. But also can be intimidation when migrating from simpler radios. A great example is mixing multiple switches into 1 channel to pass flight mode to the flight controller. Yes, you can do it, but it can be a pain in the ass on a Mixer level. I've lost a lot of time trying to understand the logic behind mixer weight and offset only to discover possibility to replace channel value, not add. And everything was simple again. So, here what I wanted, and what I did.

What I wanted

When I fly bigger FPV quadcopter, I want to use 7 different flight modes:

  • Angle without Altitude Hold (no BARO),
  • Horizon without Altitude Hold (no BARO),
  • Acro/Rate without Altitude Hold,
  • Angle with Altitude Hold (BARO),
  • Horizon with Altitude Hold (BARO),
  • Position Hold with Altitude Hold (BARO),
  • Return To Home with Altitude Hold (BARO)
    And I've figured out, that 3 switches should be used to enable all the flight modes: SC, SD, and SG. SC toggles Angle/Horizon/Acro. SD switches PosHold and RTH (as well as BARO and overrides SC and SG). SG enables Altitude Hold but only when SC is in up or middle position. 3 switches, 7 modes. I could do it with 3 radio channels, but that would have few flaws: would use 3 channels instead of one, and would allow for mistakes like no BARO with POSHOLD. So, advanced mixes and logical switches that is. Continue reading “Multiple flight modes for Cleanflight with Taranis” »

What is PID controller?

Multicopter is an unstable machine. It requires constant corrections to keep is stable in the air. This is done with PID control loop. When quadcopter does not fly like you hoped, you will hear: “Tune your PIDs“.  Nice. But what exactly is PID? If you did not studied control theory, and you do not want to start, you read internet. And internet tries to explain PID in various ways. Some are better, some are worse, and there is always room for a new one. So here we go.

Officially, PID goes for Proportional, Integral, Derivative. Wikipedia provides enough of long and boring theory. If it’s TL;DR, here is a short summary:

  • PID controller measures error of current output and desired output,
  • This error is processed separately by P, I and D modules,
  • Then, output of each module is multiplied by it’s coefficient (Kp, Ki, Kd) and added all together as an controllers output,
  • Controller can be tuned by changing Kp, Ki and Kd values,
  • In a multicopter, there is separate controller for each axis (roll, pitch, yaw) working based on rotation speed provided by gyros. This is called and “inner loop”.
  • Some flight modes adds “outer loop” with separate PID controller that is translating user input into values used by “inner loop”. Outer loop is much less important than inner loop and usually there is not need to tune it,
  • Flight modes like Attitude, Angle, Horizon (all with self leveling) are using both outer and inner loop,
  • Flight modes like Rate, Acro and using only inner loop,
  • When speaking on PID tuning, in 99% of cases we will be talking about tuning the “inner loop”,
  • Inner loop tuning should be done only in Rate/Acro flight modes (no self leveling) and avoid complex outer-inner loop interactions.

Continue reading “What is PID controller?” »

Raspberry Pi + MOSFET = High power switch

With all the possibilities, Raspberry Pi requires additional hardware to turn on and off any additional hardware. GPIOs built in power limit is low: 3.3V, 16mA per GPIO, but not more that 50mA total). And while it might be enough to light a small LED, it is not enough for anything else. Forget about motors, strong LEDs, relays. Anything that uses more that 16mA on input will destroy Raspberry Pi.

Luckily, there are things called MOSFET. To keep things short: they are special kind of transistors that can be used to turn on and off devices with high power requirements. Unfortunately, most MOSFETs require more that 3.3V Raspberry Pi GPIO provides. So you either have to use 3.3V logic compatible MOSFETs or add few other elements and use more common 5V compatible MOSFET like 30N06. And 30N06 MOSFET transistor can handle a lot of thing: up to 30A and 60V. So it’s more that enough to handle most 12V motors, relays, lights, LEDs, etc.

30N06 MOSFET Raspberry Pi

 

Required elements:

  • NPN BC547 (or compatible) transistor,
  • PNP BC640 (or compatible) transistor,
  • 30N06 MOSFET transistor,
  • 3x 10kOhm resistors,
  • 4.7kOhm resistors,
  • 1N4001 (or similar) diode

If it was Arduino with 5V logic, transistors would not be required. But with Raspberry Pi’s 3.3V logic they are required to bump voltage from 3.3V GPIO port provides to 5V MOSFET needs. Additionally, if we would be powering any coil device (motor, relay), flyback diode would be required to secure MOSFET from voltage spikes. Even if there is no coil, flyback diode still can be used. Just to be safe.

RedCruiser – DIY Depron airplane for FPV

Few months ago I’ve wrote about my first handmade Depron airplane. It was cool design. Super simple, with KFm-2 airfoil, durable and easy to fly. But it had few serious flaws:

  • motor mounted in front of fuselage is great for flight characteristics, but propellers breaks all the time. Even with prop savers,
  • big fuselage is not the same as fuselage with a lot of space inside.

Depron KFm-2 airplane with pusher propeller

That’s why, I have build a second Depron airplane. This time with pusher propeller mounted on a tower behind wing. Wing is almost the same design as in my first airplane. It is still an KFm-2 (Kline-Folgeman, modified) airfoil, 150mm chord, 12mm thick. But is a little shorter: 1200mm instead of 1250mm. The main difference is inside wing. Instead of carbon fiber spars I’ve used two carbon fiber 6mm pipes. That gives plenty of stiffness. Wing almost does not bend in flight, even during hard maneuvers. And generates more than enough lift to give nice, slow flying experience without danger of heavy stall. You really have to want to stall it. And event when it stalls, it recovers nicely: drops a nose, dives for a second or two, and you have lift again. No need to work with rudder, just let it dive and gain speed and then level.  Continue reading “RedCruiser – DIY Depron airplane for FPV” »

Reptile 500 PID values for Cleanflight

After few test flights I have to admit, that PID values for Reptile 500 quadcopter frame I posted here are too aggressive. Way too aggressive. Specially D coefficient was too big and was main source of high frequency vibrations visible as camera jello. Reducing P and D, and slight increase of I improved quadcopter behavior. Current settings:

  • Raptile 500 frame, EMAX GT2218/09 motors, APC 10×4.5MR propellers,
  • Flip32+,
  • Cleanflight 1.10,
  • PID controller: LuxFloat,
  • Looptime: 2000
  • PIDs:
    • Roll (P / I / D): 1.8 / 0.07 / 30
    • Pitch (P / I / D): 1.8 / 0.07 / 30
    • Yaw (P / I / D): 2.5 / 0.1 / 0

Video has been processed with slight software camera stabilization. Standard settings from iMovie.

PPM signal support for FS-i6 radio

FlySky FS-i6 (or branded Turnigy TGY-i6) is a very decent 6 channel entry level RC radio system. But support for PPM (CPPM) standard is somehow not clear. I have no idea why manufacturer keeps PPM support data so well hidden. Anyway, here it is: how can I enable PPM on i6 radio system?

FlySky FS-i6 (Turnigy TGY-i6) 6 channel 2.4GHz radio system with FPV mount

PPM signal is supported only on FS-iA6B (v2) receiver, FlySky FS-A8S Mini receiver and a couple of compatible ones: FlySky Pro Micro, FS82 Micro Receiver and iRangeX Tiny 2.4G 6CH Flysky Receiver

FS-iA6B v2 receiver with PPM and i-Bus

No PPM on FS-iA6 receiver

It is not possible to enable PPM signal on FS-iA6 receiver. So if you have simpler one, you would have to buy iA6B. Also, PPM signal is not enabled by default. To turn it on, you have to change radio settings:

  1. Open Menu and select “System setup” FS-i6 system setup
  2. Enter “RX Setup”FS-i6 RX setup
  3. Navigate to “PPM output”FS-i6 PPM Output
  4. And change it to “On”FS-i6 receiver PPM Output

This is all. From now on, FS-iA6B will output PPM 6 channel signal on port 1 labeled “PPM/CH1”.

You can get FS-iA6B from here.

PWM, PPM, and Serial RX explained

When speaking about radio systems for remote controlled models, multirotor, airplanes, gliders, there are some shortcuts that might be unknown for beginners. Those are: PWM, PPM, Serial RX, S.Bus. Today I will explain basic concepts behind them, and when they are used.

PWM

PWM, as Pulse Width Modulation, is something a standard for controlling different devices onboard remote controlled model. Almost all servos, ESC, flight controllers and radio receivers can work with PWM signal. There might be some exceptions, but they are so rare, that we can skip them.

Stick (switch, POT) position in PWM signal is encoded as length of signal. Signal that lasts 1000us encodes minimum stick position, and signal of 2000us encodes maximum stick position.

3 PWM channels connected to FlySky FS-iA6BIn PWM, each channel is available as separate port of 3 pins (Ground, +5V, Signal). So, if receiver has 8 channels in PWM mode, that means that it has at least 8 ports of 3 pins. 24 pins, 24 cables, lots of mess. And this was great for airplanes, where each control surface is controlled by separate servo connected directly to the receiver. But is not so great for quadcopters and event airplanes with flight controller. Not only it requires a lot of cables, but also complicates things on flight controller’s end. It requires an interrupt for each channel, takes a lot of space and to be honest, it’s completely not needed. Why? Because we have something better…
Continue reading “PWM, PPM, and Serial RX explained” »

Quick Review: FPV 1/4 CMOS HD Color Camera Module 600TVL 120 Degree Wide Angle

Usually I have absolutely nothing against buying cheap stuff from China. OK, maybe quality will not always be as expected, but usually it’s not worth paying extra 100% in price for 10% of extra quality. Usually, with some exceptions. Exception number one are mechanical parts like motors. Exception number two are FPV cameras. And the second one is new one. I’ve put it in place after using FPV 1/4 CMOS HD Color Camera Module 600TVL 120 Degree Wide Angle from Banggood for one month.

FPV 1/4 CMOS HD Color Camera Module 600TVL 120 Degree Wide Angle from Banggood Continue reading “Quick Review: FPV 1/4 CMOS HD Color Camera Module 600TVL 120 Degree Wide Angle” »