UK OpenLRS Guide and Future Development

Started by thundead, August 31, 2011, 02:07:22 AM

Previous topic - Next topic

thundead

UP TO DATE GUIDE IN 2nd POST. Cheers.


Hey Everyone,

As you know, the OpenLRS system is an open source long range system which also features telemetry.
As far as I know, the ezUHF and OpenLRS are the only legal long range systems in the UK.


I will constantly try to incorporate new stuff to the system in order to make it a complete FPV system  ;D
Currently working on adding antenna tracker capability to the system.


As promised, here is my Crash Course Guide for the "UK version" of the OpenLRS system.
For some reason I can't attach the guide so here is the link for now:
http://www.multiupload.com/20GX6Q0F6J

I tried to tidy the code a bit. Removed (hopefully) all my custom code so should work ok.

---------------------------------------------------------------------------------------------------
FIRMWARE MODS
---------------------------------------------------------------------------------------------------
Disclaimer: This mods have or have not been tested/ flown yet Use at your own risk!
-----------------

Super Simple RX Firmware

As the title says, this is a ultra stripped down version of the 1.10 UK firmware uploaded by Nigel (Devonian) on the Flytron repo.

Features:
- Uni-Directional/ NO TELEMETRY! (should get better range ?)
- Removed sensors and wii related stuff

-Proper RSSI Out :D - 0 to 2.6v nice and fluent RSSI output - TESTED!

- fw ahs been bench tested( left tx/rx on for 1h to see if it gets locks etc)

-------------------------------

thUndead's RSSI MOD

this section will show you how to add my RSSI MOD into your own firmware :D

Add this bits of code into your OpenLRS_Rx.pde file. My code is in bold. the rest is to show you where to add it:
-------------------------------------------------------------------------------------
                               failsafe_mode = 1; // Activate failsafe mode
                               load_failsafe_values(); // Load Failsafe positions from EEPROM
                               Direct_Servo_Drive(); // Set directly the channels form Servo buffer
                               Red_LED_ON;
//***************************************
//*   thUndead's RSSI MOD
//*   info: when packet lost, rssi voltage goes to 0
analogWrite(RSSI_OUT,0); // Convert the RSSı value to PWM signal  
//***************************************

                               }
-------------------------------------------------------------------------------------

-------------------------------------------------------------------------------------
                     last_hopping_time = time;
                             
//*   thUndead's RSSI MOD

//*   info: when fail-safe ON, rssi voltage goes to 0
analogWrite(RSSI_OUT,0); // Convert the RSSı value to PWM signal  
//***************************************

                              #if (FREQUENCY_HOPPING==1)
                                Hopping(); //Hop to the next frequency
                              #endif  
-------------------------------------------------------------------------------------

-------------------------------------------------------------------------------------
   // Rx_RSSI = _spi_read(0x26); // Read the RSSI value
                         
                               
                              //  analogWrite(RSSI_OUT,Rx_RSSI); // Convert the RSSı value to PWM signal

                               //***************************************
                               //*   thUndead's RSSI MOD
                               //*   info: RSSI voltage according to avg rssi value :D
                               
                                Rx_RSSI = _spi_read(0x26); // Read the RSSI value
                                rssicounter++;  //counter which resets after getting to 41

                                if (rssicounter <=40) rssipwm= rssipwm+ Rx_RSSI ; //adds values into temp buffer
                                else rssicounter =0;
                             
                                if (rssicounter ==40)
                                {
                                rssipwm = rssipwm / 40; // averege 40 rssi values to get stable reading
                                rssibuf = map(rssipwm,40,120,10,250);  //map value for pwm: MAX = 2.6v bad rssi unver 1 v
                                analogWrite(RSSI_OUT,rssibuf);    //write the RSSI voltage

                                #if defined(Serial_RSSI)    
                                Serial.print("RSSI:");      //some debugging
                                 //  Serial.println(rssipwm);
                                Serial.println(rssipwm);
                                Serial.println(rssibuf);
                                #endif  
                               
                                }
                               
                               //***************************************      


-------------------------------------------------------------------------------------   

now go onto your config.h file and add this in the variable section:

//***************************************
//*   thUndead's RSSI MOD
//*   info: variable used for RSSI MOD
unsigned int rssipwm,rssibuf = 0;
unsigned short rssicounter = 0;
//***************************************


------------------------------------------------------------------------------------
TUNING THE RSSI:

uncomment #define serial_RSSI and check the first value (mine gives me about 100-120 with tx close )

modifi the value in bold accordingly:
rssibuf = map(rssipwm,40,120,10,250);  

-------------------------------------


I've attached the unmodified UK firmware with the RSSI mod :)
      
Any questions, suggestions, mistakes are welcomed   :thanx!: :flying:


Cheers,
Mihai.


-----------------
ATTACHMENTS
-----------------

can't upload files in my post for some reason so here are some links...

UK openLRS FW - ORIGINAL+RSSI MOD - http://www.multiupload.com/LV9OCONUD0
SIMPLE Stripped FW - http://www.multiupload.com/REUWN7Z3FI
If you like my work feel free to contribuite to my Pringles & Red Bull Fund :) http://forum.flytron.

thundead

#1
UK OpenLRS Setup Guide
--------------------------------


Introduction

As we know, the UK legal frequency for long range RC control is 459 Mhz. The only legal UHF devices I know are the ezUHF (great piece of kit but very £££) and the newly found OpenLRS, an open source RC link from our Turkish friends, Flytron.com.
This is a crash course guide to get you start using your new and shiny LRS system 
Please post any questions  regarding this guide (maybe I missed something haha) in the UK OpenLRS Guide and Future Development thread found here: http://www.fpvuk.org/forum/index.php?board=9.0

STUFF YOU NEED:
1.   OpenLRS system  - get it from www.Flytron.com
2.   FTDI Usb adaptor –
     •   http://www.flytron.com/multicopter-parts/117-3v-ftdi-for-arduino.html
     •   http://www.skpang.co.uk/catalog/ftdi-cable-5v-p-319.html
     •   Google is our friend :D
3.   4 wire cable  - I used male pin headers on my LRS, FTDI cable etc and made myself a 4 wire female to female cable (See pic)
4.   Soldering Iron + basic soldering skills – needed for header soldering on your Rx, Tx
5.   Arduino SDK - http://www.arduino.cc/en/Main/Software
6.   Custom OpenLRS Firmwarehttp://www.multiupload.com/EU1ZF0Q9X6
7.   20 mins of your time :)




Preparing the Arduino Environment
After unzipping the Arduino SDK, connect your FTDI cable to ur PC and let the drivers install. If for some reason (Bill Gates ?) windows doesn't find drivers, select manual install and navigate in the Arduino SDK folder and you will find needed drivers there.
In the SDK, selecd the default board as shown in the picture below




After that, select yout FTDI cable's Serial Port. If you see multiple ports listed, go into Device Manager – Com ports – Serial device something.




Uploading the code.
Now it's time to connect our OpenLRS and load up our custom firmware.
Let's start with the Receiver Board.
1.   Load up the OpenLRS_RX.pde in the arduino SDK.
2.   Just to be safer, be sure to change the HEADER to whatever you want:




So for example change from 'O', 'L', 'R', 'S' to  'L', 'M', 'A', 'O'.
BE SURE TO CHANGE THIS IN BOTH THE RX AND TX FIRMWARE !!!!!

3.   Click  on the Verify button (the play button) to compile your code. This should go without any errors.
4.   Connect an ESC to your RX. Any channel will do . I usually use the throttle channel. BE SURE TO CONNECT THE SERVO WIRE CORRECTLY!!! (from top to bottom: WHITE ; RED ; BLACK)
5.   Now connect your FTDI adapter and RX as shown in the CONNECTIONS section.
6.   Have you LIPO close.
7.   READ THE NEXT THREE STEPT CAREFULLY
8.   Now press the UPLOAD button (button with arrow pointing right)
9.   Wait for the "Binary sketch size bla bla" message to appear on the bottom of the SDK.
10.   Now Connect your Lipo.
11.   If you did all correctly, the LEDs on the FTDI adapter should go nuts.
12.   You're done with the RX.

Now follow exactly the same steps for the TX module: Don't forget to check the connection DIAGRAM!! TX pins are different from the RX!!!! also you will load OpenLRS_TX.pde onto the transmitter module;  Instead of connecting a LIPO, you will power the TX on when the "Binary sketch" message appears.
     Now  add some servos to the RX and see if everything is working properly.
  If everything works, congrats! You now have a legal long range system muhaha  :o

CONNECTION DIAGRAMS
Basic Rule of thumb:
•   TX pin always to RX pin
•   RX pin always to TX pin
•   GND always to GND
•   DO NOT CONNECT THE V+ WIRE !





Modified my TX for easy port access  :cooldance:
vvvvvvvvvvvvvvvvvvv




Arduino Buttons Explained



If you like my work feel free to contribuite to my Pringles & Red Bull Fund :) http://forum.flytron.

thundead

#2
Project Poor Man's openLRS Antenna Tracker

Well to put it short, student + FPV equipment =  :toiletbang:
Buut, me knows programming muhaha  ;D
And building a 50quid DIY antenna tracker sounds pretty good.
Also the openLRS has telemetry so why not give it a shot.



-------------------------
Components used:
Arduino Mega 2560
2x Cheapo Turnigy Servos
Patch antenna (11 dbi I think)
Flytron GPS Module
2x Xbee for serial data from TX to Mega board


-------------------------
Currently Working:

- GPS latitude, longitude, altitude over telemetry protocol with max precision
- Pan/tilt apparently working good (bench tested with Google Maps coords)

-------------------------
Under development

- Data from TX to ground station via Xbee
- Add LCD to display info
- Implement voltage sensor (V divider) to display % battery life of video RX/Ground Station
- Button to set Home
- Go from breadbord and tonz of wires to DIY PCB
-------------------------

Will release code , PCB layout(mos likely Eagle file) etc when I have a usable version.

In the meantime I'm open to suggestions, adding additional features as I go   :)
Also any support for my currently empty Beer/Project Fund are more than welcomed  :pint:
If you like my work feel free to contribuite to my Pringles & Red Bull Fund :) http://forum.flytron.

thundead

#3
GEEK Section - Technical stuff

This post will be updated as the project progresses.

So far:

GPS Telemetry

When it comes to gps coordinates, we need very accurate data.

NMEA stream is processed using the TinyGps library

Extracted data (latitude, longitude, altitude) is transmitted as 13 bytes encoded float variables:
  4 bytes per parameter + 1 byte for valid data checking = no data loss to rounding, missing decimals etc.
-----------------------------

Pan/Tilt

My current setup uses 2 cheapo 9g servos that get software stretched to 180 degrees.

Current code covers 360 degrees of movement so we shouldn't worry about moving the antenna round when plane passes over.

The way I tried making it work is:
PAN: goes from 0 to 180;
TILT: goes from 0 to 90;

if plane flies over, PAN is reversed and TILT flips the antenna upside down.

EDIT: Video of the pan tilt system
Diy antenna tracker
-----------------------------

DIY PCB for the Mega







-----------------------


SPARE PARTS
http://proto-pic.co.uk/rfm22b-s2-smd-wireless-transceiver/
------------------------
If you like my work feel free to contribuite to my Pringles & Red Bull Fund :) http://forum.flytron.

tone

Excellent guide Mihai! Although I'm still a newbie it's great to know a guide like this exisits when the time comes!

Thanks

simondale

Fantastic!  My OpenLRS, and programmer jobby, have arrived at our office in Yorkshire.  I'm down in Brighton but as soon as the opportunity presents itself I will be getting up there and following your guide in earnest!

Thanks so much for spending the time writing the guide.  That's really appreciated!

All the best

Simon

thundead

Quote from: Capello1986 on August 31, 2011, 01:38:37 PM
I really like the idea of this system but just worried that am not going to be able to get it going or set up 100% :-(.

Is it easy enough?

Martin

If you follow my guide you should be flying in 30 mins or so :)

The only lets say issue I see if soldering the pins but it's no rocket science. Watch the first post for a video showing basic soldering.

Cheers,
Mihai.
If you like my work feel free to contribuite to my Pringles & Red Bull Fund :) http://forum.flytron.

Devonian

#7
Mihai,
Good job on the basic guide.

Would it be worth starting a Google repository for UK only 459MHz firmware(s)?

Either that, or ask Melih (at Flytron) if we could make a sub section on the main Google OLRS site for UK firmware?
http://code.google.com/p/openlrs/downloads/list
Personally, I'd prefer it on the main site.

EDIT
I've asked Melih if it's possible to add a setion on the main Google firmware site for UK basic and development firmware(s).
This will be good for those who want a basic 'load n fly' firmware and those of us who like to experiment/hack ;)
/EDIT

Nigel.
You're only jealous 'cos the voices aren't talking to you  :D

thundead

That's a good idea. let me know what Melih replies and we can start organizing :D

Quote from: Devonian on September 01, 2011, 11:02:52 PM
Mihai,
Good job on the basic guide.

Would it be worth starting a Google repository for UK only 459MHz firmware(s)?

Either that, or ask Melih (at Flytron) if we could make a sub section on the main Google OLRS site for UK firmware?
http://code.google.com/p/openlrs/downloads/list
Personally, I'd prefer it on the main site.

EDIT
I've asked Melih if it's possible to add a setion on the main Google firmware site for UK basic and development firmware(s).
This will be good for those who want a basic 'load n fly' firmware and those of us who like to experiment/hack ;)
/EDIT

Nigel.

If you like my work feel free to contribuite to my Pringles & Red Bull Fund :) http://forum.flytron.

Splashy

I see that the openLRS transmitter has a Futaba connection. Would it work ok on the Trainer port of a Spektrum DX8?

Devonian

I believe so, as OLRS can also be driven from the trainer port with compatible PPM signals and suitable power connections.
I really don't know Spektrum Tx's, so check some more before commiting to the 'buy' button ;)

You will have to make some kind of adapter lead and suitable mount for your DX8, because, as you noted, it's for Futaba Tx with plug in module (or with the adapter PCB, for JR/Turnigy 9x).

You will need a varying degree of soldering/electronics/computer ability whatever way you decide to go.

OLRS is not a 'plug n go' system.

That said, there is a growing UK interest and wherever we can, we will help.

Nigel.
You're only jealous 'cos the voices aren't talking to you  :D

tone

In the UK what video system would best work alongside this? I'm assuming it's 2.4GHZ? Thanks

Devonian

In the UK, we are legally allowed to use 2.4GHz or 5.8GHz - either will work alongside 459MHz quite happily.

The worst, would be 1.3GHz (for our foreign friends) as thats a bit too close to the 3rd (and strongest) harmonic of the 434/459MHz systems.

Nigel.
You're only jealous 'cos the voices aren't talking to you  :D

Devonian

Back on subject...

I found a UK supplier for the RF module, should anyone be unlucky enough to destroy theirs - or maybe you want to make a hack module for yourself?

http://proto-pic.co.uk/rfm22b-s2-smd-wireless-transceiver/

Nigel.
You're only jealous 'cos the voices aren't talking to you  :D

thundead

Right, quick update:
Finished & tested PCB. it's now coding time yaay. I need to think of a serial protocol from the TX to the antenna tracker.

Was thinking of something like this: ![sttream of data bla bla bla]@. Do u think it's enough having a start and a stop bit or should I include maybe checksum.

Mihai.
If you like my work feel free to contribuite to my Pringles & Red Bull Fund :) http://forum.flytron.