When you want to fix a problem that does not need fixing you get yourself into trouble. Like me, trying to tune perfectly fine elevator. Few seconds after take off plane dives and crashes into the ground. Wing and all the gear survived. Fuselage broke in half. Time to manufacture a new one.
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:
- 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,
- Follow those steps to flash X4R/X4RSB using Taranis built in port,
- Put a jumper on signal pins 2 and 3,
- Bind receiver with Taranis,
- 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.
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” »
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.
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.
- 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.
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.
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” »
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,
- Cleanflight 1.10,
- PID controller: LuxFloat,
- Looptime: 2000
- 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.
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?
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:
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.
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, 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.
In 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” »
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.