Harakiri aka multiwii port to stm32

RS2K
Posts: 13
Joined: Fri Aug 22, 2014 3:28 am

Re: Harakiri aka multiwii port to stm32

Post by RS2K »

I'm a bit lost on trying to get my GPS to work correctly. It was working on baseflight, but I'm now trying it out on harakiri. With harakiri, I get no indication the GPS is working correctly in MultiWiiGui and the red LED does not light up and blink like it does with baseflight.

Feature GPS is enabled.

I've tried Testcode3_r79 as well as the sept 11 build. I've tried gps_type = 1, gps_type = 0 and gps_type = 4.

gps_baudrate = 115200

The gps is a ublox 6m with 5Hz refresh and a 115200 baudrate.

When enter passgps 2 into the CLI I get strings of blocks and random characters in the terminal. Does this mean it's working?

I'm not sure what do do from here.

strips
Posts: 163
Joined: Thu Apr 03, 2014 1:28 pm

Sv: Harakiri aka multiwii port to stm32

Post by strips »

RS2K wrote:I'm a bit lost on trying to get my GPS to work correctly. It was working on baseflight, but I'm now trying it out on harakiri. With harakiri, I get no indication the GPS is working correctly in MultiWiiGui and the red LED does not light up and blink like it does with baseflight.

Feature GPS is enabled.

I've tried Testcode3_r79 as well as the sept 11 build. I've tried gps_type = 1, gps_type = 0 and gps_type = 4.

gps_baudrate = 115200

The gps is a ublox 6m with 5Hz refresh and a 115200 baudrate.

When enter passgps 2 into the CLI I get strings of blocks and random characters in the terminal. Does this mean it's working?

I'm not sure what do do from here.



If you leave the gps outside for >5min the red light should start to count sats. It starts at 5 sats so 1 blink is 6 sats.

Sounds like you're on to something with passgps. When you get the random characters you can disconnect multiwiiqui or whatever console program you are using and try Ublox ucenter.

Anyways, you need to verify GPS settings in ucenter.

If you are sure it is configured properly with ublox protocol, the correct messages and baud you should use gps_type =1. If you want Harakiri to push config set gps_type = 4. Then set baud to 115200 if your gps is set to that.

Mr-Fiero
Posts: 216
Joined: Sat Apr 05, 2014 3:26 am

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

you have to hit ### in CLI first, otherwise it the mavlink proto you see. Then passgps , then select two on next menu, or whatever baudrate matches. it has a menu so its easy to match.

it sounds like you have everthing correct, now maybe your GPS tx/rx are mixed? does not hurt just to switch the two wires around and see if it starts working. just make sure when you change settings in Harakiri, "save" when done so settings are saved to EEPROM. gps_type = 1 should get you going. Oh, make sure you saved in Ucenter also. Not just send, but you have to tell the GPS to save, or it wont save to EEPROM. Best way to know for sure, if you can connect directly to GPS with your baud in ucenter set to 115200. Make sure Ucenter is not set to autobaud for this test.

You should have GPS. Watch your red light. it will flash once per sec for 5 SV's, and every additional blink is one more SV. So 2 flashes each time means 6 SV's, 3 means 7...fast blink less than 5 and not usable for fix.
Once you have it talking, dont forget to do acc cal, and mag cal, or GPS functions wont work.

If everything does not work, you need to flash your GPS with a config. Just maybe, every message , or the wrong messages have been disabled. just a thought once you are sure about the above two baudrates, and rx/tx in proper pins. gps_type = 1 on original Harakiri has only a few settings pushed, and maybe something else is needed in the config. Does not hurt pushing a config to GPS as a last check if everything else fails.

User avatar
bulesz
Posts: 71
Joined: Mon May 06, 2013 8:03 pm
Location: Hungary EU

Re: Harakiri aka multiwii port to stm32

Post by bulesz »

Guys, is the Naze32 Andriod app working with Harakiri?

Or should use the MW OSD instead?

Cheerz,
B

Mr-Fiero
Posts: 216
Joined: Sat Apr 05, 2014 3:26 am

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

MultiWii EZ-GUI for android is better. The developer has Harakiri compatible updates.

User avatar
bulesz
Posts: 71
Joined: Mon May 06, 2013 8:03 pm
Location: Hungary EU

Re: Harakiri aka multiwii port to stm32

Post by bulesz »

Thanksmate, I'll give a shot for it...

RS2K
Posts: 13
Joined: Fri Aug 22, 2014 3:28 am

Re: Harakiri aka multiwii port to stm32

Post by RS2K »

Thanks. It does seem to be working now. I'm getting 12 satellites according to the blinks. That's the same number my phone is getting.

Using the PIDs for pitch, roll and yaw, and settings for expo and rate I'm getting similar performance in angle, horizon and manual mode as I got in baseflight, except my yaw performance is MUCH better in harakiri.

I went ahead and tried GPS PH and as soon as I switch I loose all throttle control. Once in a while it'll go full throttle. Sometimes it tries to hold altitude violently (throttle either full on if full off it seems). Trying to disarm the quad when in GPS PH is not possible. It continues to either sky rocket or alternate from full throttle and no throttle while trying to hold alt.

What controls the throttle position when in GPS PH?

strips
Posts: 163
Joined: Thu Apr 03, 2014 1:28 pm

Sv: Harakiri aka multiwii port to stm32

Post by strips »

RS2K wrote:Thanks. It does seem to be working now. I'm getting 12 satellites according to the blinks. That's the same number my phone is getting.

Using the PIDs for pitch, roll and yaw, and settings for expo and rate I'm getting similar performance in angle, horizon and manual mode as I got in baseflight, except my yaw performance is MUCH better in harakiri.

I went ahead and tried GPS PH and as soon as I switch I loose all throttle control. Once in a while it'll go full throttle. Sometimes it tries to hold altitude violently (throttle either full on if full off it seems). Trying to disarm the quad when in GPS PH is not possible. It continues to either sky rocket or alternate from full throttle and no throttle while trying to hold alt.

What controls the throttle position when in GPS PH?

Have you covered the barometer with anything. It is very sensitive of propwash and light.

RS2K
Posts: 13
Joined: Fri Aug 22, 2014 3:28 am

Re: Harakiri aka multiwii port to stm32

Post by RS2K »

There is a large piece of open cell foam zip tied to the board. It's covering up the baro. The naze32 board is in the center of a QAV400. It's also a pretty hot setup (4S 1100KV 8x4.5 APC props). The first time I saw it go to full throttle on its own was rather frightening. :o

I'm going to try making some changes and report the results. I don't think I tried the baro by itself with angle mode yet. Since I lost throttle control I didn't think it was the baro causing the problem. The only time I've lost any sort of throttle control in the past was during my tests with baro, mag and angle mode on baseflight. That only occurred during the center stick deadzone though and throttle hold still functioned correctly.

RS2K
Posts: 13
Joined: Fri Aug 22, 2014 3:28 am

Re: Harakiri aka multiwii port to stm32

Post by RS2K »

It's the baro, no the GPS. Baro and Angle mode does the same thing.

I'll start playing around with the baro settings.

RS2K
Posts: 13
Joined: Fri Aug 22, 2014 3:28 am

Re: Harakiri aka multiwii port to stm32

Post by RS2K »

The baro inout looks good in MultiWiiGui.

I tried changing the following:

set p_alt = 100
set i_alt = 30
set d_alt = 80

to

set p_alt = 50
set i_alt = 0
set d_alt = 0


The model is still acting the same, but it's not as severe. It's bouncing up and down full throttle to no throttle and I have no throttle control.

Any ideas? I think I'm going to try reflashing an older version of harakiri.

strips
Posts: 163
Joined: Thu Apr 03, 2014 1:28 pm

Post by strips »

I don't know if the PIDs work the same as multiwii. Look here http://www.multi-rotor.co.uk/index.php?topic=5090.0

Rob can probably answer this best.

Mr-Fiero
Posts: 216
Joined: Sat Apr 05, 2014 3:26 am

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

I had one unit like that. It was vibrations (bad prop and no dampeners) and I had to lower my lpf filter settings to get it to act normal. After that I fixed the vibration anyways. When it was having the issue, it would really jump, just like you say yours is doing.

RS2K
Posts: 13
Joined: Fri Aug 22, 2014 3:28 am

Re: Harakiri aka multiwii port to stm32

Post by RS2K »

strips wrote:I don't know if the PIDs work the same as multiwii. Look here http://www.multi-rotor.co.uk/index.php?topic=5090.0

Rob can probably answer this best.


Thanks! I'll use that info when I get the AH more under control.

Mr-Fiero wrote:I had one unit like that. It was vibrations (bad prop and no dampeners) and I had to lower my lpf filter settings to get it to act normal. After that I fixed the vibration anyways. When it was having the issue, it would really jump, just like you say yours is doing.


The vibrations don't seem too bad when I hold it by hand and throttle up. The clean frame seems to do a pretty good job of isolating the bad vibes. Maybe it's a different story when airborne though. I'll have to check the prop balance when I can. What variables do you recommend I try changing and what do you think I should set them to?


current variables with "lfp" in them and current settings:

set acc_lpfhz = 10.000
set acc_altlpfhz = 10
set acc_gpslpfhz = 15
set gy_lpf = 42


I was thinking about cutting them all in half to begin with and moving them all up one at a time from there.

Baseflight has an option for baro_noise_lpf that harakiri doesn't seem to have.

Mr-Fiero
Posts: 216
Joined: Sat Apr 05, 2014 3:26 am

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

yours is already as low as you want to go.
set acc_lpfhz = 10.000
ESC's not calibrated maybe?
Was this unit running OK with Baseflight?

RS2K
Posts: 13
Joined: Fri Aug 22, 2014 3:28 am

Re: Harakiri aka multiwii port to stm32

Post by RS2K »

I just tried this and it made a world of difference:

set p_alt = 100
set i_alt = 30
set d_alt = 80
set acc_lpfhz = 5.000
set acc_altlpfhz = 5
set acc_gpslpfhz = 7.5


The alt hold is working, but it is sluggish.

I'm going to try upping them to this:

set p_alt = 100
set i_alt = 30
set d_alt = 80
set acc_lpfhz = 7.500
set acc_altlpfhz = 7.5
set acc_gpslpfhz = 10


The ESCs are calibrated. The model worked well in baseflight, but the altitude hold was jumpy. Not horrible, but noticeably jumpy.

RS2K
Posts: 13
Joined: Fri Aug 22, 2014 3:28 am

Re: Harakiri aka multiwii port to stm32

Post by RS2K »

I've just worked my way back up to:

et acc_lpfhz = 10.000
set acc_altlpfhz = 10
set acc_gpslpfhz = 15
set gy_lpf = 42



It's working as it should now. Altitude hold seems to be working about as well as it did on my Naza now, though harakiri is slower to react to requested altitude changes. I'm pretty sure there's a setting to change that though.

I've also managed to get GPS position hold to work, but it's pretty slow to react and will often start overshooting until it starts to oscillate into a toilet bowl maneuver. If I help it find it's hold point with the control stick I can manage to get it to hold pretty well in this evenings light wind.

I need to learn a lot more about this, but here are my current GPS settings (At least the ones I've changed) :


set p_alt = 140
set i_alt = 30
set d_alt = 100
set acc_lpfhz = 10.000
set acc_altlpfhz = 10
set acc_gpslpfhz = 15

set gps_lag = 500
set gps_ph_minsat = 5
set gps_expo = 5
set gps_ph_settlespeed = 200
set gps_maxangle = 35
set gps_ph_brakemaxangle = 25
set gps_ph_minbrakepercent = 50
set gps_ph_brkacc = 400
set gps_wp_radius = 200
set gps_pos_p = 7
set gps_pos_i = 30
set gps_pos_d = 5

I was also able to get ucenter to talk to me GPS using gps_type=1, gps_buadrate = 115200 and the command passgps 0. What kind of settings are there to adjust here?

Mr-Fiero
Posts: 216
Joined: Sat Apr 05, 2014 3:26 am

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

lower gps_expo
I like 5 myself, but your mileage may vary. sometimes i find 0 works because i need it to react faster due to wind in my area.

Also, make sure your PID's have been tuned. A proper tuned machine will hold position better. Gtune in Harakiri works good for finding your P values quickly. having your acclpf so low, indicates a vibration issue possibly, and having it low might make your machine a bit sluggish i think.

Mr-Fiero
Posts: 216
Joined: Sat Apr 05, 2014 3:26 am

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

Today, while flying in PH, I was 30M with 8SV's. while flying, altitude reset to 0 on my OSD again. once at zero, this became my ground reference and altitude reading would gain, or loose as expected, just missing the first 30M. Nothing else reset, at least nothing noticeable. I have to keep an eye on another parameter to see if everything resets, or its just altitude. I have to pick a good parameter as everything else is so dynamic it always updates. I did notice, my distance to home never reset, so thinking about it now its just the altitude.

RS2K
Posts: 13
Joined: Fri Aug 22, 2014 3:28 am

Re: Harakiri aka multiwii port to stm32

Post by RS2K »

Mr-Fiero wrote:lower gps_expo
I like 5 myself, but your mileage may vary. sometimes i find 0 works because i need it to react faster due to wind in my area.

Also, make sure your PID's have been tuned. A proper tuned machine will hold position better. Gtune in Harakiri works good for finding your P values quickly. having your acclpf so low, indicates a vibration issue possibly, and having it low might make your machine a bit sluggish i think.


I'll try the lower GPS expo. It's usually very windy where I fly. My Naza was able to hold in 20 - 30 MPH winds pretty well. I'm hoping I can get to that point with the Naze32 board.

I really like how the machine flies now. I can comfortably flip and roll within the quads body length/width just a few feet up now and the quad seems to handle my normal FPV type flying better than the Naza did... now I just need to get the AP side of things solid (i.e. Position Hold and eventually RTH as a failsafe). The only flight problem I have that I can't figure out how to fix is that giving the machine too much yaw too quickly will cause the machine to rise. My Naza suffered from the same problem though it had much less yaw authority. Example: Full left yaw stick then full right yaw stick will bump the machine up an inch or two. If you keep going back and forth on the yaw the machine will continue to climb.

How exactly do I use gtune? I turn it on when in flight only and fly around like normal and it tunes the P for Yaw, Pitch and Roll? Does it actually change the variables while it's running or do I have to read it's changes and make them myself?

I'm currently using a 6M GPS module. Will I see benefits to upgrading to a better module like the 7M or 8M?

Mr-Fiero
Posts: 216
Joined: Sat Apr 05, 2014 3:26 am

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

Neo6 works good, of course 7 will be a bit faster fix, but myself If i had a 7 or 8, i would change the wideband antenna to a better high gain narrow band, and disable GLONASS. Just me.... Nothing wrong with a 6 series, and there is nothing magical about 7 or 8. If you want faster NAV rates, you can upgrade to 7. I'll eventually upgrade to an 8 series, but for now I'll wait till the prices are better. just my 2 cents.....

while using Gtune, dont have stabilize on, or any flight modes, just acro. I assign it to a switch, take off, activate Gtune, fly, and do some jumps up and down, fly some more, look at it at hover, and click it off. it wont save to eeprom and you have to do a save for that....so what i do, is look at the values on my android via bluetooth, and if they are normal i save.

Of course Crashpilot1000 explained it better in previous pages in this forum. Just read a few pages back.....

RS2K
Posts: 13
Joined: Fri Aug 22, 2014 3:28 am

Re: Harakiri aka multiwii port to stm32

Post by RS2K »

I used gtune in the way you described.

It took my settings from:

p_pitch = 45
i_pitch = 30
d_pitch = 30
p_roll = 45
i_roll = 30
d_roll = 30
p_yaw = 110
i_yaw = 15
d_yaw = 10

to:

p_pitch = 59
i_pitch = 30
d_pitch = 30
p_roll = 36
i_roll = 30
d_roll = 30
p_yaw = 57
i_yaw = 15
d_yaw = 10


It feels OK, but my roll flip rate is now about twice as a fast as my pitch flip rate. I changed the expos to make it feel the same in angle mode. I still find the quad feels a bit odd in manual mode. The control is a too insensitive at low stick movements, too sensitive mid stick and feels good at high stick throws. I think dual rates and less expo will help with that. If not, I'll try putting in a curve instead of expo.



I went back to try getting GPS PH to work. I can't find any settings that are getting me close. It seems like no matter what I do it'll start in a good GPS hold and then start swinging back and forth until it gets into a giant toilet bowl. A high gps_pos_p and low gps_pos_i make the oscillations take longer to start, but they get much stronger quickly once they do. A high gps_pos_i and low gps_pos_p make the oscillations larger. Having both number low makes the position hold stat oscillating quickly, but it takes longer before it becomes fast.

It seems like the position the quad is trying to hold in keeps moving. What determines the hold coordinates? Are accelerometers used at all in GPS PH?

This page makes me believe gps_pos_d does nothing. Is that the case?
viewtopic.php?f=17&t=3269

I have gps_pos_d set to 0 and I have not been changing gps_posr PIDs.

I think I'm going to try this next:

set gps_pos_p = 40
set gps_pos_i = 0
set gps_pos_d = 0
set gps_posr_p = 20
set gps_posr_i = 0
set gps_posr_d = 0

From my understanding this should work pretty well in zero wind. My understanding is that it won't drift with wind, but without gps_pos_i it will always be somewhat downwind of it's target.

RS2K
Posts: 13
Joined: Fri Aug 22, 2014 3:28 am

Re: Harakiri aka multiwii port to stm32

Post by RS2K »

Not much of a difference really. It still overshoots quite a bit.

The quad begins starts to head back to the direction it needs to go by changing its attitude (maybe a 5 degree bank). It stays in the same attitude as it shoots past the hold position and continues on for a good second or two before changing its attitude to head back the way it came (maybe a 7 degree bank this time). It then shoots past the hold location again while still keeping the same attitude. It repeats this pattern at ever increasing over shoot distances and bank angles until I take over or it hits something.

It seems like the GPS is missing something. Maybe it does need a Derivative. If an overshoot happens maybe it should take that into consideration and lower the bank angle on the way back.

lld
Posts: 9
Joined: Sat Feb 23, 2013 7:39 am

Re: Harakiri aka multiwii port to stm32

Post by lld »

Hello all,

I am flying a HK Talon tricopter, equipped with a Naze32 v4 running Harakiri version 9 or so. It also had GPS (Ublox6M) on which I loaded a configuration which I found here somewhere.

The GPS functions where working, but not fantastic. Some drifting and toilet bowling in certain situations.

After not using it for a long time, I decide to load the latest version of Harakiri: testcode3 september 11 (viewtopic.php?f=23&t=3524&start=1000#p56065)

It was flying well and also the GPS got recognized. When trying it on the flying field none of the GPS functions where actually working. GPS hold or RTH where both doing nothing, despite the fact that the blinking lights on the NAZE indicate there are plenty satellites

After checking I found out that although there are plenty of satellites, in most cases there is no fix or only one. As I in between move to a new location (South India) I though that a new almanac had to be loaded so I left it running several hours with no more fixes.

The tab "PASSGPS" in baseflight configurator also shows there very little is coming in (see pic). The location is correct and actually quite accurate.

Funny enough, when I connect the Ublox center to the Naze and use the PASSGPS function, it shows that there is a solid 3D fix with good precision. (see pic)

Just to be sure hat it was not caused by the previous configuration setting in the GPS, I loaded the one provided by mr. Fiero here: viewtopic.php?f=23&t=3524&start=1000#p56027


Is there anyone who has an idea what this can be ?
Attachments
Unblox center using passgps function
Unblox center using passgps function
PASSGPS tab in baseflight configurator
PASSGPS tab in baseflight configurator
the position is good, but no more fix than 1 and home location etc is not getting locked. Satellite icon in blinking red/green.
the position is good, but no more fix than 1 and home location etc is not getting locked. Satellite icon in blinking red/green.

lld
Posts: 9
Joined: Sat Feb 23, 2013 7:39 am

Re: Harakiri aka multiwii port to stm32

Post by lld »

short update:

Tried a "virgin" GPS sensor which did not have and configuration done. Same issue

here is my dump:

# dump
Config:
FW: HarakiriSG pre2.6 TestCode3Sep 11 2014 / 23:05:21
ID|AUXCHAN : 01 02 03 04
00|ANGLE : LM- --H --- ---
01|HORIZON : --- --- --- ---
02|BARO : L-- --H --- --H
03|MAG : L-- --H -M- ---
04|CAMSTAB : --- --- --- ---
05|ARM : --- --- --- ---
06|GPS HOME: --- --H --- ---
07|GPS HOLD: L-- --- --- ---
08|GPS AUTO: --- --- --- ---
09|PASSTHRU: --- --- --- ---
10|HEADFREE: --- --- --H ---
11|BEEPER : --- --- --- ---
12|HEADADJ : --- --- --- ---
13|OSD SW : --- --- --- ---
14|GTUNE : --- --- --- ---
Current mixer: TRI
Custom mixer:
Motor Thr Roll Pitch Yaw
Sanity check: OK OK OK
Enabled features: PPM GPS
Current assignment: AETR1234
Current settings:
rc_db = 20
rc_dbyw = 20
rc_dbah = 50
rc_dbgps = 5
rc_trm_rll = 0.000
rc_trm_ptch = 0.000
rc_minchk = 1100
rc_mid = 1520
rc_maxchk = 1900
rc_lowlat = 1
rc_rllrm = 0
rc_killt = 0
rc_flpsp = 0
rc_motor = 0
rc_auxch = 4
rc_rate = 100
rc_expo = 80
thr_mid = 50
thr_expo = 0
roll_pitch_rate = 0
yawrate = 0
rc_oldyw = 0
devorssi = 0
rssicut = 0
gt_loP_rll = 20
gt_loP_ptch = 20
gt_loP_yw = 20
gt_hiP_rll = 70
gt_hiP_ptch = 70
gt_hiP_yw = 70
gt_pwr = 0
esc_min = 1100
esc_max = 1950
esc_nfly = 1300
esc_nwmx = 1
esc_moff = 1000
esc_pwm = 400
srv_pwm = 50
pass_mot = 0
fs_delay = 10
fs_ofdel = 200
fs_rcthr = 1200
fs_ddplt = 0
fs_jstph = 0
fs_nosnr = 1
serial_baudrate = 115200
tele_prot = 0
spektrum_hires = 0
vbatscale = 110
vbatmaxcellvoltage = 43
vbatmincellvoltage = 33
power_adc_channel = 0
tri_ydir = -1
tri_ymid = 1520
tri_ymin = 1020
tri_ymax = 2000
tri_ydel = 0
wing_left_min = 1020
wing_left_mid = 1500
wing_left_max = 2000
wing_right_min = 1020
wing_right_mid = 1500
wing_right_max = 2000
pitch_direction_l = 1
pitch_direction_r = -1
roll_direction_l = 1
roll_direction_r = 1
gbl_flg = 1
gbl_pgn = 10
gbl_rgn = 10
gbl_pmn = 1020
gbl_pmx = 2000
gbl_pmd = 1500
gbl_rmn = 1020
gbl_rmx = 2000
gbl_rmd = 1500
al_barolr = 50
al_snrlr = 50
al_debounce = 5
al_tobaro = 2000
al_tosnr = 1000
as_lnchr = 200
as_clmbr = 100
as_trgt = 0
as_stdev = 10
align_gyro_x = 0
align_gyro_y = 0
align_gyro_z = 0
align_acc_x = 0
align_acc_y = 0
align_acc_z = 0
align_mag_x = 0
align_mag_y = 0
align_mag_z = 0
align_board_yaw = 0
acc_hdw = 2
acc_lpfhz = 10.000
acc_altlpfhz = 10
acc_gpslpfhz = 15
gy_lpf = 42
gy_gcmpf = 700
gy_mcmpf = 200
gy_smrll = 0
gy_smptc = 0
gy_smyw = 0
gy_stdev = 5
accz_vcf = 0.985
accz_acf = 0.960
bar_lag = 0.300
bar_dscl = 0.700
bar_dbg = 0
mag_dec = -135
mag_time = 1
mag_gain = 0
gps_baudrate = 115200
gps_type = 1
gps_ins_vel = 0.600
gps_lag = 2000
gps_ph_minsat = 6
gps_expo = 20
gps_ph_settlespeed = 10
gps_maxangle = 35
gps_ph_brakemaxangle = 15
gps_ph_minbrakepercent = 50
gps_ph_brkacc = 40
gps_wp_radius = 200
rtl_mnh = 0
rtl_cr = 80
rtl_mnd = 0
gps_rtl_flyaway = 0
gps_yaw = 30
nav_rtl_lastturn = 1
nav_speed_min = 100
nav_speed_max = 350
nav_approachdiv = 3
nav_tiltcomp = 30
nav_ctrkgain = 0.500
nav_controls_heading = 0
nav_tail_first = 0
stat_clear = 1
gps_pos_p = 10
gps_pos_i = 40
gps_pos_d = 0
gps_posr_p = 70
gps_posr_i = 0
gps_posr_d = 100
gps_nav_p = 15
gps_nav_i = 0
gps_nav_d = 0
looptime = 3000
mainpidctrl = 0
maincuthz = 12
gpscuthz = 45
p_pitch = 52
i_pitch = 30
d_pitch = 30
p_roll = 52
i_roll = 30
d_roll = 30
p_yaw = 50
i_yaw = 45
d_yaw = 10
p_alt = 100
i_alt = 30
d_alt = 80
p_level = 80
i_level = 10
d_level = 50
snr_type = 3
snr_min = 30
snr_max = 200
snr_dbg = 0
snr_tilt = 18
snr_cf = 0.500
snr_diff = 0
snr_land = 1
LED_invert = 0
LED_Type = 1
LED_pinout = 1
LED_ControlChannel = 8
LED_ARMED = 0
LED_Toggle_Delay1 = 8
LED_Toggle_Delay2 = 8
LED_Toggle_Delay3 = 8
LED_Pattern1 = 1300
LED_Pattern2 = 1800
LED_Pattern3 = 1900

#

squirlier
Posts: 1
Joined: Sun Sep 21, 2014 8:03 pm

Re: Harakiri aka multiwii port to stm32

Post by squirlier »

Mr-Fiero wrote:OK, I compiled with your defaults Rob, only replacing the drv_gps.c . Gtune is working fine again from your master repo.

Anyone want to help me test? here it is for anyone who is interested. This HEX has a modified drv_gps.c file, and its only an experiment at this point. my own experiment to try to enhance the Ublox GPS engines the best I can. The real magic of course of anything working with GPS is Harakiri (and MultiWii). I'm just trying to get the Ublox to work a bit better.

set gps_type = 1 will use the new Ubx protocol settings/tweaks so no GPS programming should be required via Ucenter
but you still have to set your own settings in Harakiri and have a tuned machine before testing GPS functions.

Backup your known working settings if you are already tuned.
once flashed, put your settings back into your FC
also, make sure mag calibration, and acc are done, or GPS functions will not enable
use a map before flying, on your gui, and see if it looks like it has less deviation. Also, you can tell if its updating NAV rates fast as this config has updates at 5.95Hz.
It wont matter the generation of Ublox you have, your GPS will take these configs fine as they apply to all Ublox. I dont do anything to newer GLONASS so dont worry.

Remember, everyone, this file is only for ones who are interested in trying something new. Dont risk your machine if you cannot beta test. I have flown on the new GPS configs myself, but further testing is needed. I however have not flown on this newest hex file, but it did compile correctly and is working on my 450 with Gtune working as well. It seems to be working. Only waiting for the weekend to test more.

If anyone does test, let me know if it was a tighter PH than usual on your machine. My hopes are if it works better for everyone, maybe it will make its way into Harakiri master repo.



Hello, I am New here but i´ve had to register to tell my experiences.
First i am from Germany so my good results are not for everyone one the world.

what i have changed so far:
GPS_LAG to 1000
GPS max speed to 550 ( or what that was called.)
some pid things gps and normal

I was very impressed of the modded gps injection code from mr-fiero.
i tested it and everything worked like it should. PH very stable ( for me)
the summer 2.5 had tbe and wired other things with gps.

my gps is very stable and for whatever reason my mag is working very good now.
i had some probs wit every version above summer 2.5. it did not show the correct direction but now
it is very good. (does not have something to do with gps but works now)
maybe it is his testcode3 compile what is better than the other testcode r versions i´ve tested the last time.

so i have to say thank you.

I would like to explain what i´ve seen:
if i hit PH in any flight condition ( not flipping or any other stunts ;-) ) it will fly just a little distance and then it will break and hold there. very nice. even in wind.
i have no more drift at the RTH to AL switchpoint..earlyer versions i had some problems there. it switches from rth to PH an AL but the PH was not where it should be it got pushes with the wind till it HOLDS or never hold and just AL with windspeed.
NOW it is just perfect.

While in PH i can flay around ( slow or fast) and it will hold near the position where i let the stick alone. just a little drift but then snaps and holds.
also with PH and BARO i can now go up and then down by comming back to the initial posotion.
very well.

i have the NEO 6. preprogrammed but now overrided by GPSTYPE 1
I Have build a Shield with DEPRON and ALUMINIUM foil. that makes the GPS MUCH more stable and i get 11 SAT´s.
before that i was lucky when i got 6 or 7 sat.
my oled shows sometimes 13 but that is not tooo often.

Well, i hope everybody understands what i am talking about. it´s not easy for me to describe something.

btw: I have a X-Quad with the following dimensions :
square 230mm x 230mm
weigth without cam: 840g incl. 3S 3700 and another 80 gr. for camera.
flighttime about 13-14 min.
with 4000 about 17-18 min. ( filmed an available if requested.)

Spotter6
Posts: 63
Joined: Thu Sep 18, 2014 3:16 am

Re: Harakiri aka multiwii port to stm32

Post by Spotter6 »

Hello, a dumb question here...

I was not able to Motor Arm with the left stick (mode 2) Down-Right, as I could with BaseFlight and CleanFlight. The only way for me to arm was to set an Aux Switch to it.

Is it possible?

I use
rc_mid = 1520 (Taranis like)
rc_minchk = 1150
rc_maxchk = 1850

sticks can swing from 1108 to 1930.

Mr-Fiero
Posts: 216
Joined: Sat Apr 05, 2014 3:26 am

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

@ lld

Did you do all your calibrations? mag cal is important on the FC otherwise no GPS functions will work. also do a Acc cal. Having no GPS functions indicates this was not done. Something should of worked for you if everything is OK. It should of at minimum, tried to PH, good or bad......

when you were playing in the gui, if you click set map it will bring your position map up.

anyways, watch the blinks on your FC. after boot seq, it will be a fast flash if you are in stabilize and no fix. once the led starts to flash slow, once per time, it means 5 SV's. every additional flash is another SV so 2 flashes is 6 SV's. and so on.

If all your calibrations are done, and your FC is flashing a fix with 6SV's or higher, GPS functions will work.

FYI, the only thing my file wont do for GPS , is set the GPS baud. Something I wish it would do is autobaud, but its not working, so as long as your GPS has been pre-programmed for 115200 buad, then everything will work fine for GPS config push.
Last edited by Mr-Fiero on Mon Sep 22, 2014 5:55 am, edited 4 times in total.

Mr-Fiero
Posts: 216
Joined: Sat Apr 05, 2014 3:26 am

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

@ squirlier

Thank you for the positive report, I am glad you are seeing better GPS functions! you could reduce gps lag to 500, but if everything is good, then I guess the best thing is to leave it.

Mr-Fiero
Posts: 216
Joined: Sat Apr 05, 2014 3:26 am

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

@ RS2K
Any more luck? If your unit is tuned and feels good with the Gtune, and your own settings, then now you can focus on the gps settings. Maybe your hold rate it a bit high. What is your gps_lag setting? The fact your errors are amplifying something is overshooting, or delayed in position updates.

Mr-Fiero
Posts: 216
Joined: Sat Apr 05, 2014 3:26 am

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

I have a camera unit that I have still on Testcode3 older revision. I have not updated it because this unit is a perfect PH every time. I mean really perfect. I am going to post its settings because I use the settings as a baseline for my other multicopters. I do however use the same GPS settings as posted in the firmware I posted, as they are programmed into the GPS. So on this unit, its set to gps_type = 4 .

Someday, I'll re-flash this unit, but its working too good right now to change. Maybe someone can use this FC config to compare.

Code: Select all

Current settings:
rc_db = 15
rc_dbyw = 20
rc_dbah = 50
rc_dbgps = 5
rc_trm_ptch =  0.000
rc_trm_rll =  24.000
rc_minchk = 1100
rc_mid = 1500
rc_maxchk = 1900
rc_lowlat = 1
rc_rllrm = 0
rc_killt = 0
rc_flpsp = 0
rc_motor = 0
rc_auxch = 4
rc_rate = 95
rc_expo = 75
thr_mid = 60
thr_expo = 0
roll_pitch_rate = 0
yawrate = 0
devorssi = 0
rssicut = 0
esc_min = 1100
esc_max = 1950
esc_nfly = 1300
esc_nwmx = 1
esc_moff = 1000
esc_pwm = 480
srv_pwm = 50
pass_mot = 0
fs_delay = 10
fs_ofdel = 200
fs_rcthr = 1200
fs_ddplt = 0
fs_jstph = 0
fs_nosnr = 1
serial_baudrate = 57600
tele_prot = 2
spektrum_hires = 0
vbatscale = 110
vbatmaxcellvoltage = 43
vbatmincellvoltage = 33
power_adc_channel = 0
tri_ydir = 1
tri_ymid = 1500
tri_ymin = 1020
tri_ymax = 2000
tri_ydel = 0
wing_left_min = 1020
wing_left_mid = 1500
wing_left_max = 2000
wing_right_min = 1020
wing_right_mid = 1500
wing_right_max = 2000
pitch_direction_l = 1
pitch_direction_r = -1
roll_direction_l = 1
roll_direction_r = 1
gbl_flg = 1
gbl_pgn = 10
gbl_rgn = 10
gbl_pmn = 1020
gbl_pmx = 2000
gbl_pmd = 1500
gbl_rmn = 1020
gbl_rmx = 2000
gbl_rmd = 1500
al_barolr = 50
al_snrlr = 50
al_debounce = 5
al_tobaro = 2000
al_tosnr = 1000
as_lnchr = 200
as_clmbr = 100
as_trgt = 0
as_stdev = 10
align_gyro_x = 0
align_gyro_y = 0
align_gyro_z = 0
align_acc_x = 0
align_acc_y = 0
align_acc_z = 0
align_mag_x = 0
align_mag_y = 0
align_mag_z = 0
acc_hdw = 2
acc_lpfhz =  20.000
acc_altlpfhz = 10
acc_gpslpfhz = 15
gy_lpf = 42
gy_gcmpf = 700
gy_mcmpf = 200
gy_smrll = 0
gy_smptc = 0
gy_smyw = 0
gy_stdev = 5
accz_vcf =  0.990
accz_acf =  0.960
bar_lag =  0.300
bar_dscl =  0.700
bar_dbg = 0
mag_dec = 1338
mag_time = 2
mag_gain = 0
gps_baudrate = 115200
gps_type = 4
gps_ins_vel =  0.500
gps_lag = 500
gps_ph_minsat = 6
gps_expo = 0
gps_ph_settlespeed = 200
gps_maxangle = 35
gps_ph_brakemaxangle = 20
gps_ph_minbrakepercent = 50
gps_ph_brkacc = 40
gps_wp_radius = 200
rtl_mnh = 0
rtl_cr = 80
rtl_mnd = 0
gps_rtl_flyaway = 0
gps_yaw = 30
nav_rtl_lastturn = 1
nav_speed_min = 100
nav_speed_max = 350
nav_approachdiv = 3
nav_tiltcomp = 30
nav_ctrkgain =  0.500
nav_controls_heading = 0
nav_tail_first = 0
stat_clear = 1
gps_pos_p = 6
gps_pos_i = 40
gps_pos_d = 0
gps_posr_p = 65
gps_posr_i = 0
gps_posr_d = 100
gps_nav_p = 10
gps_nav_i = 0
gps_nav_d = 0
looptime = 3000
mainpidctrl = 0
maincuthz = 12
gpscuthz = 45
p_pitch = 36
i_pitch = 30
d_pitch = 30
p_roll = 36
i_roll = 30
d_roll = 30
p_yaw = 60
i_yaw = 45
d_yaw = 0
p_alt = 120
i_alt = 30
d_alt = 40
p_level = 110
i_level = 10
d_level = 50
snr_type = 3
snr_min = 30
snr_max = 200
snr_dbg = 0
snr_tilt = 18
snr_cf =  0.500
snr_diff = 0
snr_land = 1
LED_invert = 0
LED_Type = 1
LED_pinout = 1
LED_ControlChannel = 8
LED_ARMED = 0
LED_Toggle_Delay1 = 8
LED_Toggle_Delay2 = 8
LED_Toggle_Delay3 = 8
LED_Pattern1 = 1300
LED_Pattern2 = 1800
LED_Pattern3 = 1900


strips
Posts: 163
Joined: Thu Apr 03, 2014 1:28 pm

Sv: Harakiri aka multiwii port to stm32

Post by strips »

Mr-Fiero wrote:I have a camera unit that I have still on Testcode3 older revision. I have not updated it because this unit is a perfect PH every time. I mean really perfect. I am going to post its settings because I use the settings as a baseline for my other multicopters. I do however use the same GPS settings as posted in the firmware I posted, as they are programmed into the GPS. So on this unit, its set to gps_type = 4 .

Someday, I'll re-flash this unit, but its working too good right now to change. Maybe someone can use this FC config to compare.

Code: Select all

Current settings:
rc_db = 15
rc_dbyw = 20
rc_dbah = 50
rc_dbgps = 5
rc_trm_ptch =  0.000
rc_trm_rll =  24.000
rc_minchk = 1100
rc_mid = 1500
rc_maxchk = 1900
rc_lowlat = 1
rc_rllrm = 0
rc_killt = 0
rc_flpsp = 0
rc_motor = 0
rc_auxch = 4
rc_rate = 95
rc_expo = 75
thr_mid = 60
thr_expo = 0
roll_pitch_rate = 0
yawrate = 0
devorssi = 0
rssicut = 0
esc_min = 1100
esc_max = 1950
esc_nfly = 1300
esc_nwmx = 1
esc_moff = 1000
esc_pwm = 480
srv_pwm = 50
pass_mot = 0
fs_delay = 10
fs_ofdel = 200
fs_rcthr = 1200
fs_ddplt = 0
fs_jstph = 0
fs_nosnr = 1
serial_baudrate = 57600
tele_prot = 2
spektrum_hires = 0
vbatscale = 110
vbatmaxcellvoltage = 43
vbatmincellvoltage = 33
power_adc_channel = 0
tri_ydir = 1
tri_ymid = 1500
tri_ymin = 1020
tri_ymax = 2000
tri_ydel = 0
wing_left_min = 1020
wing_left_mid = 1500
wing_left_max = 2000
wing_right_min = 1020
wing_right_mid = 1500
wing_right_max = 2000
pitch_direction_l = 1
pitch_direction_r = -1
roll_direction_l = 1
roll_direction_r = 1
gbl_flg = 1
gbl_pgn = 10
gbl_rgn = 10
gbl_pmn = 1020
gbl_pmx = 2000
gbl_pmd = 1500
gbl_rmn = 1020
gbl_rmx = 2000
gbl_rmd = 1500
al_barolr = 50
al_snrlr = 50
al_debounce = 5
al_tobaro = 2000
al_tosnr = 1000
as_lnchr = 200
as_clmbr = 100
as_trgt = 0
as_stdev = 10
align_gyro_x = 0
align_gyro_y = 0
align_gyro_z = 0
align_acc_x = 0
align_acc_y = 0
align_acc_z = 0
align_mag_x = 0
align_mag_y = 0
align_mag_z = 0
acc_hdw = 2
acc_lpfhz =  20.000
acc_altlpfhz = 10
acc_gpslpfhz = 15
gy_lpf = 42
gy_gcmpf = 700
gy_mcmpf = 200
gy_smrll = 0
gy_smptc = 0
gy_smyw = 0
gy_stdev = 5
accz_vcf =  0.990
accz_acf =  0.960
bar_lag =  0.300
bar_dscl =  0.700
bar_dbg = 0
mag_dec = 1338
mag_time = 2
mag_gain = 0
gps_baudrate = 115200
gps_type = 4
gps_ins_vel =  0.500
gps_lag = 500
gps_ph_minsat = 6
gps_expo = 0
gps_ph_settlespeed = 200
gps_maxangle = 35
gps_ph_brakemaxangle = 20
gps_ph_minbrakepercent = 50
gps_ph_brkacc = 40
gps_wp_radius = 200
rtl_mnh = 0
rtl_cr = 80
rtl_mnd = 0
gps_rtl_flyaway = 0
gps_yaw = 30
nav_rtl_lastturn = 1
nav_speed_min = 100
nav_speed_max = 350
nav_approachdiv = 3
nav_tiltcomp = 30
nav_ctrkgain =  0.500
nav_controls_heading = 0
nav_tail_first = 0
stat_clear = 1
gps_pos_p = 6
gps_pos_i = 40
gps_pos_d = 0
gps_posr_p = 65
gps_posr_i = 0
gps_posr_d = 100
gps_nav_p = 10
gps_nav_i = 0
gps_nav_d = 0
looptime = 3000
mainpidctrl = 0
maincuthz = 12
gpscuthz = 45
p_pitch = 36
i_pitch = 30
d_pitch = 30
p_roll = 36
i_roll = 30
d_roll = 30
p_yaw = 60
i_yaw = 45
d_yaw = 0
p_alt = 120
i_alt = 30
d_alt = 40
p_level = 110
i_level = 10
d_level = 50
snr_type = 3
snr_min = 30
snr_max = 200
snr_dbg = 0
snr_tilt = 18
snr_cf =  0.500
snr_diff = 0
snr_land = 1
LED_invert = 0
LED_Type = 1
LED_pinout = 1
LED_ControlChannel = 8
LED_ARMED = 0
LED_Toggle_Delay1 = 8
LED_Toggle_Delay2 = 8
LED_Toggle_Delay3 = 8
LED_Pattern1 = 1300
LED_Pattern2 = 1800
LED_Pattern3 = 1900


Great! I hope to have my rebuilt Nemesis ready today or tomorrow. Waiting for a printed gps mount. Having moved the battery under the quad I hope the mag will behave. I'll do a diff on your setup.

I have also re-mounted the rubber bobbins and put some foam in between to stiffen it like you suggested (think it was you). It should be soft enough to take care of high freq vibs.

lld
Posts: 9
Joined: Sat Feb 23, 2013 7:39 am

Re: Harakiri aka multiwii port to stm32

Post by lld »

Please disregard completely my post above regarding non-working GPS functions.

Learned a few things:

- read and follow the instructions ! Did not do the mag calibration and I was not aware that before that the GPS related functions are disabled

- the home/satellite window in BaseflightGui is only fully active when the copter is being armed, so i was under the wrong impression that the GPS was not working

After trying multiple GPS sensors, flashed both Harakiri and Baseflight I now have it figured out.

With the mentioned testcode 3 the pos hold was doing quite well in the garden with only few satellites. Will do more testing tomorrow

Ro

Mr-Fiero
Posts: 216
Joined: Sat Apr 05, 2014 3:26 am

Re: Sv: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

strips wrote:I have also re-mounted the rubber bobbins and put some foam in between to stiffen it like you suggested (think it was you). It should be soft enough to take care of high freq vibs.

Yep, it was me, and actually this config is the unit for the camera, that has the foam in between the rubber dampeners. It acts perfect. I was out using it this weekend to video my friend flying his plane and it was a dead still PH every battery. Its very impressive PH. Yea, thanks Harakiri :)

One time this weekend I had an issue with a bullet connector (go figure) and landed when a motor was cutting in and out. It flipped landing hard on the ground wrong side up, lol. after that it was oscillating back and forth again. When I looked at it, two of the rubbers came disconnected, and the foam was loose. Fixed it quickly and everything was perfect once the foam was in the proper place. It works well in a pinch. I suspect it will clear up your issues as well.

Hope your up flying soon!
Last edited by Mr-Fiero on Mon Sep 22, 2014 3:56 pm, edited 2 times in total.

Mr-Fiero
Posts: 216
Joined: Sat Apr 05, 2014 3:26 am

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

I had an eye opener. I think that every now and then we need a reminder that anything can happen.

I have had so much success with Harakiri firmware. I just don't have any issues related to FC anymore. I have one junker multicopter that has been flying approx 10 to 30 hours a week, for about a year now. Its got allot of miles on it. I wish my GPS would do odometer!

Anyways, lately I have realized my range is more than 2.5KM so I have been going on missions.... When I fly, I always keep an eye on the ground below with the though, if anything happens, where would it fall? I mean, always worse case has already been planned. So I stay centered to empty roads, ditches, fields, and never fly above people, or near people.... only myself, lol....

So while I was going on a mission that was only half the distance I usually travel I was showing my friend the sky view of our town. He was impressed. We continued to fly as when I showed him he was flying his plane and had to re-focus on it. All of a sudden he heard me say "oh,oh". He asked what and I showed him my screen flipping around and around, unresponsive to any controls including throttle. I did know I was going to probably land in a very open area, but did not want to know what it was going to look like after dropping 150M with an AUW of 1600g.

Anyways, I drove to the area with my TX with hope the battery was still operational, or at least either the OpenLRS was sending a beacon, or the video would still be running. I did eventually find a weak video. Finally started to close into the signal. I was getting close.

But then, I saw a hand reach down and pick up my unit and start walking. NOooooo, My video tx was now getting weaker. Damn, so I enlarged my circle again. After some time, and watching someones feet walking and walking, I found an area where the video was stronger. After some time the person finally set the unit down. I kept driving around and then my video got really good. I looked around out my window to find it sitting in the middle of a sidewalk. So I stopped and the people who found it came out of their house. (I think he was getting his wife to tell her "look what I found fall from the sky". - It was someone I knew. He said, "I knew it was you, who else?". I should point out I don't see this guy too much, or hardly at all, but he is a great guy. (I live in a town of 7000) I was glad to recover the unit! I think maybe most of my town knows its me flying by now.

When I got the unit home, I started to rebuild it. One of the two lipos had been crushed and released through a small hole (garbage). all arms needed replace as well as motor mounts, but that's it. I figured if I rebuilt the unit I might find the cause of a motor dropping. The fellow who found it told me that one motor was not turning when he found it, so at least I had a starting point. While rebuilding the unit I found a wire soldered to the bullet had broken off before the solder joint. My wires are secure, and have some give, but for some reason it just failed before the connection. It was not noticeable visibly because the failed wire was covered with heat shrink and even felt as if it was still connected.

Now, you have to understand how reliable this unit has seemed to be, its my favorite, but its a junker and does not owe me anything. No matter what, you always have to plan on the worse. This was just a reminder for me. Its a good reminder because I was feeling way to confident since I have had so much success with Harakiri. I have had no incidents related to firmware at all. No sky drops at random like other FC firmwares...... But, yep, just need to remember, anything can happen.

PS - the unit is flying again perfectly. I figure I put 20KM on it since the rebuild.
Last edited by Mr-Fiero on Mon Sep 22, 2014 5:46 pm, edited 4 times in total.

Mr-Fiero
Posts: 216
Joined: Sat Apr 05, 2014 3:26 am

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

@ lld
make sure also to properly set mag_dec and re-do mag calibration after. Otherwise PH will probably circle.
look in the middle of this page. Crashpilot1000 explains mag_dec - viewtopic.php?f=23&t=3524&start=850

Mr-Fiero
Posts: 216
Joined: Sat Apr 05, 2014 3:26 am

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

OK, I did receive the GPS's from ready to fly quads.
http://witespyquad.gostorego.com/ublox- ... plane.html

after testing these units, I have had very poor results. To date I have never seen so much deviation, even with custom settings. They are really sensitive for the antenna they contain, but they are twice as much deviation as my NEO6m with 25mm antenna. They do however cold start really fast.

I am however going to still try to fly with it, and see how it performs with Harakiri.

Spotter6
Posts: 63
Joined: Thu Sep 18, 2014 3:16 am

Re: Harakiri aka multiwii port to stm32

Post by Spotter6 »

Thanks for sharing the settings, Mr. Fiero.

I'm getting much closer to GPS PH now, still a little toilet bowling Clock-wise. I'm at -5d57' of declination. I entered it as -557. Oops.
Just now trying -0557. I think that's the problem!

Question: do you arm the motors with the stick control or the Aux switch ?

I enjoyed reading your story!!

Mr-Fiero
Posts: 216
Joined: Sat Apr 05, 2014 3:26 am

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

Spotter6 wrote:Question: do you arm the motors with the stick control or the Aux switch ?


I arm with a dedicated switch. I have not missed the down/right combination, but I guess if I had less than 9ch I would of. So I have no advice if down/right would be possible to setup in Harakiri.

@ Crashpilot1000
is down/right ARM possible with Harakiri?

Spotter6
Posts: 63
Joined: Thu Sep 18, 2014 3:16 am

Re: Harakiri aka multiwii port to stm32

Post by Spotter6 »

Thx! I thought I may have set min/max incorrectly so it could not detect down/right ARM.

Also, setting gps_type = 4 rather than 1 made much faster gps sat locks for me.

My gps unit is the cheap $18 one neo6 from witespy.

Mr-Fiero
Posts: 216
Joined: Sat Apr 05, 2014 3:26 am

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

Spotter6 wrote:.
My gps unit is the cheap $18 one neo6 from witespy.

Well, maybe I got a bad GPS... I have two more, so I will re-test since you say yours works well. Your faster fix is because its probably relaxed settings in the config. if it locks good, then leave it where it works. If not then try gps_type = 1 if you are using my build of firmware with the custom drv_gps file and see if its tighter (download/file.php?id=3176). or, my GPS config posted in this forum to save via Ucenter, and gps_type = 4. (download/file.php?id=3161) - remember if using Ucenter, to save to EEPROM. Either way works for the config.

Spotter6
Posts: 63
Joined: Thu Sep 18, 2014 3:16 am

Re: Harakiri aka multiwii port to stm32

Post by Spotter6 »

Regarding Mag_dec, it turns out that whether I entered it (-5d57') as -557 or -0557 it would store as -557, as seen on the "set" command from CLI.

I've tuned mine P's with Gtune. And it's flying VERY VERY nicely. {F330 frame, DJI 30A opto and Red motors that have ceramic bearings, 8" 8045 DJI props]

In any case, GPS HOLD + Baro combo is much better staying in one place for about 45seconds than it drifts away. I'm trying to think whether I missed something.....
It's starting to rain/thunder now, so all I can do is reviewing what I did.

Toilet Bowl occurs when gps_pos_p is excessively high, after you've got your mag_dec correctly set and mag calibrated.

FWIW, my more relevant parameters:
mag_dec = -557
mag_time = 2
mag_gain = 0
gps_baudrate = 115200
gps_type = 4
gps_ins_vel = 0.500
gps_lag = 500
gps_ph_minsat = 6
gps_expo = 0
gps_ph_settlespeed = 200
gps_maxangle = 35
gps_ph_brakemaxangle = 20
gps_ph_minbrakepercent = 50
gps_ph_brkacc = 40
gps_wp_radius = 200
rtl_mnh = 0
rtl_cr = 80
rtl_mnd = 0
gps_rtl_flyaway = 0
gps_yaw = 30
nav_rtl_lastturn = 1
nav_speed_min = 100
nav_speed_max = 350
nav_approachdiv = 3
nav_tiltcomp = 30
nav_ctrkgain = 0.500
nav_controls_heading = 0
nav_tail_first = 0
stat_clear = 1
gps_pos_p = 6
gps_pos_i = 40
gps_pos_d = 0
gps_posr_p = 65
gps_posr_i = 0
gps_posr_d = 100
gps_nav_p = 10
gps_nav_i = 0
gps_nav_d = 0
looptime = 3000
--------
p_pitch = 66
i_pitch = 32
d_pitch = 26
p_roll = 40
i_roll = 32
d_roll = 26
p_yaw = 32
i_yaw = 45
d_yaw = 0
p_alt = 120
i_alt = 30
d_alt = 40
p_level = 110
i_level = 10
d_level = 50
-----------------------

What is GPS HOME and GPS AUTO modes ?

Mr-Fiero
Posts: 216
Joined: Sat Apr 05, 2014 3:26 am

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

@ Spotter6

I dont notice anything strange about your settings... they look pretty good to me.

Maybe, just get your gui map going and watch what your GPS looks like over a bit of time. See how much your deviation is on the gui. Try increasing your groundplane under the GPS with something as simple as tin-foil just for a test. Now, you have me thinking again that I was right about those GPS's having deviation. But I will be confirming with the other two units I have from whitespy.

Spotter6
Posts: 63
Joined: Thu Sep 18, 2014 3:16 am

Re: Harakiri aka multiwii port to stm32

Post by Spotter6 »

Mr-Fiero wrote:@ Spotter6

.... Try increasing your groundplane under the GPS with something as simple as tin-foil just for a test. Now, you have me thinking again that I was right about those GPS's having deviation. But I will be confirming with the other two units I have from whitespy.


Coming from an RF/Antenna and microprocessor/DSP background, I think your hunch has merit. It's my experience with other quads that a well grounded plane (through a large R to Batt ground) just under the GPS (DJI puck) will shorten sat lock time to about 30sec cold and 22sec warm (from over a minute). It's not only quiet the RF noise level, but it also serves as a 1.5GHz reflector to the GPS antenna. So I've never mounted a GPS module on a pogo-stick like others.

On this F330 frame, with no legs extended below, I've no choice but battery mount on top, and the GPS on that battery. I crashed a spare F450 earlier (BaseFlight), broke a red arm, so I had a spare F330 frame that can be used. I've more F450 legs arrived in the mail now. I can move Naze32 back to an F450 frame (BaseFlight was sluggish on that frame, then ran away on "gps"... into a concrete wall.... LOL).

So for the experiment, may be I will hang battery under the F330 lowest plate, then copper shield the top plate on which the GPS module will be mounted on. See if that will have some effect !

May that would tighten the GPS uncertainty circle.

Spotter6
Posts: 63
Joined: Thu Sep 18, 2014 3:16 am

Re: Harakiri aka multiwii port to stm32

Post by Spotter6 »

YES! It works!

It stayed within 4" of wherever I put it. Bouncing up and down slowly but maintain altitude. This is GPS HOLD + Baro. I'm sure I can play with P and I to get better! This is a giant step from my point of view. You guys did great work to make this possible.

Not only that, the place where my desk is in the house has another story above it. Previously losing sats as soon as I put the F330 on the desk and hooked up, coming from outside. Now, I maintained 6-7 sats just sitting here at the computer.

It was on my list of improvements as soon as I finished setting up Harakiri on Naze32. Little did I know it is a key ingredient for a good fix.

Note:
When gps_type = 1 , I would maintain longer sat lock inside the house. This is the setting which it would stay the same location plus/minus 4".
I also upped gps_pos_i = 0.5 from 0.4

gps_type = 4 now has a harder time staying the same spot. I can't explain why.

With the presence of a 4"x4" copper foil under the $18 GPS module, and battery moved to the underside of the F330, I think Naze32+Harakiri get better GPS info to stay fixed in one spot, varying only a few inches.

Mr-Fiero
Posts: 216
Joined: Sat Apr 05, 2014 3:26 am

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

I am glad to hear another success! awesome. The real magic for anything working in firmwares goes to Crashpilot1000. I just know GPS's. Oh, and RF......

Baldrick
Posts: 6
Joined: Tue Sep 16, 2014 12:51 am

Re: Harakiri aka multiwii port to stm32

Post by Baldrick »

@Spotter6
Any chance of a photo of your F330. I would like to see how you did the copper shield for the GPS.

Spotter6
Posts: 63
Joined: Thu Sep 18, 2014 3:16 am

Re: Harakiri aka multiwii port to stm32

Post by Spotter6 »

F330Naze32.jpg
F330Naze32HKiri
(40.47 KiB) Not downloaded yet
Here's my Proof of Concept Test Vehicle, all taped up, suitable to change form quickly, but good enough to fly.

Ground plane is something I've done before for GPS and Transmitter modules, with good success... but I didn't realize it's quite important with Naze32 and Hara Kiri.
Attachments
F450NazaV2.jpg
F450 Naza V2
(32.93 KiB) Not downloaded yet
F450Quanum.jpg
F450 Quanum
(42.52 KiB) Not downloaded yet
F330NazaPhantom.jpg
F330Naza Phantom I Remake
(34.91 KiB) Not downloaded yet

Mr-Fiero
Posts: 216
Joined: Sat Apr 05, 2014 3:26 am

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

Nothing beats strong / clean signals from SV's. Less deviation I am sure. Good job getting your GPS not only a bit more isolated, but optimized as well.

Spotter6
Posts: 63
Joined: Thu Sep 18, 2014 3:16 am

Re: Harakiri aka multiwii port to stm32

Post by Spotter6 »

Mr-Fiero wrote:I am glad to hear another success! awesome. The real magic for anything working in firmwares goes to Crashpilot1000. I just know GPS's. Oh, and RF......


Yes. You know RF among things like GPS! :D

Thanks for helping me.

It's great when people are helping each others to further the understand different aspects and development of a free flying machine.

You can practically get a small $18 GPS module to work as well as a larger and more expensive one. Just put a ground plane at least 1/4 wave per side (2") under the antenna.

Post Reply