MegaPirateNG / ardupilot-mpng

MegaPirateNG
GNU General Public License v3.0
117 stars 105 forks source link

HK Red Multiwiiboard - Multiple Issues #105

Open Shad0wbreaker opened 10 years ago

Shad0wbreaker commented 10 years ago

First of all, i want to thank you for the great work you're doing here. I had a very hard time getting my Quad to fly (Still having a hard time), but your Software was the one who worked the best.

I ran my Quad with Megapirate 2.7.4 (three weeks ago) and it worked (kind of). It was very unstable in the air and always drifted away (In Stabilize mode). I thought it may be because of my frame or wrong PID settings.

Then, I upgraded on the latest 3.0.1 R4. Before that I tried the R3 and the R2. They all didn't work very well. When going out for a test flight, I gave the quad a little Throttle and it flipped over.

Since i have no bluetooth nor a xbee adapter, i hooked the quad on the Laptop and gave a little throttle and made a screenshot of the Mission planner. Here is a picture of the Mission planner while the Quad on the Ground, without any Throttle: mpng_2

And here is a Picture of the Mission Planner, the Quad flat on the Ground and the Throttle at 5% mpng

p.s.: I Calibrated my ESC's yesterday, my Accel and Radio today

Next Issue:

The GPS isn't Working. It just don't want to. I don't know what to do. I have tried the GPS_Auto, The GPS_MTK, the GPS_NMEA protocols. My MTK-3329 Version is currently on 1.6 with a baudrate of 38400 (I have tried 115200, didn't work either). I tried to update the MTK to 1.9, it didn't work, but a lot of people reported not beeing able to flash the 1.9 Firmware, so that didn't trouble me to much.

The MTK is able to get a lock with the mini-gps software, but my Quad just don't want to...

My Specs are:

Thank you for your help and your great software!

SirAlex commented 10 years ago

Hi!

  1. Please, update 3.0.1 R4, I'm just pushed hot fix for this kind of board, but I'm actually not tested it because I have no this board.
  2. Never sits on the ground too long in ARMED state. After arming you must take off or disarm motors ASAP. The trouble you seen on second screen - it's feature called "Stability patch". When you increase Throttle to 5%, copter see it's not enough power to maintain copter in level and slowly begin to increase throttle on motors to compensate it.
Shad0wbreaker commented 10 years ago

I am currently on the version 3.0.1R4, I will try reuploading the code and recalibrating everything tomorrow.

Could it be because of the missing UBEC? I supply my board with the 5V from the ESC and added the line #define BOARD_VOLTAGE_MIN 3000 to APM_config.h. Could it be that there isn't enough voltage, causing a malfunction?

bpopp commented 10 years ago

I have almost the same configuration (HKRed, MTK3329, F30 HK UBEC, Turnigy 2830, Turnigy 9xr w/ ER9x, HJ450 frame, MPNG r3) and don't have any issues in stable flight. I do occasionally get some tilt and pull to one direction or another, but it usually straightens out eventually. I've never seen the flip you mentioned. I am having a lot of issues with autonomous flight that I haven't resolved yet. My quad takes off like a rocket in Loiter, Alt Hold, and RTL modes.

I also had a lot of trouble with this GPS, but now it seems to be working well. Did you reflash back to 1.6 after flashing 1.9? I flashed 1.9 and then connected using the serial monitor. With that firmware, I got a steady stream of ACK messages. Googling revealed that this meant I was using an incompatible firmware. Reverting back to 1.6 fixed that issue.

Once you've flashed 1.6, you should use GPS_PROTOCOL_NMEA protocol at the correct baud rate. I connected my GPS to an arduino running a FTDI sketch and then used the serial monitor to verify that it was transmitting the correct messages at the correct baud. If you have the baud set incorrectly in the serial monitor, you'll see a bunch of garbage. Good way to ensure that the GPS is sending valid messages at the right baud.

On Mon, Feb 24, 2014 at 1:58 PM, Shad0wbreaker notifications@github.comwrote:

I am currently on the version 3.0.1R4, I will try reuploading the code and recalibrating everything tomorrow.

Could it be because of the missing UBEC? I supply my board with the 5V from the ESC and added the line #define BOARD_VOLTAGE_MIN 3000 to APM_config.h. Could it be that there isn't enough voltage, causing a malfunction?

Reply to this email directly or view it on GitHubhttps://github.com/MegaPirateNG/ardupilot-mpng/issues/105#issuecomment-35928678 .

wengwah commented 10 years ago

Well, the apm are very senstive to vibration and emi interferences. You have to ensure 5cm apart from all electronics devices. Next you need to mount your fc on a vibration adsorption board or latex. This should solve your flight stability problem.

Shad0wbreaker commented 10 years ago

I completely renewed my anti-vibration-system, i mounted the FC on a Plexiglass plate and connected the Plexiglassplate with the quad using Vibration-Dampening Balls (From my Gimbal system, which I don't use at the moment). Hopefully this will work better than my old system. I will order some anti-vibraion Foam from hobbyking. But temporally the balls will hopefully do the trick.

My Esc's are aprox. 3 cm away from the FC and my Receiver is Located at a distance of 5 cm.

The Firmware on my GPS is on 1.6. The GPS Protocol is NMEA. The GPS is connected to Serial2. In the Mission planner I get the Error: No GPS Device connected. Please verify it is connected and try again.

@bpopp I can observe the same Error with the altitude in the Mission Planner. In the Flight Data Tab my Altitude readings go up and down. Maybe I haven't shielded it enogh against Light.

Shad0wbreaker commented 10 years ago

Update to the Gps: When connected to my Arduino uno and looking at the serial monitor, i get clear messages. When connected to my FC, on the same Baudrate (57600) i get a bunch of crap. So i don't know what it could be. Maybe a broken Trace on the Quad? :/

bpopp commented 10 years ago

Make sure the black wire is closest to the USB port and that it is black, green, yellow, red. See https://plus.google.com/111330631381457150909/posts/ik3BfRjcqxr

On Thu, Feb 27, 2014 at 1:21 PM, Shad0wbreaker notifications@github.comwrote:

Update to the Gps: When connected to my Arduino uno and looking at the serial monitor, i get clear messages. When connected to my FC, on the same Baudrate (57600) i get a bunch of crap. So i don't know what it could be. Maybe a broken Trace on the Quad? :/

Reply to this email directly or view it on GitHubhttps://github.com/MegaPirateNG/ardupilot-mpng/issues/105#issuecomment-36279976 .

Shad0wbreaker commented 10 years ago

Sadly, still no GPS found. The Arduinos Serial Monitor on Baudrate 38400 still gives out garbage. (I changed the Baudrate of the GPS to 38400 via The miniGps Software) Doesn't change anything. But thanks for your help.

Btw. On the Arduino Uno I have to put the Green Cable to the rx-pin and the Yellow to the Tx pin. In your picture it's the opposite. I don't see any reason why it works with the Uno and not with the FC.

bpopp commented 10 years ago

Yeah, that's normal to reverse the tx and rx pins in FTDI mode, but on your Multiwii, it should be tx-tx, rx-rx. Above you said you were using 57600, but now you are saying 38400. Did you change the baud rate of your GPS via MiniGPS? Whatever baud rate your GPS is transmitting is the baud rate you should tell MPNG to use. Connect your GPS to your arduino and jump through all the baudrates in serial monitor until you see valid GPS messages. Once you've found the correct baud rate, update your SERIAL2_BAUD define to match and reupload.

I know how frustrating it is. I fought with mine for 2 nights. I doubt you have a hardware issue since your GPS seems to be working correctly in FTDI mode.

On Thu, Feb 27, 2014 at 3:25 PM, Shad0wbreaker notifications@github.comwrote:

Sadly, still no GPS found. The Arduinos Serial Monitor on Baudrate 38400 still gives out garbage. (I changed the Baudrate of the GPS to 38400 via The miniGps Software) Doesn't change anything. But thanks for your help.

Btw. On the Arduino Uno I have to put the Green Cable to the rx-pin and the Yellow to the Tx pin. In your picture it's the opposite. I don't see any reason why it works with the Uno and not with the FC.

Reply to this email directly or view it on GitHubhttps://github.com/MegaPirateNG/ardupilot-mpng/issues/105#issuecomment-36293282 .

Shad0wbreaker commented 10 years ago

With the Arduino i messages from the GPS on Baud 38400. I edited the Serial2 baudrate to 38400 in the MPNG code. I reuploaded the code, started the mission planner. And, still no GPS connected. i will check the traces from the Serial2 to the chip tomorrow.

p.s.: My Led's are Blinking like christmas lights. I haven't had this before... Somebody do you what this means?

bpopp commented 10 years ago

Not to be repetitive, but you have your protocol set to NMEA? I know that it's easy to get in trial and error mode and forget that you changed something in order to test something else. It should look like:

// GPS port speed (Serial2) 38400 by default

define SERIAL2_BAUD 38400

// GPS driver selection

define GPS_PROTOCOL GPS_PROTOCOL_NMEA

Make sure that your config matches this, and that your wiring matches the picture I showed earlier. If you have a multimeter, check the voltage on the red wire's pin and the black wire's pin (coming from your MW Pro) and make sure it's around 5v. The blinking LEDS can mean a lot of different things. It depends on when they blink and the frequency.

Another thing you can try is loading the FTDI script to your MW Pro and testing via the serial monitor. You may need to change the script so that it transmits to the correct serial pins (Serial 2) and remember to reverse tx and rx pins. This would rule out or confirm a hardware issue. If that works, it's almost definitely a MPNG configuration problem.

On Thu, Feb 27, 2014 at 3:59 PM, Shad0wbreaker notifications@github.comwrote:

With the Arduino i messages from the GPS on Baud 38400. I edited the Serial2 baudrate to 38400 in the MPNG code. I reuploaded the code, started the mission planner. And, still no GPS connected. i will check the traces from the Serial2 to the chip tomorrow.

p.s.: My Led's are Blinking like christmas lights. I haven't had this before... Somebody do you what this means?

Reply to this email directly or view it on GitHubhttps://github.com/MegaPirateNG/ardupilot-mpng/issues/105#issuecomment-36296900 .

Shad0wbreaker commented 10 years ago

I uploaded the FTDI Script to the WM Pro and then read the Serial on the correct Baud. I connected the Rx to the Rx on the FC and the Tx to the tx on the FC. Nothing came out. So i tried swapping them back (tx-rx and rx-tx). It worked. I get some nice output out of the GPS. So it shouln't be the Voltage nor the Trace.

I will reupload the MPNG code and try again. Hopefully it will work this time!

Thank you for your help :)

motivecodex commented 10 years ago

Any news on this? On MegapirateNG 3.0.1 R3 my GPS worked on baud 57600 and NMEA..

In MegapirateNG 3.0.1 R4: (using the flash tool) on 38400 + NMEA = GPS: No GPS on 57600 + NMEA = GPS: 3D Fix

using the red multiiwii pro from hk + gps.

The problem was: I was indoors. I guess..

Anyway, try these:

  1. If you have an Arduino Uno or something similar, test your GPS to see which baud rate works for it: http://forum.arduino.cc/index.php?topic=216531.msg1583826#msg1583826

//

// minimum test code for serial gps

include SoftwareSerial.h // put < before SoftwareSerial.h and > after it

SoftwareSerial gps(3,4); // RX, TX Connect GPS TX to pi 3 void setup() { Serial.begin(115200); gps.begin(9600); // may be 4800

}

void loop() { if (gps.available()) Serial.write(gps.read()); } // 1a. when TX of GPS to pin 3 1b. volt of GPS to 5v in my case 1c. GRND to GRND 1d. leave 115200 baud rate for serial begin, but change gps.begin to others to test if it works. 1e. upload sketch after each gps baud rate change 1f. while still connected, open serial monitor with ctrl + shift + m and set baud to 115200 at the most right - bottom of the serial monitor screen. Do not change this to anything else. 1g. If you see ASCII text spamming on it, change baud rate in the code again. Mine showed normal text at baud rate 57600 in the code. make sure to test this outside of your house


  1. Follow this before flashing with MPNG: 2a. Arduino - File - Examples - EEPROM - Eeprom clear 2b. connect your board FC to your pc and upload sketch 2c. Download latest DEV version: https://code.google.com/p/multiwii/downloads/list 2d. choose right settings in config.h 2d1.

    define QUADX

    define FFIMUv2 // for the red hobbyking multiiwii pro + gps

    define GPS_SERIAL 2

    define GPS_BAUD 57600 // test with step one which baud rate works.

    define NMEA

    2d2. the rest is not important, so compile and upload sketch


  2. Close Arduino 3a. Open MPNG flash tool 3b. set the right settings 3c. what I have: Board type: HobbyKing Red MultiWii Pro RC Input: Regular PWM on A8-A15 MultiWii APM-Platform: APM:Copter - Quad GPS Type: NMEA GPS Baudrate: 57600 Version: 3.0.1 R4 Serial: COM4 3d. Flash 3d1. If it fails: 3d2. Disconnect FC and close Flash tool 3d3. Remove flash tool folder 3d4. Re-download or re-open flash tool zip 3d5. put all the files into a fresh empty folder 3d6. connect FC, same settings which you chose in 3c and flash again. works 99% of the times with me whenever it fails flashing
  3. Open the latest mission planner and connect (again, try this outside of your house) 4a. Should now show GPS: 3D Fix if all went well

Good luck

Espenf commented 10 years ago

I can confirm that MTK3329 and HKred works with MegapirateNG 3.0.1 R4 and 115200baud. I have the gps connected at Serial 2 tx to rx2 and rx to tx2, just flashed using flashtool, setup for NMEA and 115200. No problem

motivecodex commented 10 years ago

That's strange, 115200 baud rate does not work with my MTK3329 GPS, only 57600.

smurfy commented 10 years ago

That's strange, 115200 baud rate does not work with my MTK3329 GPS, only 57600.

Not sure exactly about the MTK3329, but normally you must set the baudrate on both devices to the same. I found this via google: Readme to change baudrate

motivecodex commented 10 years ago

Thanks Smurfy, but my MTK3329 GPS only works on baud rate 57600. Tested with Arduino UNO and HK red MultiWii Pro. Maybe I received a faulty unit from HK. But HK won't reply to my questions. I will use it at 57600, because it seems to work with 3.0.1 R4.

Espenf commented 10 years ago

I think I changed the baudrate to 115200 on my mtk. If you test with minigps 1.4 or 1.7.1 or gpsfox 079b programs you see what baudrate is working with your mtk. I have the 3DR at 57600 serial 1 and gps at 115200 at serial 2 on the HKRED.

motivecodex commented 10 years ago

I've just ordered a FTDI adapter and will change the baud rate to 115200 with Mini GPS 1.4, and if that doesn't work, with a newer version of Mini GPS. Thanks

UPDATE: Managed to use my Arduino UNO as FTDI adapater and changed the baud rate to 38400. It now works on 38400. I also tried changing the baud rate to 115200, but it does not work. Seems that my MTK 3329 from HK does not support 115200. I flashed both 1.6 and 1.9 on it, same result.