HobbyKing.com New Products Flash Sale
Closed Thread
Thread Tools
Old Dec 12, 2012, 12:05 AM
It's Just a Hobby!
Sudsy's Avatar
Joined May 2012
839 Posts
Quote:
Originally Posted by LegendLength View Post
I can list the changes for creating a new board type in case it helps anyone in the future:

1. Create a new board name.

In APM_Config.h change:

Code:
// Select your sensor board
#define PIRATES_SENSOR_BOARD PIRATES_NEW_BOARD_NAME
/*
	PIRATES_ALLINONE
	PIRATES_FFIMU
	PIRATES_FREEIMU
	PIRATES_BLACKVORTEX
	PIRATES_FREEIMU_4 					// New FreeIMU 0.4.1 with MPU6000, MS5611 and 5883L
	PIRATES_DROTEK_10DOF_MPU 		// MPU6000, MS5611 and 5883L
	PIRATES_CRIUS_AIO_PRO_V1    // Crius AllInOne Pro v1
	PIRATES_NEW_BOARD_NAME
*/
and in defines.h change:

Code:
// Pirates sensors boards
#define PIRATES_ALLINONE 0
#define PIRATES_FFIMU 1
#define PIRATES_FREEIMU 2
#define PIRATES_BLACKVORTEX 3
#define PIRATES_FREEIMU_4 4
#define PIRATES_DROTEK_10DOF_MPU 5
#define PIRATES_CRIUS_AIO_PRO_V1 6
#define PIRATES_NEW_BOARD_NAME 7

2. Select the board's gyro, accelerometer and barometer.

In config.h change:

Code:
	#elif PIRATES_SENSOR_BOARD == PIRATES_CRIUS_AIO_PRO_V1
		#define CONFIG_IMU_TYPE CONFIG_IMU_MPU6000_I2C
		#define CONFIG_BARO AP_BARO_MS5611_I2C
		#define MAG_ORIENTATION ROTATION_YAW_180
		#define GYRO_ADDR 0x68
	#elif PIRATES_SENSOR_BOARD == PIRATES_NEW_BOARD_NAME
		#define CONFIG_IMU_TYPE   CONFIG_IMU_MPU6000_I2C
		#define CONFIG_BARO     AP_BARO_MS5611_I2C
		#define MAG_ORIENTATION	ROTATION_YAW_270
		#define GYRO_ADDR 0x68
	#else
		#define CONFIG_IMU_TYPE   CONFIG_IMU_PIRATES
		#define MAG_ORIENTATION	ROTATION_YAW_180 
	#endif
You can look at the surrounding code to find the right sensor types. This example is for the witespy board which has the MS6511 baro and the 6 axis mpu6000 gyro + accel sensor.

3. Tell the software which sensor is which.

If you are using a mpu6000 based sensor then from the libraries folder open libraries/AP_InertialSensor/AP_InertialSensor_MPU6000_I2C.cpp .

If you are using any other type open libraries/AP_InertialSensor/AP_InertialSensor_Pirates.cpp .

At the top of the file add the new board type:

Code:
#define PIRATES_FREEIMU_4 4
#define PIRATES_DROTEK_10DOF_MPU 5 
#define PIRATES_CRIUS_AIO_PRO_V1 6
#define PIRATES_NEW_BOARD_NAME 7
or for the other sensor types it would be:

Code:
#define PIRATES_ALLINONE 0
#define PIRATES_FFIMU 1
#define PIRATES_FREEIMU 2
#define PIRATES_BLACKVORTEX 3
#define PIRATES_NEW_BOARD_NAME 7
Ensure the number is the same as the one you defined above.

Then scroll down and change:

Code:
	if (_board_Type == PIRATES_FREEIMU_4) {
		_gyro_data_index[0]  = 4;		// X
		_gyro_data_index[1]  = 5;		// Y
		_gyro_data_index[2]  = 6;		// Z
		_gyro_data_sign[0]   = -1;	// -X
		_gyro_data_sign[1]   = 1;		// Y
		_gyro_data_sign[2]   = -1;	// -Z
	
		_accel_data_index[0] = 0;
		_accel_data_index[1] = 1;
		_accel_data_index[2] = 2;
		_accel_data_sign[0]  = -1;
		_accel_data_sign[1]  = 1;
		_accel_data_sign[2]  = -1;
	}

	 else if (_board_Type == PIRATES_DROTEK_10DOF_MPU || _board_Type == PIRATES_CRIUS_AIO_PRO_V1
			|| _board_Type == PIRATES_MULTIWII_PRO_V2) {
		_gyro_data_index[0]  = 5;	// Y
		_gyro_data_index[1]  = 4; // X
		_gyro_data_index[2]  = 6;	// Z
		_gyro_data_sign[0]   = 1;	// Y
		_gyro_data_sign[1]   = 1;	// X
		_gyro_data_sign[2]   = -1;// -Z
	
		_accel_data_index[0] = 1;
		_accel_data_index[1] = 0;
		_accel_data_index[2] = 2;
		_accel_data_sign[0]  = 1;
		_accel_data_sign[1]  = 1;
		_accel_data_sign[2]  = -1;
	}
Or put it in the top part depending on how your sensors are set up. If you don't know you can use trial and error in mission planner using the artificial horizon. Take note of the bracket locations in the source code when doing the change above.

Note that when changing files that are in the libraries folder you should be careful to copy the new changes across to the libraries folder in the arduino folder. In other words make sure the arduino libraries folder is always the same as the libraries folder next to your megapirate source code. Otherwise this can also fail silently and produce very strange problems when libraries are slightly out of sync.
Oh yea, I feel much better now!

Sudsy
Sudsy is offline Find More Posts by Sudsy
Sign up now
to remove ads between posts
Old Dec 12, 2012, 12:20 AM
Registered User
Joined Dec 2012
9 Posts
Hi Guys,
So I have tried some more to get my gps working with no luck (I think, not really sure) by loading MultiWii dev 1240 with:
#define FFIMUv2
#define GPS_SERIAL 2
#define GPS_BAUD 115200
#define INIT_MTK_GPS

I have also tried combinations using GPS_BAUD 4800 and GPS_SERIAL 1 and even GPS_SERIAL Serial1 as directed by this file in HobbyKings uploads http://www.hobbyking.com/hobbyking/s...2X19082X23.pdf

I have loaded BareMinimum sketches to the board to "clear it" in between attempts with MultiWii dev 1240.

I then open MultiWiiConf application and connect to the port, then click on the start button. I see everything moving around as it should, but the gps numbers are all just at 0. The gps "status indicator"? turns green but not the GPS_fix. I have tried this process outside in the clear and in, and have reset the board and MultiWiiConf multiple times.

I purchased two boards and have tried the same process on both of them thinking that one of them (board or gps) might be faulty. The gps serial pins on one of the boards was not soldered so I soldered it after pulling it out of the bag (thought I might have burned it up or something).

I will start digging into arduino tomorrow to see if I can figure out what i'm doing wrong. Perhaps replace the STABLEPIN with the LEDPIN since it seems that is mapped to led1. See if google can provide any examples of simple sketches to use this gps to see if I can get a signal from it. Any advice?

Thanks,
--Doug
chestnut75 is offline Find More Posts by chestnut75
Old Dec 12, 2012, 01:18 AM
Click eagle to read my blog
jabram's Avatar
Australia, NSW, Kendall
Joined Jul 2012
5,111 Posts
@chestnut75

Doug,

This thread is about MegaPirate NG on HK MultiWii PRO Flight Controller w/MTK GPS Module

Looks like you are flying the HK Mega with Multiwii

The MultiWii on HK MultiWii Mega Board WITH MTK 3329 GPS thread follow the link below
http://www.rcgroups.com/forums/showthread.php?t=1726790
jabram is offline Find More Posts by jabram
RCG Plus Member
Last edited by jabram; Dec 12, 2012 at 01:31 AM.
Old Dec 12, 2012, 07:35 AM
Registered User
fpv-tor's Avatar
norway
Joined Oct 2009
1,133 Posts
Quote:
Originally Posted by jabram View Post
Is it possible you have a bad connection to one or more of the motors, bullet connectors ?
the connections are good. its more like it powers up the two right motors and flips the thing over. i hear many people have this issue with mwii. but i dont know a im new to it. will keep on reading and seraching
fpv-tor is offline Find More Posts by fpv-tor
Old Dec 12, 2012, 08:57 AM
Registered User
Joined Dec 2012
9 Posts
@jabram My end goal is to MegaPirate but the first step is to install MultiWii dev 1240 to setup the GPS, this is the first step for MegaPirate and/or MultiWii. I have two of the MultiWii PRO Flight Controller w/MTK GPS Modules.

I found the pdf for the MWC Mega v1.0 in the files section for my board on the HobbyKing site. If the pdf is for a different board, I guess that explains some of the confusion I had.

I am able to make the changes in config.h and upload to the board. When I connect with the MultiWiiConfig application the GPS fields are all just 0s and the only inclination of GPS working is the green gps status under the roll and pitch indicators, this stays green if my gps is connected or not so i'm thinking this is just going by the config settings.

I also thought that I would get a blinking light if the gps was set up, less than 6 fixes and it should just blink.
chestnut75 is offline Find More Posts by chestnut75
Old Dec 12, 2012, 09:33 AM
Registered User
Austria
Joined Jan 2004
7,690 Posts
Quote:
Originally Posted by chestnut75 View Post
@jabram My end goal is to MegaPirate but the first step is to install MultiWii dev 1240 to setup the GPS, this is the first step for MegaPirate and/or MultiWii. I have two of the MultiWii PRO Flight Controller w/MTK GPS Modules.

I found the pdf for the MWC Mega v1.0 in the files section for my board on the HobbyKing site. If the pdf is for a different board, I guess that explains some of the confusion I had.

I am able to make the changes in config.h and upload to the board. When I connect with the MultiWiiConfig application the GPS fields are all just 0s and the only inclination of GPS working is the green gps status under the roll and pitch indicators, this stays green if my gps is connected or not so i'm thinking this is just going by the config settings.

I also thought that I would get a blinking light if the gps was set up, less than 6 fixes and it should just blink.
I don't know from where start this legend that first the GPS must be initialized with MultiWii ... for me it is 100% bulls

The GPS included with the board is a "vanilla" NMEA 115Kbps ... so ... just state this in the MutliWii or in MegaPirate code ... and it will work .. as it is ... no reason to hack it.

Furthermore ... in case you have a GPS that does not hold the configuration, is just few lines of code and few seconds, add in the board code, the initialization ... I did this on my previous multiwii SE2.0 with my u-block GPS coming from FrSky telemetry (This GPS is 9600 NMEA, and has no configuration memory ... so ... I added in the code the change to 56k and to use 5Hz ... piece of cake )

Tchuss

e_lm_70
e_lm_70 is online now Find More Posts by e_lm_70
Old Dec 12, 2012, 09:34 AM
Registered User
Australia, NSW
Joined Sep 2006
138 Posts
Quote:
Originally Posted by chestnut75 View Post
@jabram My end goal is to MegaPirate but the first step is to install MultiWii dev 1240 to setup the GPS, this is the first step for MegaPirate and/or MultiWii. I have two of the MultiWii PRO Flight Controller w/MTK GPS Modules.

I found the pdf for the MWC Mega v1.0 in the files section for my board on the HobbyKing site. If the pdf is for a different board, I guess that explains some of the confusion I had.

I am able to make the changes in config.h and upload to the board. When I connect with the MultiWiiConfig application the GPS fields are all just 0s and the only inclination of GPS working is the green gps status under the roll and pitch indicators, this stays green if my gps is connected or not so i'm thinking this is just going by the config settings.

I also thought that I would get a blinking light if the gps was set up, less than 6 fixes and it should just blink.
Just a shot in the dark but make sure your tx and rx cables are correct. Should be tx -> rx and vice versa for gps. In multiwii you should at least get flashing red 'no fix' in the artificial horizon and the text background should be flashing red. It won't flash at all if tx and rx are incorrect way around.
LegendLength is offline Find More Posts by LegendLength
Old Dec 12, 2012, 10:18 AM
Registered User
Joined Dec 2012
9 Posts
@e_lm_70 I'm a Noob, and was going off this forum post (and the MultiWii on HK MultiWii Mega Board WITH MTK 3329 GPS post) which seemed to stress setting up the gps with the multiwii dev 1240. I'll try skipping this step and move on to installing the MegaPirate code, thanks for filling me in on this legend.

@LegendLength Thanks for the tip, I didn't know that the "no fix" would be flashing red. I triple checked the tx->rx connections, they were correct.
chestnut75 is offline Find More Posts by chestnut75
Old Dec 12, 2012, 10:43 AM
Done Posting, Gone Flying
JNJO's Avatar
Sweden, Uppsala County, Balsta
Joined Jun 2012
1,206 Posts
@chestnut75
Using MultiWii for setting up GPS is not a legend.
It is done to take advantage of the configuration string MultiWii sends to the GPS.
This saves a lot of headache and hassle. Jabrams guide in post #1 is valid and works.

As you already have done that, your GPS should now be setup right, even if you don't see it in MultiWiiConf.

It'll be fun to hear if it works properly once you have MPNG loaded and running.
(Hint: Type rawgps in the Terminal -> test menu in MissionPlanner. You'll see a string of NMEA messages coming, regardless if you have a fix or not.)

Everything can be done manually of course, but that involves either a code to be loaded in the flightcontroller anyway, or using an FTDI-interface between GPS and a PC and a configuration utility to set up the GPS. (That utility is worthy of an RCG thread on its own, btw.)
I did the latter on mine, and still kick myself for not using the MultiWii trick.

The only legend here is that all MTK GPS:s comes setup for 115200 baud. Mine, for example, came at 9600.

Happy Tinkering
/J
JNJO is online now Find More Posts by JNJO
Old Dec 12, 2012, 10:51 AM
Registered User
Austria
Joined Jan 2004
7,690 Posts
Quote:
Originally Posted by JNJO View Post
@chestnut75
Using MultiWii for setting up GPS is not a legend.
It is done to take advantage of the configuration string MultiWii sends to the GPS.
This saves a lot of headache and hassle. Jabrams guide in post #1 is valid and works.

As you already have done that, your GPS should now be setup right, even if you don't see it in MultiWiiConf.

It'll be fun to hear if it works properly once you have MPNG loaded and running.
(Hint: Type rawgps in the Terminal -> test menu in MissionPlanner. You'll see a string of NMEA messages coming, regardless if you have a fix or not.)

Everything can be done manually of course, but that involves either a code to be loaded in the flightcontroller anyway, or using an FTDI-interface between GPS and a PC and a configuration utility to set up the GPS. (That utility is worthy of an RCG thread on its own, btw.)
I did the latter on mine, and still kick myself for not using the MultiWii trick.

The only legend here is that all MTK GPS:s comes setup for 115200 baud. Mine, for example, came at 9600.

Happy Tinkering
/J
Mine came set up at 115kbps, and clearly over 5Hz ... so .. no need to do any initialization on it

I read other got same

Guess first post should be rewritten more smart ... at least gps should be checked in advance ...

e_lm_70 is online now Find More Posts by e_lm_70
Old Dec 12, 2012, 04:15 PM
Registered User
Joined Dec 2012
9 Posts
So I went ahead and loaded MPNG w/o gps confirmation as @JNJO suggested and
IT WORKED!!! Thanks guys, guess I just needed a little hand holding.
chestnut75 is offline Find More Posts by chestnut75
Old Dec 12, 2012, 06:32 PM
Click eagle to read my blog
jabram's Avatar
Australia, NSW, Kendall
Joined Jul 2012
5,111 Posts
Quote:
Originally Posted by e_lm_70 View Post
Mine came set up at 115kbps, and clearly over 5Hz ... so .. no need to do any initialization on it

I read other got same

Guess first post should be rewritten more smart ... at least gps should be checked in advance ...

The only misleading information here is coming from you.

You failed to notice that you previously already ran Multiwii dev version which does start at 9600 and then tests all baudrates until it gets a response from the GPS, having discovered it's baudrate it then sets the GPS up for 115,200 baud and a fast update rate- THAT IS THE REASON FOR LOADING MULTIWII - BRIEFLY - before loading MP NG.

You don't seem to understand that you had already loaded Multiwii dev and that it SET UP YOUR GPS FOR YOU, your MTK-3329 GPS did NOT come from Hobby King set up that way, hobby King delivers MTK-3329 set to 9600 baud and 1 Hz update rate.

It is confusing enough for newbies without your "help"

Megapirates NG does not go out and test every baudrate to the GPS it sets the baudrate to one rate, the one you set in the definitions.

The information on the first post is correct.

I ask you to please go back and delete your misleading posts in this thread and save newbies a lot of unnecessary frustration.
jabram is offline Find More Posts by jabram
RCG Plus Member
Last edited by jabram; Dec 12, 2012 at 07:13 PM.
Old Dec 12, 2012, 06:45 PM
Click eagle to read my blog
jabram's Avatar
Australia, NSW, Kendall
Joined Jul 2012
5,111 Posts
Quote:
Originally Posted by chestnut75 View Post
So I went ahead and loaded MPNG w/o gps confirmation as @JNJO suggested and
IT WORKED!!! Thanks guys, guess I just needed a little hand holding.
Congrats you got it working with a bit of faith in the instructions and JNJO's help.

If you go back to the first post you will notice that I do not ask you to run Multiwii conf- you ran Multiwii Conf and THAT is what mislead you into believing that your GPS wasn't working
jabram is offline Find More Posts by jabram
RCG Plus Member
Last edited by jabram; Dec 12, 2012 at 07:03 PM.
Old Dec 12, 2012, 07:06 PM
Registered User
BigJimNZ's Avatar
Auckland New Zealand
Joined Sep 2010
1,295 Posts
Well Joe I just pulled the trigger on the Arduflyer with the CN06 GPS and 915mhz telemetry from
RC Timer. NZ$178 all up didn't seem bad with the Kiwi good against the greenback ATM.
Now I have three boards to keep me amused.
Ian
BigJimNZ is offline Find More Posts by BigJimNZ
Old Dec 12, 2012, 07:15 PM
Quadcopter Addict
Joined Nov 2011
322 Posts
Looks like the Pro is out at HK, but now they have the AIO board with no GPS. For $45, I am tempted to get one and compare the upgraded sensors to the Pro.
oddcopter is offline Find More Posts by oddcopter
Closed Thread


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion [UNOFFICIAL] New HobbyKing MultiWii PRO Flight Controller w/MTK GPS Module benybee UAV - Unmanned Aerial Vehicles 378 Aug 17, 2014 10:52 PM
Help! PROBLEM on Crius AIO Pro Y6 With MegaPirate NG 2.7 R4. RQuad Multirotor Electronics 3 Jan 22, 2013 12:13 AM
Found MultiWii PRO Flight Controller w/MTK GPS Module Koo Aircraft - Electric - Multirotor (FS/W) 4 Oct 10, 2012 11:47 PM
Yippee! New AirStudio universal Flight Controller for Mega Pirate NG and MultiWii AirCopter Multirotor Electronics 44 Sep 10, 2012 04:56 AM