Radio Control from scratch !

Go To Last Post
14 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

​Hismiley

(sorry, i don't write&speak english very well, i'm french)

 

MODULE code, RADIO CONTROL code, and RADIO MODEL QUADCOPTER code are included as attachments.

 

I created an R/C Radio Control from scratch with my own programming system  ​MODULE and my own electronics (so hardware and software, MODULE is independent system).

 

This programming system MODULE was written in 3 years from the pure C++ language (without any library, not arduino, not avr, not standard c++ library like stdio.h, stdlib.h, math.h, etc...).

 

Electronics was made&designed with prototyping, and final PCB with Kicad software on linux ubuntu, with my own electronics component library for Kicad.

 

 

The characteristics of the radio control:

- MODULABLE M32 programmable controller with the ATmega1284P microcontroller.
- 2.4Ghz radio transmitter / receiver (component nRF24L01 +, range 1km approximately).

- Bi-directional communication.

- Antenna Clover omnidirectional 3 branches.

- Communication by 32-bit frames.

- Digital display with MAX7219.

- Report Buzzer.

- Fault-tolerant system (faile-safe) sent to the model on 6 bits (0 to 63).

- 1 main menu + 1 settings menu.

- Low battery voltage setting of the model (from 0V to 100V).

- Setting of a time chronometer (from 0s to 3600s).

- No model memory (the memory is located in the models).

- Ability to copy settings from one model to another very easily.

- Up to 16 custom settings sent by the model.

- Lock the menus (no more possible settings or switch off the radio control).

- Display of the battery voltage of the radio control.

- Alarm (visual and audible) low battery level of the radio control.

- Display of the battery voltage of the model.

- Alarm (visual and audible) Low battery level of the model (if set).

- Display of a time chronometer (time of use of the model / other).

- Display trims (lock and reset to 0 possible by the selection button).

- Display custom telemetry.

- Display of custom settings.

- Menu for updating the parameters / settings of the model.

- Switching the radio control or the model on or off in any order.

- NIMH battery (+ 1.2V per cell) 8S 600mAh (+ 9.6V).

- Battery charging socket (XT30).

- Made with Aluminum, Stainless steel, wood (5mm plywood), and Ertalon.

- Dimensions: 214mm x 204mm x 117mm.

 

The electromechanical interface between man and machine:
- 2 analog sticks (1 gas / roll + 1 pitch / yaw) on 10 bits (0 to 1023).

- 4 trims switches (3 positions) on 2 bits each (0 to 2).

- 1 motor / other switch (2 positions) to 1 bit (0 to 1).

- 3 auxiliary switches (3 positions) on 2 bits each (0 to 2).

- 1 auxiliary rotary knob on 10 bits (0 to 1023).

- 1 rotary menu selection button on 10 bits (0 to 1023).

- 1 push-button for selecting the menu (2 positions, including 1 momentary) on 1 bit (0 to 1).

- 1 power switch held on / off (2 positions).

 

 

The concept of this radio control:

Since the early days when I have been piloting radio-controlled models in aeromodelling associations until today, I have often wondered and in view of the previous and current advances in embedded electronics : But why do commercial radio controls have model memories? The model memories allow you to retain the settings relating to a model in the memory of the radio control.

 

In this regard I would cite only the example of a friend in the field of modeling without naming it, which inadvertently makes a fairly regular mistake of model memory (it robs with many things). As a result it often happens to crush its settings, or to crash its model simply in the physical sense of the term!

 

In fact, this "gap" in model memories in modern radio controls is historically rooted in the very design of the first radio transmitters / receivers. Indeed, the first radiocommands were content merely to be transmitter of information, and the model being simply a receiver. In this situation (unidirectional), it is easy to understand that the model is always silent.

 

Later, the designers and various industrialists decided to add a communication of the model to the radio control, on a distinct electronic circuit and with an additional radio antenna on the model and the radio control. It is an air / ground return that has been called telemetry (related to telemetry in the early days of the space conquest until today).

 

The advances in miniaturization of the components now make it possible to have a transmitter and a receiver in the same chip, which uses the same radio antenna to communicate, these systems are called tranceivers.

 

The concept that I develop here allows to explain to you the very idea of my radio control, it has indeed no memory models, wishing to go to the end of my logic, it is the model that contains memory!

 

This simple idea allows many things, including the fact that it is the model that sends the custom settings to the remote control, which originally has a settings menu and settings almost empty. The radio control is then provided with customized parameters relating to the model that is currently communicating with it.

It also features the display of the battery voltage of the model in real time, and a telemetry customized according to the model. Once this notion is understood, everything is then possible. My radio control has a maximum of 16 parameters customized by the model, this is largely sufficient because by definition, they are specific to the model under consideration.

 

Done the endless settings and menus (often mostly unused) in commercial radio controls! In what I propose here, you have the settings only necessary for the model implemented, which greatly facilitates its use in the flying field!

 

 

 

 

​If you have other questions about my project, you can go to this project address (in French).

I explain, for example, "copy from one model to another", or "speed of communication" and security, which may interest you!

 

 

Thanks for reading my post, do not hesitate if you have any comments, questions or suggestionssmiley

 

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Interesting project, looks very nice.

(However, in my brief scan of the files, I noticed only one comment, and nothing explaining what each function was to accomplish.)

David (aka frog_jr)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

It's certainly an accomplishment but as someone who previously used FM PPM and now DSS is there not a concern about safety in all this? What are you doing about channel interference on the radio link? Back in the old FM days we each had to have different crystals and a peg on a board to say who was active on channel N. Then Digital Spread Spectrum came along to just hop to another (unused) channel when it detected other activity on a selected channel. So how does this implement channel safety?

Last Edited: Fri. Aug 18, 2017 - 01:38 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for your comments wink

 

For security question, my Nrf24l01p.h class have 32 bits key.

I think that if it is chosen intelligently (make different paterns unlikely to be obtained with random key generation for example), there is 1 chance on 2^32 to have a problem within 1km radius.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You are getting 1Km range with the Nrf24l01p?

 

Impressive.

 

JIm

If you want a career with a known path - become an undertaker. Dead people don't sue! - Kartman

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, maybe he's just saying/thinking "what is the range I need to consider for my pseudo-unique keys?". If the range of the Nrf2401 is actually, say, 250 meters and he's picking 1 km then he is erring on the safe side.

Happy 75th anniversary to one of the best movies ever made! Rick Blane [Bogart]: "Of all the gin joints, in all the towns, in all the world, she walks into mine."

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

Last Edited: Fri. Aug 18, 2017 - 02:52 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for your questions,

 

my nRF24L01+ pcb is accompanied with boost circuit, and shield connected to ground.

With stick antenna it is tested with >1km range, i'm not use with antenna, I use cloverleaf with 3 and 4 (legs, spindle, ?), it's better for dB (noise, etc...).

 

Without antenna (with only connector lol) and nRF24L01+ power register = high, this transmit/receive already far ! With stick antenna and nRF24L01+ power register = low, It crosses several concrete walls of my home.

 

In comparison, my FUTABA T12 FG radio control did not allow that! wink

 

 

Last Edited: Fri. Aug 18, 2017 - 03:12 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Impressive!

274,207,281-1 The largest known Mersenne Prime

Measure twice, cry, go back to the hardware store

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Nice job!

 

Impressive project.

 

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I tested 80 meters max range with this situation:

(indoor cave to outdoor)

tranceiver1 // 2 separate concrete walls (indoor) + hill of land (outdoor) + tree hedge 2.5m tall (outdoor) + row of trees 4m tall (outdoor) // tranceiver2

<------------------------------------------ 80 meters ------------------------------------------>

 

nRF24L01+: 1Mbps + acknowledge + cloverleaf antenna

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Impressive project.

 

I sort of dismissed the nRF24L01+ partly due to bad range.

then I saw some range contests with this device on youtube where they can get up to 12km.

but you need 2 half meter long yagi's to do that and good alignment.
 

Paul van der Hoeven.
Bunch of old projects with AVR's:
http://www.hoevendesign.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've had excellent results by using an nRF24L01+ with a PA/LNA on only one end.  The other end is still the el-cheapo PCB antenna, out of necessity for space and power restrictions.  Were I to have a PA/LNA on both ends my range would nearly double.

 

In the end since it's 2.4 GHz you can only expect so much before atmospheric water absorption (or vegetation) kills you, unless you take extraordinary measures.  The attraction is the fact that its a world-wide licence-exempt (for low power) ISM band, although boosting range with high-gain antennas on the transmitter to achieve the quoted ranges contravenes even licence-exempt regulations in many jurisdictions.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

Last Edited: Mon. Aug 28, 2017 - 03:24 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This afternoon I performed new nRF24L01+ test (more or less with some trees).

 

 

The test is as follows: nRF A sends the data to nRF B (time in ms), nRF A requests an acknowledgment, nRF B sends the retrieved data (ms time) to nRF A, nRF B asks for an acknowledgment reception. A display the received data (ms time).

The nRF B remained in the trunk of my car (open), at 442 meters (the maximum that I could go on this ground) I could not even see the car (because of the convex terrain), I turn 360 degrees on the spot, there is no radio shadow zone, except when I passes behind a bush, big tree, for example. That was in emission power maxi.

 

 

The first test I did was in the same conditions but in emission power mini, and at this distance there are 2 zones of radio shadows that appear with the clover antennas (7dB) that I use, one goes some dead zone, for example at 180 degrees by 20 to 30 degrees of angle and the other at 360 degrees over a portion also of 20 to 30 degrees too. At mini power it is really not bad, it would mean that two antennas should be 90 degrees one on the other on the mounting A as B to ensure the connection in all possible orientations.

 

With a 8 bits CRC, I had 3 or 4 times my 32-bit data received is 0b11111111111111111111111111111111 (this is a bit normal with only 256 possible values of CRC), so I put a CRC on 16 bits, and there are enough possibilities to avoid having any CRC erroneous. So I updated my library with this CRC configured on 16 bits on this nRF24L01 +. (http://sylvainmahe.xyz/download/cpp/module.zip)

 

In short, imagine driving a model reduced to 1 meter from the ground to 442 meters of sight distance from the trunk of his car, in my opinion in a true ground / air situation the range must be very large! And the 1km advertised on plenty of websites is true ! laugh

Last Edited: Mon. Sep 4, 2017 - 06:31 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The quadcopter is now in version for 3D flight ! wink

See the article I modified with the new characteristics of the bee: http://sylvainmahe.site/projectQuadcopter.html

 

- MODULABLE M32 programmable controller with the ATmega644P microcontroller.
- 2.4GHz radio transmitter / receiver (component nRF24L01 +).
- Bi-directionnal communication.
- Cloverleaf Antenna omnidirectional (gain 7dBm).
- Communication by 32-bit frames.
- MPU6050 Gyroscope.
- Report Buzzer.
- Fault-tolerant system (fail-safe) sent by the radio control to 6 bits (0 to 63).
- Motors controllers KISS ESC 2-5S 24A Race Edition.
- TIGER MOTORS MN2206 2000kV.
- Graupner 3D propellers 6" x 3".
- Lithium / Polymer Accumulator TURNIGY 4S 2200mAh (+ 14.8V).
- Voltage of the battery sent to the radio control on 10 bits (0 to 1023).
- Switching the model or radio control on/off in any order.
- Chassis made of aluminum tubes 10mm x 12mm.
- Motors to motors axis: 372mm x 372mm.

 

The new code of my quadcopter is available as an attachment (& MODULE because I slightly modified a mathematical function).

The new code of my radio control will be available soon (when I have more test flights).

 

News characteristics of my radio control (function curve + invert channel):

- MODULABLE M32 programmable controller with the ATmega1284P microcontroller.
- 2.4GHz radio transmitter / receiver (component nRF24L01 +).
- Bi-directionnal communication.
- Cloverleaf Antenna omnidirectional (gain 7dBm).
- Communication by 32-bit frames.
- Digital display with MAX7219 controller.
- Report Buzzer.
- Fault-tolerant system (fail-safe) sent to the model on 6 bits (0 to 63).
- 1 main menu + 1 settings menu.
- No model memory (the memory is located in the models).
- Ability to copy settings from one model to another very easily.
- 15 default settings sent by the model.
- Trims (around the neutral) of the gas / pitch / roll / yaw.
- Setting of an alarm (visual and audible) Low battery voltage of the model (from 0V to 100V).
- Setting of an alarm (visual and audible) timer / stopwatch (from 0s to 3600s).
- Reversal adjustment of the gas / pitch / roll / yaw.
- Curve adjustment of the gas / pitch /roll / yaw.

- Up to 16 additional custom settings sent by the model.
- 4 parameters / default settings specific to the radio control.
- Calibration of the stick potentiometers (if replacement / other).
- Locking the menus (no more possible settings or switching off the radio control).
- Radio control battery voltage displayed.
- Model battery voltage displayed.
- Timer / stopwatch displayed (time of use of the model / other).
- Trims displayed (lock and reset to 0 possible by the selection button).
- Display of a custom telemetry.
- Display of settings / default and custom settings.
- Menu for updating the settings / model settings.
- Menu for saving the settings specific to the radio control.
- Switching the radio control or the model on or off in any order.
- NIMH battery (+ 1.2V per cell) 8S 600mAh (+ 9.6V).
- Battery charging socket (XT30).
- Enclosure made of Aluminum, Stainless steel, wood (5mm plywood), and Ertalon.
- Dimensions: 214mm x 204mm x 117mm.

 

wink

Attachment(s):