GPS on Crius SE board

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Matt.
Posts: 26
Joined: Sat Dec 31, 2011 11:41 pm
Location: Sydney, NSW, Australia

GPS on Crius SE board

Post by Matt. »

Hey Guys,

I own a few Crius SE boards that have a port for using the LCD module. I am hoping this port could be used to for a GPS module.
I was hoping that someone could give me some pointers on how I could enable this?

Matt

User avatar
Bledi
Posts: 187
Joined: Sat Sep 10, 2011 6:36 pm

Re: GPS on Crius SE board

Post by Bledi »

If you want to use GPS, you have to use a I2C GPS (for exemple like this one : viewtopic.php?f=8&t=1551)
The problem is that the CRIUS SE don't have an output for I2C.
So you have to had a connector to the board with the I2C (SDA & SCL) and power (5V & GND).

Image

User avatar
Bledi
Posts: 187
Joined: Sat Sep 10, 2011 6:36 pm

Re: GPS on Crius SE board

Post by Bledi »

Sorry bad board (it is the lite not the SE) but le PINOUT is the same

Matt.
Posts: 26
Joined: Sat Dec 31, 2011 11:41 pm
Location: Sydney, NSW, Australia

Re: GPS on Crius SE board

Post by Matt. »

I have a skylab rs232 gps :-(
Can you do software RS232 on unused pins ???

User avatar
dramida
Posts: 473
Joined: Mon Feb 28, 2011 12:58 pm
Location: Bucharest
Contact:

Re: GPS on Crius SE board

Post by dramida »

I am using Crius board with serial GPS connected on GPS port located above FTDI port in it's nearby.
In the software you have to disable the function serialCom() located in Multiwii.ino by commenting that line.

Code: Select all

//serialCom();


This will disable the GUI. After that you can use your serial GPS by configuring in config.h your GPS on serial 0 witch is now free of duty.

Code: Select all

#define GPS_SERIAL 0 // should be 2 for flyduino v2. It's the serial port number on arduino MEGA
#define GPS_BAUD   115200// put your gps baud rate here


For me this worked with an GPS taken from remzibi osd, with ttl 5V signals. When you have a GPS 3D fix, the blue status led from Crius board will blink rapidly.
The good news is that the GPS connector fits exactly the remzibi GPS connector. And even better, you can still use the OSD because Crius splits the RX pin and can use the crius rx pin to inject GPS TX in OSD with a single wire, having a common ground.

The video witch shows the setup and flight here http://www.youtube.com/watch?v=ho_PYBi3QwY

dr.tom
Posts: 141
Joined: Fri Mar 30, 2012 4:46 pm
Location: Croatia
Contact:

Re: GPS on Crius SE board

Post by dr.tom »

the board is very cheap!
the price has gone down to 46$ + free shipping
http://www.goodluckbuy.com/mwc-multiwii ... quadx.html
it flies great (I have some vids under my youtube channel)


the picture from top is for 5V I2C sensor (gps or some other, like sonar...).


is this below correct for 3.3V I2C sensor? thanks :)


Image


Thanks!

alexmos
Posts: 108
Joined: Tue Aug 09, 2011 12:12 pm

Re: GPS on Crius SE board

Post by alexmos »

dramida wrote:I am using Crius board with serial GPS connected on GPS port located above FTDI port in it's nearby.
In the software you have to disable the function serialCom() located in Multiwii.ino by commenting that line.
....


Thanks for this info, I am going to use the same config - Crius SE + GPS from remzibi's OSD. I have 2 questions:
1. Is it possible to let OSD still working with GPS (i.e. connect GPS to both Crius and OSD)?
2. GPS has 1Hz update rate, is it enough for return-to-home?

jpeti29
Posts: 22
Joined: Wed Mar 07, 2012 9:19 am
Location: Hungary

Re: GPS on Crius SE board

Post by jpeti29 »

dr.tom wrote:the board is very cheap!
the picture from top is for 5V I2C sensor (gps or some other, like sonar...).
is this below correct for 3.3V I2C sensor? thanks :)
Image
Thanks!


Yes!

User avatar
Jonit
Posts: 37
Joined: Sat May 12, 2012 10:12 pm
Location: Slovakia

Re: GPS on Crius SE board

Post by Jonit »

Hi dramida, i tried to measure the voltage between GND and VCC on my Crius board, but it shows 0V .. so i tried between GND and RX1 and it shows 4,8V and between GND and TX0 it shows 4,9V. I want to try to connect it with my GPS bluetooth module but i am affraid of damaging my GPS. I assumed that there will be 5V voltage between GND and VCC pins and GPS unit will be powered from them. So is it as it have to be or is something wrong with my Crius board?

Image
dramida wrote:I am using Crius board with serial GPS connected on GPS port located above FTDI port in it's nearby.
In the software you have to disable the function serialCom() located in Multiwii.ino by commenting that line.

Code: Select all

//serialCom();


This will disable the GUI. After that you can use your serial GPS by configuring in config.h your GPS on serial 0 witch is now free of duty.

Code: Select all

#define GPS_SERIAL 0 // should be 2 for flyduino v2. It's the serial port number on arduino MEGA
#define GPS_BAUD   115200// put your gps baud rate here


For me this worked with an GPS taken from remzibi osd, with ttl 5V signals. When you have a GPS 3D fix, the blue status led from Crius board will blink rapidly.
The good news is that the GPS connector fits exactly the remzibi GPS connector. And even better, you can still use the OSD because Crius splits the RX pin and can use the crius rx pin to inject GPS TX in OSD with a single wire, having a common ground.

The video witch shows the setup and flight here http://www.youtube.com/watch?v=ho_PYBi3QwY

User avatar
djrm
Posts: 40
Joined: Wed Feb 15, 2012 11:32 pm
Location: North Yorkshire, UK

Re: GPS on Crius SE board

Post by djrm »

Jonit wrote:Hi dramida, i tried to measure the voltage between GND and VCC on my Crius board, but it shows 0V ..

There is something wrong here, on my board there is 5V on the VCC terminal. I am using it to supply power to my OSD board.
hth David.

User avatar
Jonit
Posts: 37
Joined: Sat May 12, 2012 10:12 pm
Location: Slovakia

Re: GPS on Crius SE board

Post by Jonit »

djrm wrote:There is something wrong here, on my board there is 5V on the VCC terminal. I am using it to supply power to my OSD board.
hth David.

hmm, that is kinda weird, something is wrong with my board, but i assume that i can use any other VCC pin e.g. from FTDI port. Anyway, what about RX and TX pins vs. GROUND? David, can you measure it?

User avatar
djrm
Posts: 40
Joined: Wed Feb 15, 2012 11:32 pm
Location: North Yorkshire, UK

Re: GPS on Crius SE board

Post by djrm »

The signal pins show an average reading of approx 4.5V DC, the actual voltage here will depend on the data.
I'm sure you know that the FTDI and TTL connectors are one and the same i/o ports, they are just two for convenience.

i.e The Tx, Rx, 5V, and Gnd are common to both connectors. If there is no 5V on ther TTL pin then you must have a broken track, if this is so then a link from one 5v pin to the other 5V pin should cure the problem. (The above is guesswork, I have not seen a schematic)

You could check the pin continuity when the board has no power appied. Are you sure you were measuring the DC voltage, and not AC by mistake?

User avatar
Jonit
Posts: 37
Joined: Sat May 12, 2012 10:12 pm
Location: Slovakia

Re: GPS on Crius SE board

Post by Jonit »

now i checked it and you were right, there is a broken path between FTDI and TTL VCC pin. It is hard to see by eye, but on photo you can see it clearly. So I am gonna use FTDI pins instead of TTL and everything should be fine ;) Thanks for your help.
Jonit
Attachments
IMG_6833.JPG
IMG_6832.JPG

User avatar
Jonit
Posts: 37
Joined: Sat May 12, 2012 10:12 pm
Location: Slovakia

Re: GPS on Crius SE board

Post by Jonit »

now i stuck on one thing. When i comment //serialCom(); how can I assign functions like Stable mode, gps RTH, gps POS HOLD, etc... to my transmitter switches without using a GUI? I tried to find it somewhere in the code, but without success. :|
Jonit

sismeiro
Posts: 173
Joined: Tue Feb 21, 2012 12:33 pm

Re: GPS on Crius SE board

Post by sismeiro »

Jonit wrote:now i stuck on one thing. When i comment //serialCom(); how can I assign functions like Stable mode, gps RTH, gps POS HOLD, etc... to my transmitter switches without using a GUI? I tried to find it somewhere in the code, but without success. :|
Jonit

I think if you upload the firmware first without the serialCom() commented, configure all the settings you want, write them to the EEPROM and next upload the firmware with the serialCom() commented, all the settings will be there. At least for me I change the firmware and all setting are like before.

User avatar
Jonit
Posts: 37
Joined: Sat May 12, 2012 10:12 pm
Location: Slovakia

Re: GPS on Crius SE board

Post by Jonit »

Good idea, i am gonna try. Thanks :)
Jonit

User avatar
Jonit
Posts: 37
Joined: Sat May 12, 2012 10:12 pm
Location: Slovakia

Re: GPS on Crius SE board

Post by Jonit »

Maybe a stupid question, but:
TX from the GPS must be connected to TX pin on the Crius board and RX from the GPS must be connected to RX pin on the Crius board ?

or

TX from the GPS must be connected to RX pin on the Crius board and RX from the GPS must be connected to TX pin on the Crius board ?
:oops:
Jonit

User avatar
dramida
Posts: 473
Joined: Mon Feb 28, 2011 12:58 pm
Location: Bucharest
Contact:

Re: GPS on Crius SE board

Post by dramida »

The merged Multiwii shared with Eos bandi R33 GPS code works great with GPS pos hold and RTH. I am using this version on atmega328 core with a single serial and i have to comment / uncomment serialCom() function to use GUI or GPS acordingly on serial 0.

Is any software patch to plug the GPS and the software automatically enable GPS and disable the GUI?

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: GPS on Crius SE board

Post by PatrikE »

I have a patch who sense if Gps is present.
It check if theres a NMEA sentence at starup and select comunication depending on that.

To switch.
connect the gps and press reset on ardu.
Or
Connect Ftdi and press reset on ardu.

I'll try to put it in shared later today.

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: GPS on Crius SE board

Post by Alexinparis »

Hi,
There is no need to implement an initial sequence recognition.
It should be possible to reduce enough the code size to parse both serial link in order to detect either a NMEA frame or a MSP frame.

Pyrofer
Posts: 180
Joined: Sat Apr 14, 2012 2:55 pm

Re: GPS on Crius SE board

Post by Pyrofer »

this "gps auto selection" is exactly what I need!

Any progress been made on detecting GUI or GPS connected automatically?

I have a serial GPS and unless I buy an i2c Interface I cant use it.

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: GPS on Crius SE board

Post by PatrikE »

With this selected.

Code: Select all

#define TRI
#define GPS_PROMINI_SERIAL    9600
#define CRIUS_SE
#define SERIAL_SUM_PPM         ROLL,PITCH,THROTTLE,YAW,AUX1,AUX2,AUX3,AUX4 //For Robe/Hitec/Futaba


My hack occupies 106 bytes..
Binary sketch size: 30486 bytes (of a 30720 byte maximum)

And "original" Shared
Binary sketch size: 30362 bytes (of a 30720 byte maximum)

The 328 starts to be to small......

Enable and select your Gps Baud-rate

Code: Select all

//#define GPS_PROMINI_SERIAL    57600 // Will Autosense if GPS is connected when ardu boots!.....

Connect Gps and reboot.
Or
Connect to Gui and reboot.

The autosense will delay the bootTime 1 sec and blink fast 5 times.

Uploaded to shared

/Patrik

User avatar
dramida
Posts: 473
Joined: Mon Feb 28, 2011 12:58 pm
Location: Bucharest
Contact:

Re: GPS on Crius SE board

Post by dramida »

Thank you Patrik, I'll test the new shared R824 version and eventually make a movie of the GPS switch and GPS pos hold working.
How about LCD config? Will it work in both modes?

2 cent ideea: If dump the bootloader and upload the .hex file on pro mini with 9$ hardware (AVR USB), we could use the entire 32K of flash memory (back to KK update world)

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: GPS on Crius SE board

Post by PatrikE »

The lcd should work in Gui mode i think.
Probobly not with the Gps who spam the port quite much.

User avatar
dramida
Posts: 473
Joined: Mon Feb 28, 2011 12:58 pm
Location: Bucharest
Contact:

Re: GPS on Crius SE board

Post by dramida »

Your GPS sensing software patch works perfect, here is a demonstration of all GPS functions of MultiWii based on Atmega 328 (Crius) and serial GPS.
http://www.youtube.com/watch?v=952DYF3XV8s

flyboy_____
Posts: 33
Joined: Thu Sep 15, 2011 10:45 am

Re: GPS on Crius SE board

Post by flyboy_____ »

DRAMIDA can you please post some pictures of the GPS connected to the CRIUS SE?
Do you think that this GPS will work connected to the serial port?
http://www.dragonlabseu.bigcartel.com/product/10hz-gps
Last edited by flyboy_____ on Fri Jun 01, 2012 3:20 pm, edited 2 times in total.

User avatar
dramida
Posts: 473
Joined: Mon Feb 28, 2011 12:58 pm
Location: Bucharest
Contact:

Re: GPS on Crius SE board

Post by dramida »

The GPS conects on Crius on the GPS connector. it is written on the board, near ftdi. Remzibi GPS fits exactly there, no rewiring needed. Also you may put on still the video on 720p image (0:27) with tricopter and see the wiring. (note that this was a previous development, not so good pos hold)

http://www.youtube.com/watch?v=ho_PYBi3QwY

tomge
Posts: 2
Joined: Mon May 28, 2012 6:38 am

Re: GPS on Crius SE board

Post by tomge »

flyboy_____ wrote:DRAMIDA can you please post some pictures of the GPS connected to the CRIUS SE?
Do you think that this GPS will work connected to the serial port?


Yes please post some pictures so us not so experienced guys can benefit from your expertise
Please please please... :)

flyboy_____
Posts: 33
Joined: Thu Sep 15, 2011 10:45 am

Re: GPS on Crius SE board

Post by flyboy_____ »

Thanks Dramida and PatrikE.

I'm going to try tonigh this GPS http://www.dragonlabseu.bigcartel.com/product/10hz-gps, that I use with Dragon OSD. Do you think it will work?
Do I need to configure anything in this GPS. If so... how to?

I will do the following step by step:
1 - Connect the 4 wires from the GPS to Serial Port on Crius SE (GND,Vcc,Tx,Rx)
2 - Change my usual Tricopter code of Multiwii with the activation of:
#define GPS_PROMINI_SERIAL 9600
#define GPS_PROMINI_SERIAL 57600 // Will Autosense if GPS is connected when ardu boots!.....
3 - Configure in GUI a switch to assign to GPS features.

Is this all??

What do we loose with this mod:
- Possibility of using a Bluetooth transmitter to use telemetry and configuration trough the serial port.
- Can I use GUI normally with FTDI cable?

User avatar
dramida
Posts: 473
Joined: Mon Feb 28, 2011 12:58 pm
Location: Bucharest
Contact:

Re: GPS on Crius SE board

Post by dramida »

Yes, the 4 steps are correct, that's all, but you must find the baudrate of your Dragon OSD GPS to put in your config.
If you can, set this OSD to 10Hz NMEA sentence.
note.
-You don't need to define twice GPS_PROMINI_SERIAL
-The GPS will be detected at boot time and the GUI will be disabled until you reboot without GPS (Thanks to Patrik)

udi123
Posts: 1
Joined: Mon Mar 19, 2012 7:21 pm

Re: GPS on Crius SE board

Post by udi123 »

Hello people
Sorry for my English.
I own CRUISE SE and I wanted to connect a GPS
Is this GPS fit ?
http://www.goodluckbuy.com/gps-receiver ... oller.html
If so,,,
when I will connect it via I2C Can I use GUI ?
Thank you
udi

flyboy_____
Posts: 33
Joined: Thu Sep 15, 2011 10:45 am

Re: GPS on Crius SE board

Post by flyboy_____ »

I Wrote incorrectly my previous post
What I meant was:

//#define GPS_SERIAL 2 // should be 2 for flyduino v2. It's the serial port number on arduino MEGA
#define GPS_BAUD 115200

#define GPS_PROMINI_SERIAL 57600 // Will Autosense if GPS is connected when ardu boots!.....

This is the correct setup to use serial GPS. Correct?

User avatar
dramida
Posts: 473
Joined: Mon Feb 28, 2011 12:58 pm
Location: Bucharest
Contact:

Re: GPS on Crius SE board

Post by dramida »

yep ;) Be shure to config your GPS to a baudrate accordingly to your define.

flyboy_____
Posts: 33
Joined: Thu Sep 15, 2011 10:45 am

Re: GPS on Crius SE board

Post by flyboy_____ »

1 problem... 328P is starting to get small.
I want to activate Camera Triguer, and Tilt, and Failsafe but there is no space available.

What can I remove to free space?

flyboy_____
Posts: 33
Joined: Thu Sep 15, 2011 10:45 am

Re: GPS on Crius SE board

Post by flyboy_____ »

Finally I tested Dragon OSD GPS serial connect to 328P (Dev0528)

Issues:
- Cannot load all settings in 328P by lack of space. Must disable camera tilt, trigger and failsafe that I wanted.
- GPS is recognized has green in GUI and its led blinks, but does not pick up info in GUI (alt, lat, lon, sats...)
- Tried reversing Tx and Rx from GPS but that blocks GUI.
- GUI is slow...

How to send AT command to GPS to check if it is sending NMEA?

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: GPS on Crius SE board

Post by PatrikE »

If you can live without Baro it's possible to disable it in def..
It will save some space.

Pyrofer
Posts: 180
Joined: Sat Apr 14, 2012 2:55 pm

Re: GPS on Crius SE board

Post by Pyrofer »

flyboy_____> Are you connecting the GPS and GUI serial on the SAME serial port/pins?

If so, I can't see how that will work...

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: GPS on Crius SE board

Post by PatrikE »

If you want to see what the Gps outputs it's possible to connect it direct to the Ftdi programer.
But you must cross the TX & RX connections between Gps & Ftdi.

Then you can use serial monitor in Ardino to se what commes out.

On a 328P you can only use Gui OR Gps!.
Not Both at same time!...

flyboy_____
Posts: 33
Joined: Thu Sep 15, 2011 10:45 am

Re: GPS on Crius SE board

Post by flyboy_____ »

I tried DOSD GPS with several baud rates in GPS_BAUD and GPS_PROMINI_SERIAL.
The GPS led blinks, but in GUI never catches GPS sats.

I was thinking if udi123 link is any good to connect to CRIUS in serial or I2C
http://www.goodluckbuy.com/gps-receiver ... oller.html

I'm planning on connecting the GPS to PC trough the FTDI cable and use miniGPS tool to try and read this GPS setup.
I'm afraid of burning the GPS LOCOSYS LS20031 because specs sheet says it only supports 4,2v... well I have connected it to 5v for some hours and still works when connected to DOSD. I'm I burning it slowly?
http://www.rcgroups.com/forums/showpost ... ount=17691

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: GPS on Crius SE board

Post by PatrikE »

It Will never work to connect GPS And GUI to the serialPort on a Crius SE board...
There's two physical serialports pinned out on the board But They are connected in paralell.
Therefore you can only use one at a time.

You can find a thread on the forum describing that if you have a Lcd connected when you program
the Crius the Lcd is also reprogrammed and will behave strange.


When the board boots it will detect if a gps is connected to the serialport.

If a GPS is detected.
It will disable Gui Communication.
And Activate GPS communication

It's not a optimal solution but atm its the only way to use a serial Gps together with a 328P.

Patrik
Another alternative is to make a I2c Gps unit.(Quite easy actually)

Pyrofer
Posts: 180
Joined: Sat Apr 14, 2012 2:55 pm

Re: GPS on Crius SE board

Post by Pyrofer »

I have an all in one control board and no easy access to the i2c pins.
Is it not possible to have a digital pin used as an output "switch" to select serial port? Some simple logic gates can then select which device to talk to...

flyboy_____
Posts: 33
Joined: Thu Sep 15, 2011 10:45 am

Re: GPS on Crius SE board

Post by flyboy_____ »

If I connect the Crius SE to GUI from FTDI cable pins and GPS in serial port pins that will not work?
Is that what you are saying?

With this setup all functions from GUI work, besides the GPS that does not report no info.
How do I know that GPS is locked and that is enabled for position hold and RTH?

Pyrofer
Posts: 180
Joined: Sat Apr 14, 2012 2:55 pm

Re: GPS on Crius SE board

Post by Pyrofer »

There should be a "lock/fix" LED connection on the GPS module, other than that I have no idea, you are in the same boat as me.

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: GPS on Crius SE board

Post by PatrikE »

flyboy_____ wrote:How do I know that GPS is locked and that is enabled for position hold and RTH?


The statusLed is normally off when card is unarmed.
With GPSFix it will start to blink fast 3-4Hz when board is unarmed.

The board only check for Gps at boot.
Crius board dont have a reset button and you must disconnect power to restart it.

Connect the comDevice of your choice and the board will detect the type at startup.
The board must be restarted every time you switch interface.

It's possible to reset the board by using a jumper.
Or connect a PushButton to the pins.
Attachments
Crius.jpg

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: GPS on Crius SE board

Post by PatrikE »

Pyrofer wrote:I have an all in one control board and no easy access to the i2c pins.
Is it not possible to have a digital pin used as an output "switch" to select serial port? Some simple logic gates can then select which device to talk to...


Shure it can work.
If you can switch RX-line between the devices the code will detect it at startup.
The logic test is only run at startup Not continiusly.

Pyrofer
Posts: 180
Joined: Sat Apr 14, 2012 2:55 pm

Re: GPS on Crius SE board

Post by Pyrofer »

Yeah, I was meaning for using both. Ie, making a "fake" second serial.
Use only one serial port but "switch" between 2 serial devices using an output pin to control external logic.

Is the auto-detect rolled into the multiwii dev yet or do I have to patch manually?

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: GPS on Crius SE board

Post by PatrikE »

Autodetect is merged in dev the release.
Its possible to do what you mean..
With a pnp & a npn & a resitor. Like a swtching relay.
Then make a function to switch between the intrefaces....

User avatar
Bledi
Posts: 187
Joined: Sat Sep 10, 2011 6:36 pm

Re: GPS on Crius SE board

Post by Bledi »

it's looks to exist a software solution :

Code: Select all

see the following code snippet from user HULK

void(* resetFunc) (void) = 0; //declare reset function @ address 0
...
resetFunc();  //call reset
...


from here : http://www.arduino.cc/cgi-bin/yabb2/YaB ... 250663814/

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: GPS on Crius SE board

Post by PatrikE »

Maby it's not a reset you want to do.;-)

It's better to make a function with the autodetect inside.
Then you can call the function when ever you need.

Pyrofer
Posts: 180
Joined: Sat Apr 14, 2012 2:55 pm

Re: GPS on Crius SE board

Post by Pyrofer »

Why does it need to be called? Why not parse each incoming line and see if its nmea or not?
Its easy to identify each type of data and react accordingly.

There is no reason it has to "choose" one of the other, both can be supported at the same time based on the incoming data.

Post Reply