A full NRF24L01 FHSS Single Channel outfit :-)

Any old or new electronic projects on the go
User avatar
Phil_G
Posts: 597
Joined: 15 Feb 2018, 23:32
Contact:

A full NRF24L01 FHSS Single Channel outfit :-)

Post by Phil_G »

The NRF24 is quite a broad-band device, and Pete has posted a reminder that in the UK only NRF channels 1 to 82 are actually within our official 2.4ghz allocation. If you'd prefer to be 'legal' then limit your choice of channels to between 1 and 82 in the UK and for other countries check your allocations! Physically the project works fine using any of the NRF channels, this is purely a 'conformance' thing.

Edit: Range-tested out of sight & flown many times now
Edit: NRF board swapped for a screened version - its the same pin for pin, no wiring changes.
Edit: Moving the button input to D0 means a standard S/C button harness can be plugged into what was the RF module header of a modded 'Strong' board, 3 pins - battery pos, neg and button. This is how my OS Pixie is done. http://mode-zero.uk/viewtopic.php?f=42& ... ixie#p8332
Here with its screened NRF: http://mode-zero.uk/viewtopic.php?f=42& ... ixie#p8332


This was initially just a quick hack to test the RF-Nano, but I love my S/C gear so I've since done a more functional, usable single-channel emulation encoder using full FHSS for either the RF-Nano or a separate Arduino and NRF24L01 module Image
All of the RF bits are the most-recent timer2 code taken from the propo FHSS project so it works to the same receivers, based on the RF-Nano, or Promini with NRF24L01, etc.

Like the propo set it uses sixteen RF channels well spread through the band and has Single-Channel compound emulation giving rudder, kick-up elevator and quick-blip throttle at either of two selectable compound keying speeds (similar difference to the Elmic Commander vs Elmic Conquest), also does sequential escapement emulation, has an inactivity alarm, servo reversing, Vtail & Elevon mixers, minute-minder, travel adjust (rates) with 'minimum' set for torque-rods - rudder & elevator throws are governed either by a pot on A7, or a link which gives a fixed 50% for torque-rods. It has the 'button follower' channel for driving a genuine escapement via a channel switch.

The quick-blip throttle is a cyclic 4-position 'off-half-full-half' just like the PIC S/C encoder, and of course the two 'half' throttle positions dont have to be 'half' and dont even have to be the same.
I havent done a motor run timer for sequential yet but I might add that, with manual trigger & ramp-up, maybe the time could be set by a pot on A6, say 1 to 5 mins? Does anyone use sequential? Image
(thinking about it, thats silly - if theres a pot it might as well be a throttle pot!)

Connections are:
A7 = Rates (servo travel) pot or link (link suits torque-rod installations)
A0 = inactivity buzzer pin on D14 (the usual buffered DC buzzer)
A1 = optional set/clear minute-minder button
D2 = compound or sequential select
D3 = optional compound emulation speed normal/fast (Elmic Commander vs Compact)
D4 = rudder servo reverse
D5 = kick-up elevator servo reverse
D6 = optional mixer 50:50 pin
D7 = optional mixer 75:25 pin
D8 = 'tone' pushbutton for s/c compound or sequential

The options D2 to D7 are all on adjacent pins so can be on a dipswitch. Or can be ignored!
The NRF24L01 connections D9-D13 are as per the 4ch set, and for a boat a pair of RF Nanos makes it really easy as these connections are already made. For flying I'll use a high-power module and its associated regulator board.

One tip - I was using an ebay redboard with an RF-Nano for development and the two 3v3 regulators dont get along at all well. They're obviously slightly different voltages and the contention caused the RFNano to get uncomfortably hot. After removing the regulator from the redboard all was well and the modified redboard is a really convenient way to experiment with the RF-Nano Image







Link and relink time is almost instant, the 'power-up' delay you see in the video is because on the development sets I still have the bootloader enabled. Without the bootloader it links and re-links immediately.

I've recently re-arranged the channel order to Futaba AETR and just noticed in the video that the "set-failsafe" wiggle is on elevator and throttle - this is in the receiver code and obviously should be rudder & elevator, the rx code is corrected and re-uploaded to the propo zip file.

Posting progress in real time is a nightmare :D
Code is at the foot of this post.


Just to set the scene, here's the original (pre- bells & whistles) experiment (now obsolete):

... a complete single-channel transmitter in a chip (well, on a single 'component' - the RFnano)



Another RFnano can also act as the receiver - ignore my test-cluge-receiver, see Tobe's RFnano receiver.
No development at all, just dropped my existing sketch onto it, other than you have to put CE on D10 & & CSN on D9, cos its hard-wired that way. This is just a S/C demo, of course it will take the full 'lockdown project' encoder - or any of the NRF developments currently under way from mode-zero members - its just a Nano with an on-board NRF24L01.

Note that if you want to program the RF-Nano via USB, the bootloader is a later version, and the older Arduino IDE doesnt see it. Newer IDEs see it ok. Or you can upload the older bootloader as I did - I have a morbid fear of updating the IDE after losing all the libraries and USBASP drivers etc... twice... :D
The RFnanos are from AliExpress for an unbelievable £3 each: https://www.aliexpress.com/item/32980796969.html

I can imagine loads of applications for this new toy, the RF-Nano... :-)

Receiver:

For the receiver the RF-Nano is the easiest and neatest option. This S/C version uses exactly the same receiver (and receiver code) as the propo set - its just a case of adding servo wires (and a decoupling capacitor on the supply). Here's a diagram, there are a couple of discussion posts either side:
http://mode-zero.uk/viewtopic.php?f=42& ... t=30#p8154

Here's the current code for the full FHSS S/C Emulation set, tx and rx:
Attachments
Enc_v5_nrf24_250k_5ms_fhss_timer2_sc_button_tx.ino
Full FHSS Single-Channel emulation transmitter
(10.25 KiB) Downloaded 335 times
User avatar
tiptipflyer
Posts: 393
Joined: 16 Feb 2018, 22:49
Location: Germany

A full NRF24L01 FHSS Single Channel outfit :-)

Post by tiptipflyer »

Thanks for posting Phil,
I will use it in one of my next builds.
Frank
Tobe
Posts: 665
Joined: 16 Feb 2018, 06:19
Location: Varberg or Stockholm, Sweden

Re: A full NRF24L01 FHSS Single Channel outfit :-)

Post by Tobe »

Brilliant as usual! My hat off
Cheers,

Tobe
User avatar
Wayne_H
Posts: 808
Joined: 17 Feb 2018, 05:26
Location: Temora, NSW. Australia
Contact:

Re: A full NRF24L01 FHSS Single Channel outfit :-)

Post by Wayne_H »

Tobe wrote: 06 Jun 2020, 20:01 Brilliant as usual! My hat off
Here here!👏👏
Cheers,

Wayne
Once a Retrobate, always a Retrobate............ ;)
User avatar
Shaun
Posts: 1049
Joined: 15 Feb 2018, 21:49
Location: West Yorkshire

Re: A full NRF24L01 FHSS Single Channel outfit :-)

Post by Shaun »

Brilliant pal. 👍
User avatar
RON
Site Admin
Posts: 613
Joined: 12 Jun 2017, 15:09
Location: Stokesley North Yorkshire

Re: A full NRF24L01 FHSS Single Channel outfit :-)

Post by RON »

Simply Superb Phil,

Ron
G0MBV Class A Radio Amateur, North Yorkshire
User avatar
_AL_
Posts: 160
Joined: 17 Feb 2018, 01:09
Location: Sydney Australia

Re: A full NRF24L01 FHSS Single Channel outfit :-)

Post by _AL_ »

Brilliant Phil.

Al
glyn
Posts: 50
Joined: 15 Jun 2017, 18:22

Re: A full NRF24L01 FHSS Single Channel outfit :-)

Post by glyn »

Wow! just amazing Phil...

Glyn
User avatar
Phil_G
Posts: 597
Joined: 15 Feb 2018, 23:32
Contact:

Re: A full NRF24L01 FHSS Single Channel outfit :-)

Post by Phil_G »

Theres just enough room in a Pixie Mk2 for a Strong board without the headers, the only problem I can see is the original aerial hole cant be used as its under the microswitch, its a shame but I'll have to drill & mount it on the opposite side. The tx module uses one of Franks tiny 3v3 regulators standing on the 3v3 and gnd header pins, with the usual 100uF tantalum across them:


IMG_20200619_171925_195.JPG

IMG_20200619_185324_636.JPG


Done, works great, cost about a tenner including a receiver :D

IMG_20200619_224444_531.JPG

IMG_20200619_204622_114.JPG



Demo: Simultaneous use of a common configuration :D



Remember the furore when Futaba accidentally released a few transmitters with the same GUID? That was a Bad Thing, but doing the same thing intentionally can be useful within your own fleet - it means you can fly any model with any of your transmitters, and the instant linkup means you can even change transmitters mid-flight. But what happens if there is an overlap, where two transmitters with the same configuration are on at the same time? Whilst it maintains synchronisation, the receiver is unaffected by the second transmitter. Inevitably at some point a few packets will be missed are it will re-sync, at which point its a 50:50 chance of which transmitter it will lock to, and you wouldnt intentionally stretch the period when both transmitters are on. But for a brief overlap, there is no conflict, no failsafe, no magic smoke, just well-behaved continuity.

Whilst I might choose to set up my transmitters with either a common configuration, or have them all different - yours can also be all the same or all different, BUT all of your configurations must of course be different to mine. This is why the actual config I use is never included in published code!
Cheers
Phil

PS since making the video, my 4-way dipswitches have arrived so its easy to switch between sequential and compound, fast or normal, reversing etc, from inside the Pixie

PPS the Pixie has since had its NRF board swapped for the screened version, and has flown many times in this guise.
Tobe
Posts: 665
Joined: 16 Feb 2018, 06:19
Location: Varberg or Stockholm, Sweden

Re: A full NRF24L01 FHSS Single Channel outfit :-)

Post by Tobe »

I wouldn't expect anything else...
Cheers,

Tobe
Post Reply