Thread Tools
This thread is privately moderated by midelic, who may elect to delete unwanted replies.
Sep 30, 2019, 09:18 AM
Registered User
midelic's Avatar
Thread OP
Mini-HowTo

DIY FrSky X(D16) receiver


Hi guys,

After almost 2years of RC "sabbatical" leave I was able to finalize my DIY FrskyX receiver.
I had problems with finding a suitable RF module.I was not able to find until now.So here we start.

Today we start a new project(as title already mentioned) a DIY compatible FrSky "X" receiver (also known as D16).

To keep story short see below some characteristics.

Characteristics:

*Hardware*
- MCU STM32F103CBT6 .
- CC2500 transceiver module dual Antenna(diversity) with PA/LNA chip.

1.16 channels receiver compatible with FrskyX(D16) protocol working with Taranis all versions,Turnigy 9x pro(ersky9x) with XJT module or multi module,Devo TX(deviation firmware).
2.8 channels servo PWM(with channels selection output for 1-8 or 9-16 channels .See "Note") output.
3. SBUS 16 channels output (not inverted).
4.Full telemetry with SMARTPORT protocol telemetry(only for X protocol).
5.Antenna diversity with LED's on each antenna control line.This way is easy to debug if you have faulty antennas.
6.Analog ports 4 channels A1,A2,A3,A4.(Max 3.3V on each analog channel)
7.Programable failsafe from RX or TX(screen).
8.Power supply(5-8V)2S lipo max.
9.Range > 1Km(tested 1.5Km).


Thanks to Joao that helped me with testing this receiver he managed to get easily 1.5km range test on the ground level.
So it has plenty "punch".

Note:
This receiver features protocol/modes selection:

1) Jumper CH1-CH3 at start change receiver mode to X(D16)protocol channels 1-8 output PWM.
2) Jumper CH2-CH4 at start change receiver mode to X(D16)protocol channels 1-8 output PWM with no telemetry.
3) Jumper CH3-CH5 at start change receiver mode to X(D16)protocol channels 9-16 output PWM.
4)Jumper CH4-CH6 at start change receiver mode to X(D16)protocol channels 9-16 output PWM with no telemetry.
5)Jumper CH6-CH8 at start change receiver mode to D(D8)protocol (with Hub telemetry).
6)Jumper CH5-CH7 at start change receiver mode to LBT protocol.
.
It is a toggle jumper toggle between LBT and D16.
If the RX is in D16 will switch to LBT and vice versa.If you are in D8 mode using 5-7 jumper will not change on LBT until you change first on D16.

After flashing first time or after global erase the default mode/protocol is "X"(D16) with channels 1-8 servo PWM output.
These modes are somehow different from Frsky modes, I like to think better as allow receivers to be used independently(not binding all the time mode/protocol is changed as it is now with originals).

Construction DIY:
PCB is made very cheap at jlcpcb
https://jlcpcb.com/quote#/
I payed 3.35 euro shipping included (for 5 boards).Joao payed 1.8 eur (shipping included) at first order at Jlcpcb.

It will be 3 versions of schematic,for people to choose from.All will share the same code.
************************************************** **********************
Version 1.1 no separate eeprom chip(it will use mcu chip flash as emulated eeprom) with reverse polarity protection(with P channel MOSFET) and have SMD pads (span 2.54mm pinout) for serial pins.
Version 1.2 with separate eeprom chip (serial eeprom 24C02/04)and reverse polarity protection(with P channel MOSFET)with soldering SMD pads(span 2.54mm ) for flashing and serial ports.
Version 1.3 with separate eeprom chip(serial eeprom 24C02/04) and reverse polarity protection(shottky diodes) and a separate connector(molex1.5mm) for serial ports.
Version 1.4 with separate eeprom chip(serial eeprom 24C02/04) and reverse polarity protection with no Servo PWM breakouts (only SBUS/SPORT/VCC pins) -smaller board.
************************************************** *********************

I added an eeprom 1 wire serial(I2C) chip on 2 versions.
STM32 F103 has no eeprom memory ,coders use a hack on the last pages of flash to emulate eeprom.The original Frsky RX have this eeprom chip for storing bind data.So I added it as an option.Anyway if you added the serial chip or not the RX will still be working so it is up to you.It is optional.
Note:.
Moreover while the flash can be used as eeprom the number of writing cycles is limited, according with manufacturer is 10000 compared with a dedicated eeprom chip that has 1000000.
You will not reach 10000 flashing/re-flashing of the mcu,in your life time but some people may come worried.
If your design is on small board you may leave it out.

If you have some customization let me know and post here .I would love to see how other people customized this project

As long as they follow the same pinout and connection to the RF module, with the basic schematics provided anybody can customize and make their own design with more or less components follow what is best for them.

****************************************
-See below the BOM file
-See also electronic schematics attached.
-see gerber files below
I designed the pcb in EasyEDaA,the online pcb designer.
For people that want to design their own boards.I think they will find the libraries all there.
-below you can see also the prototype.

Shopping:
STM32F103CBT6 (or STM32F103C8T6) - LQFP48 chip -Any will do just fine as long as make sure they are STM original and not clones,
- any electronic parts supplier digikey, mouser, farnell, ebay,aliexpress wherever you can find this chip cheaper.I used 0603 size for passive components.
try use google search.


CC2500 module:
we found one CC2500 dual antenna(diversity)on aliexpress
https://www.aliexpress.com/item/3294...36dc8beeaf2a26


- passive components(resistors,caps, pin headers.I used 0603 size.
- diodes,regulator.
again any supplier digikey,mouser farnell, ebay, aliexpress, google is your friend.


Important note:

Please leave the RF module at the end for soldering.Solder the mcu first ,regulator(power supply) and all the associated parts.
Before soldering the last part which is the RF module ,test the mcu see if it is functional .
For that upload a blink program to it see if the LED on the board is blinking,
I will post below the blink program adapted for this board.To use remove the .txt extension.



Flashing firmware:
1.For flashing you need an USB serial(can be FTDI) device connected to corresponding
TX, RX and GND pins(FTDI-)Tx pin to Rx pin and FTDI-Rx to Rx -Tx pin,FTDI-GND to Rx-GND.
2.Jumper(bridge) BOOT0 pins and power on Rx.
3.Flash Rx using STM Flash loader demonstrator program.See below info.

STM32 Flash loader demonstrator utility you can download here
http://www.st.com/en/development-too...her-stm32.html
Tutorial use STM loader
https://scienceprog.com/flashing-pro...ed-bootloader/


**WARNING!**
**MUST READ!**

Please be aware that the Rx firmware binary attached below has somewhat limited functionality..
The receiver is set to bind with TX only 2 times.The third time you try to bind(that means bind mode TX and RX in bind mode with bind button)
with different TX or same TX, the RX will be locked and you will be unable to connect to TX.
However you will be able to unlock and make it work again by re-flashing firmware again using "Global Erase" selection in STM loader program before flashing.


Summary:
As long as you don't rebind 2 times you can use this RX indefinitely. To remove the bind lock and regaining functionality you have to re-flash the RX.
If you locked RX you can still re-flash and use it again until you rebind.
I know this can be very annoying thing for some users and others will not be bothered too much as they can bind with one TX, install it on their plane or quad and forget about it.
I adopted this new approach to limit the possibility of this project being copied and used commercially without my approval.
I hope people will understand.

**END**

Enjoy!

Thanks to:
- Joao for testing this receiver in various conditions.
- David for testing sport telemetry.

DISCLAIMER:
THIS IS A DIY PROJECT AND THE CODE AND SETUP PRESENTED HERE IS AS IS.
USE IT ON YOUR OWN RISK.I DON'T TAKE ANY RESPONSIBILITY OF THE PROBLEMS WHICH MAY ARISE USING IT.

Testing:
see below the video Joao testing the prototype at 1.4-1.5Km.
DIY FrskyX RX Range Test 2 (2 min 24 sec)
Last edited by midelic; Mar 09, 2020 at 08:06 AM. Reason: addded important notes regarding soldering and blink program for test the mcu
Sign up now
to remove ads between posts
Sep 30, 2019, 09:19 AM
Registered User
midelic's Avatar
Thread OP
I will post here the binaries.The first post holds already too much info.
To use the firmware remove the .txt extension.
reminder for the modes.
This receiver features protocol/modes selection:

1) Jumper CH1-CH3 at start change receiver mode to X(D16)protocol channels 1-8 output PWM.
2) Jumper CH2-CH4 at start change receiver mode to X(D16)protocol channels 1-8 output PWM with no telemetry.
3) Jumper CH3-CH5 at start change receiver mode to X(D16)protocol channels 9-16 output PWM.
4)Jumper CH4-CH6 at start change receiver mode to X(D16)protocol channels 9-16 output PWM with no telemetry.
5)Jumper CH6-CH8 at start change receiver mode to D(D8)protocol (with Hub telemetry).
6)Jumper CH5-CH7 at start change receiver mode to LBT protocol.

It is a toggle jumper toggle between LBT and D16.
If the RX is in D16 will switch to LBT and vice versa.If you are in D8 mode using 5-7 jumper will not change on LBT until you change first on D16.


Note:
-For 041219 firmware please disable FS(failsafe from TX (custom, HOLD and NO pulse) )before using the rx.
Also jumper 5-7 has some problem.In order to toggle LBT use first jumper5-7 and after jumper 1-3(go to D16) .
Another bug reported was there is no FS for SBUS in this version.
I will fix this problems in the new revisions.
15.01.2020
Edit:
Removed this update have bugs on FS.
17.01.2020
Fixed SBUS FS. Fixed problem with selection jumper 5-7.Fixed FS from TX.Added blinking pattern when setting LBT and D8.
With this update you can flash also without using BOOT0.You can use a jumper Ch8 - GND to enter in bootloader.I added this feature in order to be able to flash the rx while buried inside the plane.
01.02.2020
New version .Added dual bind feature.
It allows to use 2 TX and switch between them, back and forth,After you bind both normally the switch is done at bind time. Put the TX you want to switch to in bind mode and after that power the rx in normal mode.The rx led will blink faster to let you know switch is completed.After that you can use the rx normally with new Tx.
23.02.2020
Version that works with LUA script to control RX modes.At the moment Sbus invert and servo rate 9ms are not available.
See video link below for more info about what it controls.The second page show some statistics on rx to asses the performance of the link.
Bugs reported :
-cannot change channel modes(1-8 to 9-16) with LUA script.
- frame lost bit in SBUS frame is not activated.
27.02.2020
-Added 9ms servo rate (from LUA script).
-Fixed selection of channel modes(1-8 to 9-16) with LUA script.
-added frame lost bit in SBUS frame.
Not tested.

07.03.2020
- Moved programming jumper to ch1-ch8.Using a servo on ch8 at start, forced R8 to enter in programming mode(most probably the servo pulled ch8 pin low)
- Fixed bug errors in telemetry data at start(only with T16-multiprotocol)
- Added virtual sensor 52F1 id for firmware version.You can see version on TX with new LUA script too.
- Fixed - Issues with dual bind mode FS for second TX(not store FS from RX on second TX).
- Added RSSI averaging.

21.03.2020

-added SBUS signal inversion feature.To be changed with LUA script.The default is SBUS normal signal.
-fixed a small telemetry sync problem.
-fixed another telemetry problem (when the tx is off and on again it will loose sport telemetry with previous firmware).
-added 52E0, LQ virtual sensor(same as Tadango 5100 -LQ sensor).Sent every 300ms.
-added 52E1 antenna-swaps sensor sent every 1 sec


Important note:
When using with LUA script.
In order to change the data and the receiver to store the changed data ,you must switch off first Tx and after that the Rx,
The new data is stored when the Rx lost the link with Tx.

Configuration of a DIY FrSky compatible RX (2 min 27 sec)



Note:
The information and firmware updates are subject to change without warning.
Before using an update make sure you check this post first if new information or new firmware updates are already posted.
Enjoy!
Last edited by midelic; Apr 27, 2020 at 04:35 PM. Reason: update
Sep 30, 2019, 09:45 PM
Registered User
Quote:
Originally Posted by midelic
I know this can be very annoying thing for some users and others will not be bothered too much as they can bind with one TX, install it on their plane or quad and forget about it.
I adopted this new approach to limit the possibility of this project being copied and used commercially without my approval.
I hope people will understand.
I don't think re-flashing the receiver (if needed) is annoying. But it would certainly deter the copy-cats from selling these.
Oct 01, 2019, 01:21 AM
Registered User
midelic's Avatar
Thread OP
Yes I was told before that nothing can be done and if you release the binaries it will be easier for them.Well, I want to introduce in premiere this type of restriction that for a DIY-er will not cause so much problems.This way will limit copying and selling.
Oct 01, 2019, 02:12 AM
Flying a Chipmunk in Portugal
jhsa's Avatar
Yep, many people that buy won't be able to flash a receiver anyway.
And if they are stupid enough to produce a two bind receiver we won't give any support here. Any product support post should be deleted.
I am not being mean, but I do know how much work is put into developing such a project. Every day, sometimes all day, for months. In this case, Midelic is on this project for 2 years, and I have been following it since the beginning.
I do understand why he doesn't want this thing produced, specially when he wants to promote DIY, which is something that unfortunately we don't see much in RC anymore
I can only say THANK YOU.

Joćo
Oct 01, 2019, 04:11 AM
Don“t grow up, it“s a trap
aMax's Avatar
Quote:
Originally Posted by jhsa
.....cut
.....DIY, which is something that unfortunately we don't see much in RC anymore


Joćo
Well , nowadays young people mostly dont have the patience for those projects and some people, beyond the age of Bruce Simson, have to deal
with rising restrictions.

But back to topic.
Nice to see that already one line for an I2C port is broken out. Is there any consideration for the use of such port in the software, e.g for a baro ,...like
FRSKY“ did on the G-RX8?
Oct 01, 2019, 04:23 AM
Don“t grow up, it“s a trap
aMax's Avatar
Woooh thats great!

https://static.rcgroups.net/forums/a...ersion_1.3.png
Oct 01, 2019, 04:24 AM
Flying a Chipmunk in Portugal
jhsa's Avatar
Is that not done using S.Port?

Joćo

Sent from my BLN-L21 using Tapatalk
Oct 01, 2019, 04:28 AM
Registered User
midelic's Avatar
Thread OP
I see G-RX8 has integrated baro sensor.But even now in this setup you can connect a OXS baro sensor(DIY) to SPORT port.In fact I think we tested already altitude with small DIY OXS sensors connected on SPORT.I have one DIY small at home.If you want I can provide schematics.
Oct 01, 2019, 04:30 AM
Registered User
midelic's Avatar
Thread OP
It will be 3 versions of schematic,for people to choose from.All will share the same code.
*********************************
Version 1.1 no separate eeprom chip(it will use mcu chip flash as emulated eeprom) with polarity protection(with P channel MOSFET) and have pads (2.54mm pinout) for serial pins.
Version 1.2 with separate eeprom chip (serial eeprom 24C02/04)and reverse polarity protection(with P channel MOSFET)with soldering pads(2.54mm pinout) for flashing
Version 1.3 with separate eeprom chip(serial eeprom 24C02/04) and reverse polarity protection(shottky diodes) and a separate connector(molex1.5mm) for serial pins and added one more VCCsupply line(to uses FTDI power for flashing) .

I added an eeprom 1 wire serial(I2C) chip on 2 versions.
If you have some preference for customization let me know I will add here.
STM32 F103 has no eeprom memory ,coders use a hack on the last pages of flash to emulate eeprom.The original Frsky RX have this eeprom chip for storing bind data.So I added it as an option.

If you choose boards that has the eeprom chip foot print in and not install it(soldering) on the board, the code with use automatically flash to store bind data.
Last edited by midelic; Oct 01, 2019 at 04:48 AM.
Oct 01, 2019, 04:33 AM
Don“t grow up, it“s a trap
aMax's Avatar
Quote:
Originally Posted by jhsa
Is that not done using S.Port?

Joćo

Sent from my BLN-L21 using Tapatalk
...only if you are using the FRSKY Baro module, not a simple module that only outputs data on the I2C bus.
Oct 01, 2019, 04:37 AM
Flying a Chipmunk in Portugal
jhsa's Avatar
Yes, but if you don't have a radio that uses that data, it is the same as not having it. What midelic could perhaps do is an option to use the TX and RX port as I2c, if possible. But then you will lose SBUS.
Oct 01, 2019, 04:51 AM
Don“t grow up, it“s a trap
aMax's Avatar
Quote:
Originally Posted by jhsa
Yes, but if you don't have a radio that uses that data, it is the same as not having it. What midelic could perhaps do is an option to use the TX and RX port as I2c, if possible. But then you will lose SBUS.
On a simple glider I make no use of the sbus, all pwm servos. But with the new coming restriction rules, especially for none club flyer.. it would
be great to get the height.
On my ASW 28 ( Matek405) I have all I need, but there are some vintage gliders on the shelf. On my old Carrera ASW17, I use an old F1 FC only to get voltage
and height over the D8 telemetry.
Oct 01, 2019, 04:51 AM
Registered User
midelic's Avatar
Thread OP
Maybe it is good idea for the future to take out 2 pads of I2C.Idk yet.
Last edited by midelic; Oct 01, 2019 at 05:04 AM.
Oct 01, 2019, 05:10 AM
Flying a Chipmunk in Portugal
jhsa's Avatar
Quote:
Originally Posted by aMax
On a simple glider I make no use of the sbus, all pwm servos. But with the new coming restriction rules, especially for none club flyer.. it would
be great to get the height.
On my ASW 28 ( Matek405) I have all I need, but there are some vintage gliders on the shelf. On my old Carrera ASW17, I use an old F1 FC only to get voltage
and height over the D8 telemetry.
But you have S.Port.. I don't know of any radio that uses i2C data, do you??
also, I also fly gliders sometimes, and there is a DIY project called OpenXsensor (oXs), that can be many sensors, including a vario, and it uses an ACC, so it is very accurate. This is all DIY, with an arduino pro mini. It supports frsky D16 and D8 protocols, and I think some others..
With this project you can also have, how is it called?? compensated vario?? It uses an airpeed sensor together with the barometer, and the ACC.

Joćo
Oct 01, 2019, 05:22 AM
Don“t grow up, it“s a trap
aMax's Avatar
On D8 receivers there is no s-port, need one module for hub telemetry.
OpenXsensor... thanks, I will have a look on that.

Edit: The reason for D8 is, that I still like my old Futaba FC18V3.2 with a DFT ...this radio has nice sliders which I miss on my
QX7 and my little Walkera radio ( both D8 & D16)
Last edited by aMax; Oct 01, 2019 at 05:42 AM.
Oct 01, 2019, 05:27 AM
Flying a Chipmunk in Portugal
jhsa's Avatar
Check that.. I will post a link when I have some time.. But search on openrcforums.com

Joćo
Oct 01, 2019, 05:36 AM
Registered User
midelic's Avatar
Thread OP
OpenXsensors are DIY, very good an accurate.They can use HUB(D8) and SPORT(D16),I used them on both situations.
There are many infos on the internet

https://github.com/openXsensor/openX...XS_Build_Vario
https://github.com/openXsensor/openXsensor
https://openxsensor.github.io/
On openrc forum the guys there have very interesting setups and schematics easy to build.
https://openrcforums.com/forum/viewf...2d0623962767e3
Last edited by midelic; Oct 01, 2019 at 10:26 AM.
Oct 02, 2019, 03:08 AM
Registered User
midelic's Avatar
Thread OP
added gerber files for 2 versions(V1.1and V1.3)
Oct 02, 2019, 05:31 AM
Registered User
Great project! Maybe someone could make make a stripped down PCB version without PWM outputs, just SBUS, S.Port, Power and GND, programming pads. Maybe A1, A2 pads for someone who would need them.
It would be great for those who would like to use it with flight controllers and space is limited.
Oct 02, 2019, 05:44 AM
Registered User
midelic's Avatar
Thread OP
Yes I was planning to make one version like that. It is on cards.It will be smaller.

You want with dedicated connector or with pads(pinout)?
Last edited by midelic; Oct 02, 2019 at 05:50 AM.
Oct 02, 2019, 10:35 AM
Registered User
Quote:
Originally Posted by midelic
Yes I was planning to make one version like that. It is on cards.It will be smaller.

You want with dedicated connector or with pads(pinout)?
I would prefer the solder pads. At least any connection with SBUS, S.Port, +V and GND would be enough. And SWD pads.
Oct 02, 2019, 01:23 PM
Flying a Chipmunk in Portugal
jhsa's Avatar
I am modifying one of Midelic's files for myself, then I will give it back to him, and he can post it if he wish. My receivers are more normal RC model oriented, with 2.54 pitch headers, so I could connect servo connectors, or even some other 2.54 mm pins. Just like the one on the photos above.
By the way, I am just waiting for some better weather so i can fly it

Joćo
Oct 02, 2019, 02:18 PM
Registered User
The more the merrier! This is the beauty of the DIY - everyone can make its own variation for custom needs.
Oct 02, 2019, 04:16 PM
Registered User
midelic's Avatar
Thread OP
added on first post the gerbers for version1.2.
Oct 03, 2019, 12:03 PM
Registered User
midelic's Avatar
Thread OP
@montis
I added on first post a version1.4 smaller board NO servo PWM with VCC,RX,TX,GND.
With that the HW part is concluded.It remained to be added the firmware.
We have some more field testing to be done(on D8 protocol that I added recently )and the actual flying.
Oct 03, 2019, 02:25 PM
Registered User
midelic's Avatar
Thread OP
I uploaded again the V1.4 NO PWM gerber file(it had a mistake the viewer not recognizing the dimensions) and a picture of the generated board from gerber viewer.
Oct 03, 2019, 03:00 PM
Registered User
Hello,

It's a fantastic project!

I already built a small rx based on AT85 / ppm from Midelic design. It was working perfectly. I am very interested by this project to replace my D8 Rx by D16 Rx (thanks to non-acceptable commercial strategy from Frsky removing D8 protocol from their last Tx modules with the arrival of Acces...).

As I have DR8XP, D6FR and D4RII, I will need to have at least 2 "equivalent" sizes (DR8 and D6). So, I plan to use Kicad (I am used to it and it is free) to redraw the circuits and then make my own board design. I will use 9x3 pins bended connectors for 8 servos + 1 input power (and A2 like D6FR) and probably 1.5 or 1.25mm pitch connectors for the remaining.

I found a very usefull functionnality on DR8XP concerning A1. You have the choice to use it for external voltage measurement or, using a jumper, measure Rx voltage. I will do the same and then put a 1/3 divider for A1 (which is ok up to 2S. I may also install another 1/3 divider for A2 and 1/4 divider for A3 and A4. using 0402 resistors, it should not take too much space.

I have 2 questions (for the time being):
- on Frsky Rx, you can choose betwen FS mode (18ms) and HS mode (9ms) for servos. Do you have the same functionnality?
- why did you put a 4.7V zener on A1..4 inputs + serial resistor? (I am not an electronic specialist...).

I am not in a hurry and I plan to build them around Xmas if I decide to go. I will start very soon with the boards design.

Thank you,

Didier
Oct 03, 2019, 04:44 PM
Registered User
midelic's Avatar
Thread OP
Quote:
Originally Posted by Didier Lanot
Hello,
I found a very usefull functionnality on DR8XP concerning A1. You have the choice to use it for external voltage measurement or, using a jumper, measure Rx voltage. I will do the same and then put a 1/3 divider for A1 (which is ok up to 2S. I may also install another 1/3 divider for A2 and 1/4 divider for A3 and A4. using 0402 resistors, it should not take too much space.

I have 2 questions (for the time being):
- on Frsky Rx, you can choose betwen FS mode (18ms) and HS mode (9ms) for servos. Do you have the same functionnality?
- why did you put a 4.7V zener on A1..4 inputs + serial resistor? (I am not an electronic specialist...).

I am not in a hurry and I plan to build them around Xmas if I decide to go. I will start very soon with the boards design.

Thank you,

Didier
-The first prototype I used had jumper on A1 and a divider (max 3S) on the board to select battery voltage from RX or external .We decided to remove it as we considered that is easy to make an external divider for the voltage you need to measure. And on top of that the majority of existing rx are supplied form 5V BEC so the rx battery measurement become useless.

-18ms versus 9ms .This mode is set in TX not in RX.The TxX has and option instead of 9-16 channels to sent the same 1-8 again.So the answer is yes it has the same functionality.

-We put 4.7V zener diode +resistor for over voltage protection.This is common protection circuit using Zene diode.If accidentally you plug in the battery directly on the analog pin you don't destroy the chip.
As you see we provided some additional protections compared with previous designs.
Last edited by midelic; Oct 03, 2019 at 04:51 PM.
Oct 03, 2019, 10:22 PM
Flying a Chipmunk in Portugal
jhsa's Avatar
On my D8 receivers I used 5.1V zeners. I guess the 4.7V zeners still weren't tested. If you use too low of a value, you might get wrong measurements, as the zener might start conducting near 3.3V, which the maximum voltage of the analog port.. many of the chips's pins can tolerate 5V, but not all..

Also, the HS mode on the original D8 receivers didn't do basically nothing, as they just double the same data. The only that HS does well is damaging servos as far as I know. So, no, I wouldn't like to see it on this receiver, or on any other receiver.. Not like this
Joćo
Last edited by jhsa; Oct 04, 2019 at 10:03 AM.
Oct 04, 2019, 12:59 PM
Registered User
Midelic, you are wrong about HS / FS mode on Frsky.
On all guenuine Frsky rx, you select HS or FS mode on the Rx with the Bind button. It has nothing to do with the Tx settings and quantity of channels you transmit (D8 or D16). It's quite easy to verifiy by just connecting an analog servo and try the 2 modes on rx, whatever the setting on the Tx! And even more if you check with an oscilloscope.

No, the majority of rx are not supplied by BEC, maybe aroud you but not around me. There are still a lot lof pepole using NiMh batteries (4S or 5S) and far less using directly 2S with HV servos. So measuring Rx voltage makes sense. Even if I am removing all my NiMh batteries to go to Li Ion, I have still some and when I can, I use HV servos. And if I am stuck, then I use homemade BEC using MIC 29500 where I put the divider (I do it also in esc) using 0402 resistors. I never use the BEC of the esc, I prefer to use the new esc developped for quads with BHeli_32, even for planes and gliders. There are quite small, light and powerfull.

It's a nice feature to protect the A1 to A4 inputs against human mistakes ;-), I already burned the A2 entry of a DR4II (but still working perfectly for the rest). But I will not put them on my adapted design because I will use JST-ZH for that.
You will find attach a first draft of what I would like to build. There are probably many mistakes, so do not hesitate to comment!

Didier
Oct 04, 2019, 01:00 PM
Registered User
Oops, I forgot the drawing!
Oct 04, 2019, 01:20 PM
Registered User
Quote:
Originally Posted by jhsa
On my D8 receivers I used 5.1V zeners. I guess the 4.7V zeners still weren't tested. If you use too low of a value, you might get wrong measurements, as the zener might start conducting near 3.3V, which the maximum voltage of the analog port.. many of the chips's pins can tolerate 5V, but not all..

Also, the HS mode on the original D8 receivers didn't do basically nothing, as they just double the same data. The only that HS does well is damaging servos as far as I know. So, no, I wouldn't like to see it on this receiver, or on any other receiver.. Not like this
Joćo
Hi Joćo,

I know that it is working like that in D8, you refresh twice (with the same info) in 18ms. HS is damaging only analog servos, not digital servos. I have enough used them in HS mode as well as the vast majotiy of glider competitors (F3..) to know that there are no issues at all. And with the last Access protocol, HS mode has been even reduced to 7ms (I am not sure of the value added taking in to account the inertia of the plane / glider).

I know few people who damaged analog servos by connecting them to a SBUS->PWM converter. It is logic because all of the ones I know are delivering a 9ms refreshing time (synchronized with SBUS).

From what I have understood, this new diy rx is D16. With the last version of Opentx, it seems that the latency has significantly reduced. Then HS mode makes far more sense (compared to D8).

Didier
Oct 04, 2019, 02:38 PM
Registered User
midelic's Avatar
Thread OP
@didier,
-HS versus FS, sorry, I misunderstood, is about the servo frame rate.At the moment I had 9ms frame rate only on SBUS and the servo PWM is set to 22.5ms normal frame rate(I can easy change to 18ms). I think I can implement in the future a mode to have switch 18/9 ms frame rate for servos.
-About battery, the actual setup use a 1117 regulator(i see on your design the same regulator) that can used safely without overheating the board a 2S battery.The regulator in theory can support 15V, but any voltage over 10 V will result in overheating the regulator due to the difference in voltage between in and out and the current >100mA.
Safely this setup can be used maxim until 10V. I advertises 2S batt for extra safety.

edit:I was talking about LIPO batt.
Last edited by midelic; Oct 05, 2019 at 02:00 AM.
Oct 04, 2019, 03:20 PM
Registered User
Quote:
Originally Posted by midelic
-HS versus FS, sorry, I misunderstood, is about the servo frame rate.At the moment I had 9ms frame rate only on SBUS and the servo PWM is set to 22.5ms normal frame rate.It is easy to change frame rate so I can implement in the future a mode to have switch 18/9 ms frame rate for servos.
-About battery, the actual setup use a 1117 regulator(i see on your design the same regulator) that can used safely without overheating the board a 2S battery so you may need to use a BEC(if use 4-5S batt).
Yes, it is about servo frame rate. You can download the DR8-XP manual and you will see that you can choose between 9ms and 18ms frame rate. It is the same for all Frsky receivers. If you live in Europe, I can send you a DR4ii (D8) to make some tests / measures if you wish as well as a RX6R (D16).

To make it simple in D16 mode:
- Tx set to 8ch (9ms) and Rx in HS mode (9ms) : all the frames received are sent to the servos at the same speed than what is transmitted.
- Tx set to 8ch (9ms) and Rx in FS mode (18ms) : one frame every 2 frames reveived is "lost"
- Tx set to 16ch (18ms) and Rx in HS mode (9ms) : every frame received is duplicated and sent twice to the servos
- Tx set to 16ch (18ms) and Rx in FS mode (18ms) : all the frames received are sent to the servos at the same speed than what is transmitted.

About battery, 4S / 5S with NiMh means 4x1.2V=4.8V or 5x1.2V=6V, so no need for BEC (1.2V is the nominal voltage). In reality, it is more because a fully charged NiMh battery can go up to 1.4V per cell.
Oct 04, 2019, 03:33 PM
Registered User
midelic's Avatar
Thread OP
Are you sure all Frsky receivers have this feature ?I have at home X4-RSB(D16) which i used for tests and I did not see this feature on the manual.Also I did not see it on X8R(D16)either .Maybe on the newer D16 receivers.
About battery I work only with lipos as many people I know ,so in my mind was 4.2V/cell.Sorry!
Last edited by midelic; Oct 05, 2019 at 02:08 AM.
Oct 04, 2019, 03:48 PM
Flying a Chipmunk in Portugal
jhsa's Avatar
You don't gain absolutely ANYTHING in using the faster frame rate on the Frsky D8 receivers.. They were cheating making people believe that it was faster, but it isn't.

About the receiver board. You build it the way you want, with the parts you want. If you want a divider for measuring the battery voltage into A1, just implement it on your schematic and board, together with a jumper to a1. It is the beauty of DIY. You do it as you want. and that doesn't affect the code at all. the code is already prepared for it. I am going to build to suit my needs. I also fly different types and sizes RC airplanes.. But for me is not a problem to use an external voltage divider.. Actually, even better, I use the openXsensor. Even for gliders, i never used the internal voltage sensor of the frsky receivers.
Midelic will build his receivers for the type of models he flies.. That is why he posted several boards.. His and mine. And there is a good chance that there will be some other mods to the design..
So, enjoy it and build it the way you want it.

Joćo
Last edited by jhsa; Oct 04, 2019 at 04:01 PM.
Oct 05, 2019, 02:28 AM
Registered User
Quote:
Originally Posted by midelic
Are you sure all Frsky receivers have this feature ?I have at home X4-RSB(D16) which i used for tests and I did not see this feature on the manual.Also I did not see it on X8R(D16)either .Maybe on the newer D16 receivers.
About battery I work only with lipos as many people I know ,so in my mind was 4.2V/cell.Sorry!
I just checked again and you are right, the first serie of "D16" receivers (X4R, X6R, X8R and RX8R) did not have the 2 modes => so probably low speed mode by default to be compatible with all servos. All the new ones include again this functionnality with a different way to select it at switch on (connecting 2 servo pins).

Again, if you want to make some measures, I can send you a RX6R.
Oct 05, 2019, 02:42 AM
Registered User
Quote:
Originally Posted by jhsa
You don't gain absolutely ANYTHING in using the faster frame rate on the Frsky D8 receivers.. They were cheating making people believe that it was faster, but it isn't.

About the receiver board. You build it the way you want, with the parts you want. If you want a divider for measuring the battery voltage into A1, just implement it on your schematic and board, together with a jumper to a1. It is the beauty of DIY. You do it as you want. and that doesn't affect the code at all. the code is already prepared for it. I am going to build to suit my needs. I also fly different types and sizes RC airplanes.. But for me is not a problem to use an external voltage divider.. Actually, even better, I use the openXsensor. Even for gliders, i never used the internal voltage sensor of the frsky receivers.
Midelic will build his receivers for the type of models he flies.. That is why he posted several boards.. His and mine. And there is a good chance that there will be some other mods to the design..
So, enjoy it and build it the way you want it.

Joćo
You are fully right Joćo for D8, but maybe that Frsky bet on the "placebo" effect on the pilot :-)

Now the most important question for this FS/HS topic is: are they cheating us again for D16 protocol with regards to HS mode?

This is the genius of this project, you can adapt it to your needs ! You say that you do not use the internal voltage sensor of Frsky receivers; did you have any issue with it? I would be happy to know and make probably me move then to openXsensor.
Oct 05, 2019, 03:12 AM
Registered User
As I want to avoid too much mistakes when I will launch the manufacturing of the board, I have few questions:

- for A1 to A4, you have also a ground pin for each. Does it means that you have more than one battery with grounds not connected together or is it for other reasons? In audio circuits, you always want to use a ground star connection and avoid by all means any ground loop that generate noise and wrong references (wires impedance). Is it different in digital world? (where I have a very very limited knowledge at best...) I removed these ground connections in my design but it can be a mistake.
- for the 2 LEDs linked to antennas status, I have understood (maybe wrongly) from Aliexpress page that you choose the antenna receiving by changing the status of "SEL" input on the module (low or high level). So, you send a "square wave" from the STM32 to "change" between the 2 antennas at a given frequency. Then, the 2 LED are reflecting the output of the "command" function from the STM32 but not if you are really receiving something from each antenna. Is it a correct understanding?
- for the resonnator, is it possible to replace it by a crystal which may be easier to find on Aliexpress?
Oct 05, 2019, 03:20 AM
Registered User
midelic's Avatar
Thread OP
@Didier,
A1-A4 have a ground each to solder a 2.54 mm pinout(2 pins A1 on top ,Gnd under) to connect DuPont wires or a 2.54mm connector.You can remove them if don't like.See also photos of the prototype on the first post.
-About antenna is much simple, when the SEL pin is High one antenna is on ,when is LOW the other one.
The switch between the 2 is controlled by software not at a given frequency but based on missing packets.The led is reflecting which antenna is in use.
You can use any 8Mhz X-tal.
About HS/FS think about that D16 sends out 16 channels .1-8 in 9ms and 9-16 in another 9ms,So channels 1-8 (or 9-16)are sent every 18ms.
In normal mode(all 16 channels sent ) I failed to see how they can sent servo data every 9ms in this mode.
Last edited by midelic; Oct 05, 2019 at 04:00 AM.
Oct 06, 2019, 01:46 AM
Registered User
midelic's Avatar
Thread OP
I suggest using a setup with eeprom chip.
Even in the case of not using it(soldering it) is better to have it in a reserved place(footprint) for future development.
Moreover while the flash can be used as eeprom the number of writing cycles is limited, according with manufacturer is 10000 compared with a dedicated eeprom chip that has 1000000.
You will not reach 10000 flashing/re-flashing of the mcu in your RX life time but some people may come worried.
The code will work either way it was just a suggestion.
Last edited by midelic; Oct 06, 2019 at 10:43 AM.
Oct 06, 2019, 10:08 AM
Flying a Chipmunk in Portugal
jhsa's Avatar
Here is a little video showing antenna diversity working..
I am not allowed to upload video files here, but i zipped it.. So, make sure you unzip the file..

Joćo
Oct 06, 2019, 12:47 PM
Flying a Chipmunk in Portugal
jhsa's Avatar
Ready for the first flight if the weather allows.. Forecast is quite good.

Sent from my BLN-L21 using Tapatalk
Oct 06, 2019, 01:16 PM
Registered User
Quote:
Originally Posted by midelic
@Didier,
A1-A4 have a ground each to solder a 2.54 mm pinout(2 pins A1 on top ,Gnd under) to connect DuPont wires or a 2.54mm connector.You can remove them if don't like.See also photos of the prototype on the first post.
-About antenna is much simple, when the SEL pin is High one antenna is on ,when is LOW the other one.
The switch between the 2 is controlled by software not at a given frequency but based on missing packets.The led is reflecting which antenna is in use.
You can use any 8Mhz X-tal.
About HS/FS think about that D16 sends out 16 channels .1-8 in 9ms and 9-16 in another 9ms,So channels 1-8 (or 9-16)are sent every 18ms.
In normal mode(all 16 channels sent ) I failed to see how they can sent servo data every 9ms in this mode.
So, I made a quick and dirty measure of the sevo output period (with an oscilloscope) on my RX6R; in HS mode, I have 9ms and in FS mode, I have 18ms; whatever the settings in Opentx.

I agree with you that if you transmit the 16ch, there is no miracle and each servo should be updated every 18ms; then HS is useless in this case.
But if you transmit only 8ch (which is 90% on my cases) AND you have digital servos; it make sense to select HS mode on Rx under the condition that the servo position is really updated every 9ms on Tx side, which I don't know... Opentx offers the 2 possibility specifying in the menu the 9ms for 8ch and 18ms for 16ch. So, we may rely on Opentx dev. team.
Oct 06, 2019, 01:26 PM
Registered User
Quote:
Originally Posted by midelic
I suggest using a setup with eeprom chip.
Even in the case of not using it(soldering it) is better to have it in a reserved place(footprint) for future development.
Moreover while the flash can be used as eeprom the number of writing cycles is limited, according with manufacturer is 10000 compared with a dedicated eeprom chip that has 1000000.
You will not reach 10000 flashing/re-flashing of the mcu in your RX life time but some people may come worried.
The code will work either way it was just a suggestion.
ok, I will add it in my design for v1.2.
I have updated it with:
- no more leds for antennas selection (I cannot see them while I am flying) but the possibility to connect the SEL pin to A4; then I can monitor the antennas status via telemetry (0 or 3.3v) on Tx. Jumper JP3 for that.
- I used Molex Picoblade connectors with different number off pins, then no possibility to make mistakes (I am getting old :-) ).
- the size of the pcb is exactly the same than the DR8-XP, so it should be a plug and play in my models.
- the routing is not finish but I will have anyway to redo a part of it to integrate the eeprom chip.
-all resistors and major part of capacitors are 0402.

Attached some pictures (schematic and 3D views from Kicad).
Oct 06, 2019, 02:28 PM
Flying a Chipmunk in Portugal
jhsa's Avatar
we use the LEDs on the antennas as they help to troubleshoot problems while testing the receiver. I actually use them when trouble shooting on the ground. When your model is flying there is not much troubleshooting you can do anyway if something goes wrong with one antenna.... or two
Nice design though.. Make sure you don't use those L shapped Cinese pin headers. The straight ones are ok, but the L shapped ones i bought aren't good. Pins must be thinner because they lose contact with my servo connectors sometimes.. That is why i stopped using them on anything that flies..

Joćo
Oct 06, 2019, 02:54 PM
Registered User
midelic's Avatar
Thread OP
@didier
Nice setup.
I recommend use STM32F103CBT6 it has 128k flash.It works also with STM32F103C8T6(64K).
I have on mine C8T6 strangely enough you can change to 128K in Demonstrator when flashing.Flash demonstrator recognize it at 64 K but you can use it for 128K.
Like joao said if you use daughter board for servo pins the length of the board will shorten( be more compact) and be also less problematic with those pins.Also 3 row pinheader angled are not easy to find and expensive.
You can make a servo daughter board from perfboard or design one in kicad.

edit:

I see you put on you schematic N-channel mosfet(IRML2502),
That is not good .You need a P-channel mosfet.
https://circuitdigest.com/forums/gen...ity-protection
Last edited by midelic; Oct 06, 2019 at 03:15 PM.
Oct 07, 2019, 12:22 AM
Mark Harrison
Midelic, would you ever release the source code? I'm a software guy with some ideas for receivers. I hope eventually I can buy from somewhere an approved hardware unit and I can load my own software.
Oct 07, 2019, 01:29 AM
Registered User
midelic's Avatar
Thread OP
Not this one.If you want code to start with RX, some code is already exiting embedded in multiprotocol and betaflight.
https://github.com/pascallanger/DIY-..._Rx_cc2500.ino
https://github.com/betaflight/betafl...er/src/main/rx
Last edited by midelic; Oct 07, 2019 at 01:43 AM.
Oct 07, 2019, 02:16 AM
Registered User
ddano007's Avatar
First of all great thanks to midelic and jhsa for this project. Because I`m flying D8R family RX with two external analog inputs, this is exactly, what I was looking for. However I`m a little bit afraid of using 0402 parts, they are quite small for old man, but understand that`s the reason You used them
Just one question at this moment: what`s the progress according LBT protocol?
Thanks, Daniel.
Oct 07, 2019, 03:11 AM
Registered User
midelic's Avatar
Thread OP
The parts in my project are 0603.See the BOOM list on my first post.0403 parts are used by @didier in his customized setup.
About the LBT I have the code but is not tested yet.
Atm it has D16(FCC) and D8 inside.
Oct 07, 2019, 08:02 AM
Flying a Chipmunk in Portugal
jhsa's Avatar
Wow, I failed to see he was using an N channel Mosfet.. IT MUST BE a P channel :O
Why changing the mosfet? The AO3407 is small enough and it seems to be a available in many places..

Joćo

Sent from my BLN-L21 using Tapatalk
Oct 07, 2019, 11:50 AM
Flying a Chipmunk in Portugal
jhsa's Avatar
Ladies and Gentlemen, I would like to inform you that the DIY X compatible receiver has flown
Two flights, one in D16 mode (X protocol), and once in D8 mode. The plane survived both, even if I had an emergency landing on the last flight because the plane's ESC somehow refused to start the motor But no problem at all..
I am uploading some videos. and also logged the flight, I think.. will post both when I get all the info ready..

Joćo
Oct 07, 2019, 12:43 PM
Flying a Chipmunk in Portugal
jhsa's Avatar
Here are the videos: The camera was always going out of focus.. Not enough light i guess
Midelic will post the rest of the data

Joćo

DIY D16 Receiver, First Flight. X Protocol (7 min 31 sec)


DIY D16 Reveiver, First Flight. D8 Protocol (7 min 28 sec)
Oct 07, 2019, 01:22 PM
Registered User
Quote:
Originally Posted by jhsa
we use the LEDs on the antennas as they help to troubleshoot problems while testing the receiver. I actually use them when trouble shooting on the ground. When your model is flying there is not much troubleshooting you can do anyway if something goes wrong with one antenna.... or two
Nice design though.. Make sure you don't use those L shapped Cinese pin headers. The straight ones are ok, but the L shapped ones i bought aren't good. Pins must be thinner because they lose contact with my servo connectors sometimes.. That is why i stopped using them on anything that flies..

Joćo
I will simulate the LEDs on my telemetry page (with nice colored rectangles :-) ), then I can see the status before flying. the problem is that I may not see the LED easily in the plane. What is the default state for SEL (0 or 1) ? It's to make the correspondane with the corresponding voltage (0 or 3.3v) on A4. And if I am not too lasy, I will generate a log by curiosity.

Concerning the pins, you generated a big doubt on my side ! So, I took a caliper and measured the pins on diffrent Frsky receivers and the ones i was planning to use.
Result: Frsky = 0.64 x 0.64mm; the other ones = 0.63x063 to 0.64x0.64
It has to be noted that I bought these ones a long time ago in France, not in China. Maybe the reason... So, I will use them. Anyway, it is quite easy to modify the design with your solution and I will generate one with this setup.

Didier
Oct 07, 2019, 01:30 PM
Registered User
Quote:
Originally Posted by midelic
@didier
Nice setup.
I recommend use STM32F103CBT6 it has 128k flash.It works also with STM32F103C8T6(64K).
I have on mine C8T6 strangely enough you can change to 128K in Demonstrator when flashing.Flash demonstrator recognize it at 64 K but you can use it for 128K.
Like joao said if you use daughter board for servo pins the length of the board will shorten( be more compact) and be also less problematic with those pins.Also 3 row pinheader angled are not easy to find and expensive.
You can make a servo daughter board from perfboard or design one in kicad.

edit:

I see you put on you schematic N-channel mosfet(IRML2502),
That is not good .You need a P-channel mosfet.
https://circuitdigest.com/forums/gen...ity-protection
For the stm, I didn't pay full attention when selecting the component in Kicad library, C8T and CBT are following and with my poor eyes, I click the first... Thank you for the info, I have already modified the schematic.

For the mosfet, it was not on purpose, it's my mistake. I changed because I didn't found so much sellers on internet, I had a stock of IRLML and I didn't pay attention; but I have also some p-mosfet (even smaller with good rds on) comming from the time I was building very small IR rx with actuators.
Thank you (ans also to you Joćo) again for all those very valuable infos/support.

Didier
Oct 07, 2019, 01:31 PM
Registered User
midelic's Avatar
Thread OP
Quote:
What is the default state for SEL (0 or 1) ?
At start the pin on SEL is High.
Oct 07, 2019, 01:40 PM
Registered User
midelic's Avatar
Thread OP
I plotted the RSSI distribution from joao logs.
D16 looks stable during the flight.
D8 had swamping at start which I need to adjust next in the code.
I attached also full logs
Last edited by midelic; Oct 07, 2019 at 02:21 PM.
Oct 07, 2019, 01:45 PM
Registered User
Quote:
Originally Posted by ddano007
First of all great thanks to midelic and jhsa for this project. Because I`m flying D8R family RX with two external analog inputs, this is exactly, what I was looking for. However I`m a little bit afraid of using 0402 parts, they are quite small for old man, but understand that`s the reason You used them
Just one question at this moment: what`s the progress according LBT protocol?
Thanks, Daniel.
If you have "old" eyes like me, it's better to use a binocular to solder those tiny components. In this case, you can even go down to 0201. I choosed 0402 because I have some capacitors and resistors at home and I wanted to use them (they are generally sold by 100!). But 0603 can be easily managed with just a magnifier by everybody. Don't be afraid ! The most important (from my little experience in soldering smd) is the soldering iron tip and good flux.

Didier
Oct 07, 2019, 01:57 PM
Flying a Chipmunk in Portugal
jhsa's Avatar
Ha, I used a 2 mm flat tip to solder the chip and also the 0603 components..
What I find a bit difficult is to keep the chip in place while solderIng the first pin(s) down..

Joćo
Oct 07, 2019, 02:32 PM
Registered User
ddano007's Avatar
@Didier Lanot: Well, 0402 is not only about eyes ( I have biiig magnifier ) , but I`m not comfortable to place such small components on place... Commonly I use 0805 size, 0603 can be sometimes, but that`t the minimum. I like 3-lines servo connector on Your design. I don`t like Molex connectors pinout, I`m missing Vcc and GND there. Isn`t it possible to little bit modify J3 connector to to 5- pin Molex with Vcc - A2 - A3 - A4 - GND pinout? And J4 to 3-pin Molex with Vcc - A1 - GND pinout ?
Oct 07, 2019, 02:42 PM
Registered User
ddano007's Avatar
@ midelic: As I`m looking to Your design, the PCB width can accept 9 standard 2.54mm pitch connector, right?
If so, can You sometimes a little bit modify analog/ communication side of PCB on 1.2 version to
A1- Vcc - GND - GND - Vcc - A2 - Rx - Vcc - GND
A3- Vcc - GND - GND - Vcc - A4 - Tx - Vcc - GND
or something like that, so standard 3- pin servo cables with power lines can be used? It can be useful to have power on analog pins for ACS712, 781 current hall sensor, or on communication lines for OpenXSensor hub...
Oct 07, 2019, 02:47 PM
Registered User
midelic's Avatar
Thread OP
So you want similar like servo pins.Sensors to be supplied from rx.
I think I can give you the easy eda files and you modify the 1.2 design the way you want.Send me PM with your mail and I will send it to you.
After you can post the modifications here for other people to use.This is a project that everybody can contribute to make the perfect rx.
Last edited by midelic; Oct 07, 2019 at 02:59 PM.
Oct 07, 2019, 06:45 PM
Flying a Chipmunk in Portugal
jhsa's Avatar
Quote:
Originally Posted by ddano007
@ midelic:
or something like that, so standard 3- pin servo cables with power lines can be used? It can be useful to have power on analog pins for ACS712, 781 current hall sensor, or on communication lines for OpenXSensor hub...
if I may give a bit of advice, being that I have built a few current sensors with ACS chips, if i were you I wouldn't power it from the receiver, specially if you have servos connected to it, and powered by a BEC, You see, servos draw a lot of current normally. And normally when that happens, the voltage fluctuates. that will influence the current sensor accuracy.
I would power it (along with the oXs) from the battery directly, using one or more regulators.
I would never use my receiver as a power source for sensors. specially for those who depend on a stable voltage to output accurate measurements, as it is the case of the ACS712.
In my setup, if I remember, I used a 9V regulator followed by a 5V regulator to power the ACS sensor i have. Or another possibility , if using a 3 lipo cell, is to power the sensor and oXs from 2 of the cells, and use a single 5V regulator,
This would give a more stable voltage than powering it from a BEC that is also powering receiver and servos
Joćo
Oct 07, 2019, 07:04 PM
Flying a Chipmunk in Portugal
jhsa's Avatar
Quote:
Originally Posted by midelic
This is a project that everybody can contribute to make the perfect rx.
There is no perfect RX :P

There is a receiver that is perfect for me, one that is perfect for you, there is a receiver that is perfect for this or that application. And the good thing about DIY is that you can build YOUR OWN perfect receiver.. You do not get this with commercial products
Heck, you can also have several perfect receivers, you can build one with oXs on the same board, you can build a receiver on the same board as your drone's flight controller. Your imagination is the limit.
I am quite happy with the one I have for now, though some improvements could be made. But this is me, other people have different needs.
So, just design your own receiver based on the designs Midelic posted here. You can remove connections that you don't need. Build it the way you want it to be..

Joćo
Oct 07, 2019, 09:21 PM
Mark Harrison
Quote:
Originally Posted by midelic
Not this one.If you want code to start with RX, some code is already exiting embedded in multiprotocol and betaflight.
https://github.com/pascallanger/DIY-..._Rx_cc2500.ino
https://github.com/betaflight/betafl...er/src/main/rx
Just what I was looking for, thanks!
Oct 08, 2019, 03:26 AM
Registered User
ddano007's Avatar
Quote:
Originally Posted by jhsa
if I may give a bit of advice, being that I have built a few current sensors with ACS chips, if i were you I wouldn't power it from the receiver, specially if you have servos connected to it, and powered by a BEC, You see, servos draw a lot of current normally. And normally when that happens, the voltage fluctuates. that will influence the current sensor accuracy...
OK, thanks for Your experience. I commonly use YEP ESC with 5.5V BEC and noticed no problem with OXS powered to RAW input. As curent sensor mostly use ACS781 sensor with 3.3V stabilizer, and again it works. ACS712 have only on one aircraft and for hobby use with calibration using charger vs OTX telemetry consumption it`s sufficient.
In any case I think, that analog inputs with both Vcc and GND option could be useful. When I will have time ( on Christmas ) I will try to modify a little bit the PCB...
Oct 08, 2019, 04:58 AM
Flying a Chipmunk in Portugal
jhsa's Avatar
Sure, I was sharing my experience with the ACS sensors.
At the moment, I even avoid connecting ground between oXs and receiver to avoid ground loops and also trying to prevent having a path for high currents to pass.
Last edited by jhsa; Oct 08, 2019 at 10:09 AM.
Oct 12, 2019, 09:28 AM
Registered User
Ozyris's Avatar
Is it possible to use cc2500 module without pa lna for this project?
I'm also looking for a way to upgrade the built-in FrSky receiver on the brushed whoop by removing the atmega and connecting CC2500 directly to stm32.
Last edited by Ozyris; Oct 12, 2019 at 11:41 AM.
Oct 12, 2019, 11:44 AM
Registered User
midelic's Avatar
Thread OP
Yes can be used CC2500 whitout PA/LNA.
For betaflight it depends on the FC board you use.The STM32 chip the board has.
betaflight target.h file for F303 chip.So check you board in src\main\target folder in betaflight and find if spi pinout are free.
*___________________________
#define USE_SPI

#define USE_SPI_DEVICE_1
#define SPI1_NSS_PIN PA4
#define SPI1_SCK_PIN PA5
#define SPI1_MISO_PIN PA6
#define SPI1_MOSI_PIN PA7

#define USE_SPI_DEVICE_2
#define SPI2_NSS_PIN PB12
#define SPI2_SCK_PIN PB13
#define SPI2_MISO_PIN PB14
#define SPI2_MOSI_PIN PB15
Oct 12, 2019, 12:03 PM
Registered User
Quote:
Originally Posted by jhsa
Ha, I used a 2 mm flat tip to solder the chip and also the 0603 components..
What I find a bit difficult is to keep the chip in place while solderIng the first pin(s) down..

Joćo
Well done with a 2mm tip !!!

I use a 0.4mm tip which is mandatory when you solder 0201. which are quite close to each other. A great help is the solder flux. I am using one bought at Conrad, the brand is "Lötfett", a small blue metallic box. It's like a grease; I put a few on the pcb and the component pins. Then, its greasy texture helps to keep the component in place, not too much but enough to precisely place the component and then keep it in position with a tooth pick. And I use obviously the "old" good solder with lead... At the end, I clean the whole with acetone and a tooth brush.

Didier
Oct 12, 2019, 12:08 PM
Registered User
midelic's Avatar
Thread OP
I used also a bigger tip for solder small SMD -603 ,About solder paste I moved the paste from the plastic can it arrived , in a syringe/large needle to have better control.For cleaning I used 90 deg isopropyl alcohol 1 liter( with toothbrush) you can find in any diy store.
Oct 12, 2019, 12:09 PM
Registered User
Quote:
Originally Posted by ddano007
@Didier Lanot: Well, 0402 is not only about eyes ( I have biiig magnifier ) , but I`m not comfortable to place such small components on place... Commonly I use 0805 size, 0603 can be sometimes, but that`t the minimum. I like 3-lines servo connector on Your design. I don`t like Molex connectors pinout, I`m missing Vcc and GND there. Isn`t it possible to little bit modify J3 connector to to 5- pin Molex with Vcc - A2 - A3 - A4 - GND pinout? And J4 to 3-pin Molex with Vcc - A1 - GND pinout ?
I put my first design in standby (the routing was not finished) because I discovered this week that we can upgrade the DR8-XP and D4R-II to D16 protocol; which I tried this pm on both...
But I still have 3 D6FR Rx to replace so I redesigned a pcb with the same size than the D6FR and I wanted it "F.F.F" as we say in industry (Fit, Form, Function). I will have just to disconnect the D6FR and reconnect the new one without changing any wiring, meaning that the channel order is the same (and same direction) as well as A2 on the 7th pin.

Some pictures following.

Didier
Oct 12, 2019, 12:18 PM
Registered User
Quote:
Originally Posted by midelic
I used also a bigger tip for solder small SMD -603 ,About paste I moved the paste from the plastic can it arrived , in a syringe/large needle to have better control.For cleaning I used 90 deg isopropyl alcohol 1liter with toobrush you can find in any diy store.
The problem I had in the past on my ultra mini IR Rx's (ie 8x7mm; 0.2grams for 2 proportionnal channels + esc) was that the space between components was to small to accomodate more that 0.8mm tip; and I had also to manage the quantity of solder to a minimum (useless weight...). In France, we can find acetone in any diy store also and it is very good to clean a surface (except plastic) before gluing.
Oct 12, 2019, 12:24 PM
Registered User
Ozyris's Avatar
Quote:
Originally Posted by midelic
Yes can be used CC2500 whitout PA/LNA.
For betaflight it depends on the FC board you use.The STM32 chip the board has.
betaflight target.h file for F303 chip.So check you board in src\main\target folder in betaflight and find if spi pinout are free.
Board is spracingf3evo from eachine. Compared to target.h from crazeebef3fr it does not have:
#define RX_SPI_INSTANCE SPI2
#define RX_NSS_PIN SPI2_NSS_PIN
#define RX_SPI_EXTI_PIN PA8
#define RX_SPI_LED_PIN PA10
#define RX_SPI_BIND_PIN PA9

Will it be enough to resource pins to make it work?
Oct 12, 2019, 12:29 PM
Registered User
So, as written before, you will find below few pictures for my D6FR replacement. PCB is exactly the same size.
I added SBUS and Smartport via picoblade connector. Like D6FR, A1 measures the Rx voltage and A2 is on pin 7. I put also all components on the same side.
A1, A3, A4, CH7 and CH8 are accessibles by pads on the under side of the pcb. If you short the pad close to A4, you get then the antenna status on A4. f you don't want to use A1, then you can connect to A1 pad (220R not installed) and not install the 2 corresponding resistors (R10 and R11).
I still have to design a small "daughter' board to glue bellow if needed to add the 2 extra connectors for CH7 and CH8 (as well as associated R and C) + A3 pin and 220 resistor.

The routing is complete. I just need to generate the gerber files.

All comments are more than welcome !!!

Edit on 1st of November : Gerber removed due to mistake on CC2500 pin numbering.

Didier
Last edited by Didier Lanot; Nov 01, 2019 at 04:58 AM.
Oct 12, 2019, 01:28 PM
Registered User
midelic's Avatar
Thread OP
Do you have some pictures with D6R to see which chip has?Maybe it can be re-flashed with a new firmware.Or to make a new firmware for it.
Oct 12, 2019, 01:34 PM
Registered User
midelic's Avatar
Thread OP
Quote:
Originally Posted by Ozyris
Board is spracingf3evo from eachine. Compared to target.h from crazeebef3fr it does not have:
#define RX_SPI_INSTANCE SPI2
#define RX_NSS_PIN SPI2_NSS_PIN
#define RX_SPI_EXTI_PIN PA8
#define RX_SPI_LED_PIN PA10
#define RX_SPI_BIND_PIN PA9

Will it be enough to resource pins to make it work?
You need HW spi pin available to conect CC2500 chip.
I see on that board.



#define USE_SPI_DEVICE_2 // PB12,13,14,15 on AF5 SPI2 (SDCard)
you need to have available one of these 2 sets these pins below(from spracingf3evo)
SPI1 or SPI2 pins

#define SPI1_NSS_PIN PB9
#define SPI1_SCK_PIN PB3
#define SPI1_MISO_PIN PB4
#define SPI1_MOSI_PIN PB5



#define SPI2_NSS_PIN PB12
#define SPI2_SCK_PIN PB13
#define SPI2_MISO_PIN PB14
#define SPI2_MOSI_PIN PB15

I think can be repurposed other free pins to use as spi with spi soft serial code in betaflight but it is too complicated for a common user and need building(compiling) new betaflight code.
Last edited by midelic; Oct 12, 2019 at 01:40 PM.
Oct 12, 2019, 03:01 PM
Registered User
Ozyris's Avatar
Quote:
Originally Posted by midelic
You need HW spi pin available to conect CC2500 chip.
I see on that board.

#define USE_SPI_DEVICE_2 // PB12,13,14,15 on AF5 SPI2 (SDCard)
you need to have available one of these 2 sets these pins below(from spracingf3evo)
SPI1 or SPI2 pins


I think can be repurposed other free pins to use as spi with spi soft serial code in betaflight but it is too complicated for a common user and need building(compiling) new betaflight code.
Spracingf3evo brushed have atmega with your code (compared wiring).
That board does not have SD, in this way we can use SPI2.
The challenge is to make old woops compatible with new Access radios (D16 still works).
Last edited by Ozyris; Oct 12, 2019 at 03:24 PM.
Oct 12, 2019, 03:25 PM
Registered User
midelic's Avatar
Thread OP
If its has SPI2 available. It can be connected a small cc2500 module to spi pins.But I think it needs rebuilding betaflight firmware anyway. Aditionally you need also GDO0 pin(RX_SPI_EXTI_PIN) from CC2500 connected to one free F303 pin.Also a bind pin to another free pin of F303.
So you have to modify target file in betaflight and rebuilt again the firmware.If you want to pursue this till to the end check for reference the target files of my prototype board when I ported frsky code in betaflight.

https://github.com/betaflight/betafl...LICF3/target.h

SO you have to modify the target file(with the model above) of spracingf3evo and compile again the betaflight firmware.
Oct 16, 2019, 10:20 AM
Registered User
Ozyris's Avatar
Quote:
Originally Posted by midelic
SO you have to modify the target file(with the model above) of spracingf3evo and compile again the betaflight firmware.
It works!

Code:
# diff
# Betaflight / SPRACINGF3EVO (SPEV) 4.1.0 Oct 13 2019 / 16:33:26 (1b1647fc9) MSP API: 1.42 / 
FEATURE CUT LEVEL 8
batch start
feature -TELEMETRY
feature -RSSI_ADC
feature -TRANSPONDER
set yaw_motors_reversed = ON
set small_angle = 180
set frsky_spi_tx_id = 51,144
set frsky_spi_offset = -46
set frsky_spi_bind_hop_data = 0,120,5,125,10,130,15,135,20,140,25,145,30,150,35,155,40,160,45,165,50,170,55,175,60,180,65,185,70,190,
75,195,80,200,85,205,92,210,95,215,100,222,105,225,110,230,115,255,255,255
set frsky_x_rx_num = 8

profile 0

rateprofile 0
batch end
Last edited by Ozyris; Oct 16, 2019 at 10:27 AM.
Oct 16, 2019, 02:03 PM
Registered User
midelic's Avatar
Thread OP
Congrats.the most difficult part for many guys is to compile
betaflight.
Oct 17, 2019, 02:59 PM
Registered User
Quote:
Originally Posted by midelic
Do you have some pictures with D6R to see which chip has?Maybe it can be re-flashed with a new firmware.Or to make a new firmware for it.
It would be a great new to have the capability to flash the D6FR with D16 mode !!!

So, I made the picture requested and wrote what I read on the chips. There are 4 small holes on the side of the pcb, I followed the traces to see where they are connected on the chip.

For D6FR, if we want to just update it to D16 mode (which is more than enough), then no need for SBUS and Smart port; only RSSI, A1 and A2.

Frsky sold some time ago an adaptator (FUL-1) to be used with FRUSB-3 that had to be used to flash the 1st DR8 versions via 4 small holes (the same look than the D6FR ones). So, based on VCC and GND pins of FUL-1 and equivalent ones on D6FR, I draw a sketch showing what the connexion may look like.

Didier
Oct 18, 2019, 04:52 AM
Flying a Chipmunk in Portugal
jhsa's Avatar
I think this should not be in the DIY receiver thread.. There is another thread dedicated to flash original Frsky receivers with the X protocol.
Mixing both subjects will make it confusing for people that want to build a DIY receiver.
Just my 2 cents.

Joćo
Oct 21, 2019, 07:54 PM
Registered User
midelic's Avatar
Thread OP
Update:
Added also LBT protocol now.
It has D16, D16-LBT and D8 on the same receiver.
Oct 21, 2019, 10:30 PM
Flying a Chipmunk in Portugal
jhsa's Avatar
That will need a good range test, problem is I don't have an original frsky module. Only the MultiProtocol module. And it seems LBT is still mot 100% on multi..

Joćo
Oct 22, 2019, 12:02 PM
Flying a Chipmunk in Portugal
jhsa's Avatar
Two more nice and uneventful flights with the FrskyX DIY Compatible receiver today
Still didn't have a look at the log files but I think they will show no problems..

Joćo
Oct 23, 2019, 01:33 PM
Flying a Chipmunk in Portugal
jhsa's Avatar
and another two flights today.. It looks like DIY X is kickin'

Joćo
Oct 24, 2019, 12:40 PM
Registered User
ddano007's Avatar
Joćo , what protocol are You flying? FCC or LBT?
Oct 24, 2019, 01:19 PM
Registered User
ddano007's Avatar
I have a little time, so started my design. I want to have S.Port & S.Bus on one subboard with PWM ouputs. I`m using YEP ESCs, so additional cap is welcomed. I will place those big caps 90deg angled, but don`t find such item in KiCad. The question: would be useful adding separate 1x3 header for BEC? I`m flying FrSky`s D8R RXs and there is not, but on some RXs is additional power slot. Your opinion?
Oct 24, 2019, 07:08 PM
Flying a Chipmunk in Portugal
jhsa's Avatar
Quote:
Originally Posted by ddano007
Joćo , what protocol are You flying? FCC or LBT?
At the moment FCC. But Midelic has been working on LBT.
I believe you will have both options when the code is released..
Oct 28, 2019, 09:01 PM
Flying a Chipmunk in Portugal
jhsa's Avatar
How to configure the different modes and failsafe.

DIY Frsky D16 Compatible RX, How to set Modes and Failsafe (24 min 17 sec)
Oct 29, 2019, 04:34 PM
Flying a Chipmunk in Portugal
jhsa's Avatar
I am happy to report that the first (as far as I know) DIY frsky D16 compatible receiver using the LBT D16, protocol has successfully flown today, Twice
No problems to report so far.

Joćo
Oct 30, 2019, 03:55 AM
Registered User
Quote:
Originally Posted by jhsa
I am happy to report that the first (as far as I know) DIY frsky D16 compatible receiver using the LBT D16, protocol has successfully flown today, Twice
No problems to report so far.

Joćo
It's a very good new! Thanks Joćo for all your time spent on testing.

As soon as my orders arrive, there should be another one...
Oct 30, 2019, 04:12 AM
Registered User
During migration from Kicad V4 to V5, I made a cross check and discovered that I inverted the pins on the cc2500 module, despite Midelic warning in his 1st post... So, I had to re-route a part of the pcb. Then, I decided to re-do 2 Rx, one with 7ch, the other one with 8ch. What is common to them:
- I replaced the AMS1117 regulator by a REG113. The reason is that the minimum input voltage for AMS1117 in order to guarentee a good 3.3v regulation is 4.8V (following datasheet). So, if you add the 0.1V voltage drop of the BAT60 (much less with the MOSFET), the minimum voltage is 4.9v. It is not a problem if you are supplied by a BEC but in my case, I have 2 "old" models" supplied with 4S-NiMh, meaning 4.6V minimum => not compatible. So, I moved to REG113 which can work down to 3.9v but limited to 400mA which should be enough.
- I replaced the BAT60 by BAT760, little higher voltage drop (0.2v) but much easier to find on Aliexpress.
- Following REG113 datasheet (and most of the linear regulators), I replaced the "big"multilayer ceramic capacitors by tantalum ones.
- When looking to the STM32 datasheet (to see power consumption vs REG113), I saw that they strongly suggest to put a 100nF capacitor between each "pair" of power supply. When I looked on my Frsky receivers, I saw also these capacitors. So, I added these but in 0201 format as I didn't had the space to put bigger without a complete redesign of the pcb (and I have them in stock). But I am not sure that I will solder them...

Next post with the pictures and Gerber files.

Didier
Oct 30, 2019, 04:26 AM
Registered User
So, let's start with the 7CH. The first 6 channels are routed to servo pins. For the 7th row, you have the choice to route CH7 or A2 (to be 100% compatible with D6FR). It is done by a solder bridge on under pcb side. The are also A2, A3, A4, CH7 and CH8 pads on the underside of the pcb. Another solder bridge can be used to route antennas selection info to A4 to perform in flight monitoring via logs (what I will do on the first flight as I am quite curious :-) ).
The size of the pcb is 42 x 21mm.

! Mandatory update of Gerber file on 1st of November. !

New update on 3rd of November: capacitors 0201 replaced by 0402, routing optimization and silk screen prints updated/improved.

Didier
Last edited by Didier Lanot; Nov 04, 2019 at 04:39 PM.
Oct 30, 2019, 04:41 AM
Registered User
Now the 8CH. I forgot to mention that I added 2 pads close to servos connector in order to solder a power supply cable if you use 7/8 servos and avoid a Y cable. It is applicable to both rx.

Differences with 7CH: 7 channels are routed to servos connector. You have the choice for the 8th row to have CH8 or A2 (like 7CH Rx). Same story for antenna selection info / A4.

A2, A3 and A4 are available via the 3pin picoblade connector (pitch 1.25mm). There is also a pad for CH8.

The size of the pcb is 42 x 23mm.

Didier

Nota: all comments are welcomed !!!

I will order the pcb by end of week as I am optmizing the pcb surface by adding other gerber on it (not rx :-) ). If you are interested, I can provide a single Gerber file with both rx on the same 5x5 pcb. You will just have to cut them after.

! Mandatory update of Gerber file on 1st of November !

New update on 3rd of November: new connector 3 pin picoblade with VCC, GND and either A4 or SBUS. Improved layout, 0201 capacitors replaced by 0402 and updated silk screen prints. No more space for another connector !!!
Last edited by Didier Lanot; Feb 12, 2020 at 12:37 PM.
Oct 30, 2019, 04:42 AM
Flying a Chipmunk in Portugal
jhsa's Avatar
Nice.. But one thing I don't understand is why do you downgrade a receiver that has 10 times more features than the D6FR, just to look like it, and to have the same very few features as the D6FR?
If you needed to make the receiver very small to fit in a tiny model, I would undertand, but the D6FR is not that much smaller than the current designs of the DIY receiver.
If the D6FR had the same features would probably be about the same size.
And by the way, if you don't bring out the PWM pins at least to pads, you won't be able to change receiver modes, as you can see on my video above. And you need all 8 pins if you ever want to use this receiver with the D8 protocol.

I build this receiver exactly fot its capabilities, Downgrade it would never cross my mind.


Joćo
Oct 30, 2019, 06:04 AM
Registered User
Quote:
Originally Posted by jhsa
Nice.. But one thing I don't understand is why do you downgrade a receiver that has 10 times more features than the D6FR, just to look like it, and to have the same very few features as the D6FR?
If you needed to make the receiver very small to fit in a tiny model, I would undertand, but the D6FR is not that much smaller than the current designs of the DIY receiver.
If the D6FR had the same features would probably be about the same size.
And by the way, if you don't bring out the PWM pins at least to pads, you won't be able to change receiver modes, as you can see on my video above. And you need all 8 pins if you ever want to use this receiver with the D8 protocol.

I build this receiver exactly fot its capabilities, Downgrade it would never cross my mind.


Joćo
Let's try to explain my strange choice ;-) which corresponds to my needs.

I will move my X10S to the new internal module that does not support any more the D8; then I have to move to D16; that the baseline... I can buy others RX6R but I prefer to build them myself if I can because what I don't like on RX6R is the fact that if you use 6 servos, you have to make some soldering or Y cable to supply the whole (what I already done)... And Rx8R is too big + lacking Ax voltage measurement (I know, I can add an openxsensor but if I can have all in one, it is better; less wiring).

First of all, each of my models have their own dedicated rx, so no swap as long as the model is alive :-). That's why I have a lot of rx...
Then, I need to change the D6FR that is in my Ahi. It fits perfectly and I don't want to cut foam or modify the existing wiring => I need a fit/form/function D16 rx; no more. Then the 7ch design is the solution and it has anyway ALL functions because A2 to A4 are acessibles as well as the 8 channels via pads => I will configure it once only so if I need for exemple to bridge ch8 with another one, I can solder a temporary wire. I kept anyway SBUS and SPort specific connector which I use very few. I plan to build only one 7ch rx. If I had the possibility to change D6FR firmware to D16, it would have been perfect.
Are they more than 8CH pwm connections (I would not be surprised that I forgot one or more) ? if not, all are accessibles at least via pads. And on top, I don't see the benefit to use it in D8 mode whereas it works in D16...
If I want really tiny, then I use a RX6R. But I don't see why I should put a zillion of pins on my rx whereas I will never use them. I always connect all my grounds, so no need for specific GND pin for Ax; the less wiring, the less failures! It is no at all a "functionnality" but a wiring philosophy. So, I don't see what functionnality is missing versus analog inputs and 3 voltage inputs are more than I will ever use; so A1 is nice for Rx voltage.
I don't use SBUS at all (I use Fport instead with very small Frsky rx); I would like to do such to drive an esc but for the time being, BL_Heli is not working with SBUS... And for Smartport, I use it only with 2 varios but 7ch and 8ch have the connection via Picoblade. Is using Picoblade connectors a reduced functionnality for you?
So, except if I missed something, there is no downgrade of functions in the 2 designs.

I am building/flying Rc for more than 40 years (there was no foamy at that time) and I allways liked to do diy (when I have time and knowledge); it is, from my point of view, one of the most exciting part of this hobby!!!

Didier


Quick Reply
Message:
Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
New Product Frsky XM+ Micro D16 SBUS Full Range Receiver Up to 16CH kremerFPV Radios 102 Aug 06, 2020 01:45 AM
Help! frsky X8r no way to bind in D16 mode bax.91 Radios 3 May 21, 2019 02:22 PM
Discussion FrSky D16 protocol (X series TX/RX compatible) jry DIY Electronics 226 Jan 11, 2019 07:42 AM
Discussion Is the FrSky DHT DIY conversion kit compatible with x series receivers? uyqah Radios 1 Sep 10, 2015 09:36 AM