Harakiri aka multiwii port to stm32

e_lm_70
Posts: 297
Joined: Fri Aug 09, 2013 8:35 pm

Re: Harakiri aka multiwii port to stm32

Post by e_lm_70 »

Crashpilot1000 wrote:Mr-Fiero: I keep my fingers crossed! I fiddeled a little around with G-tune. Currently it could be used very well on the yaw axis - it does a good job there, have to do further tests but the Yaw P autosetting has a good chance to make it into harakiri as an option (like setting yaw P to 0 and MHefnys' code will be engaged).
farzadsw: Last time I checked Keil uvision was 2000$ or something like that so I just use GCC. Since you've spent the money you must be a pro, maybe you can report back how you fixed the compiling issues. I will not download or use hacked/cracked stuff like advised/mentioned by e_lm_70 in another thread here in the multiwiiforum. I am using the free demo version of it for editing and like it very much.


I did not 'advise' ... but yes possibly I did mention somewhere

Actually the original 'tip' came to me by a relative known open source guy doing rc airplane stabilization code, stating that even a more 'popular' one is using the hack/crack approach ...

Some cheap eBay kit come with a mini dvd/cd including this 'crack'

Anyhow, I just test this long time ago on a old pc, on my pc I'm using gcc under lubuntu in a virtual machine.
gcc may not make perfectly optimized code, but set up the environment and compile open source project is fast and easy

Ok ... still looking at this project from Mr.Fiero eyes ... since I'm still deciding which copter is best for this board mainly for make reliable aerial video ...

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 »

Yoman,

Guys I'm stucked. flashed the Harakiri T3_R30, configuring in CLI, but my board is mounted as CW 90 rotated (rotated to right), so in Baseflight it was "align_board_yaw=90". So how can I "say" this in Harakiri?

Many thanks,
B

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 flew about 6 more batteries on the TestCode3 r30 and here is what I found.

I love the new alt adjust while in PH. It saves trying to hunt for centre before a altitude adjustment.

I was focusing on the flyback while testing this time. I think I have somewhat identified what it is. I tried a bunch of different settings as all my PID's seem to be different now. I did find the gps brake percentage being at 15% needed to be increased to 20% and it made a rather large difference in the total distance on flyback. Now, I must stress that I am flying in a really aggressive test for PH, while in PH. Its not normal as I am on the sticks at about 400cm/s or slightly less, then just letting go to see how PH handles this. I know its not normal, but it is my way of testing the PH to its limits.

Now, it is much better with my brake percentage changed! At max speed before release, it will only flyback 1M - 5M. Anything under the 200cm/s seems to not flyback at all anymore. I did notice however, with the higher speeds, the copter does delay from 1 second to 2 seconds before even attempting the braking, and this is what the flyback really is. So back to the 5 second window that we have discussed before. I really think its the flyback now.

As a test, I have flown probably 200cm/s and activated PH before stopping, and it applied braking right away. And then held position very well.

So, now that I have it responding tighter in PH, and now I know what the limits on PH are, I think things are good and I just need to change my style. I think excessive speeds while in PH are just not realistic for the mode.

When I was testing there was only a wind at about 1KM/hour to 5Km/hour and for a whole batter my total drift in PH was seriously mabe 10cm max. I am not kidding. My wife was amazed how tight it was because while in the sky, it had no movement and just didnt look like it was flying. I was filming my kids at the park and it was so tight and smooth. Video looks so great (excluding the crappy go pro lens distortion). There is minimal movement in the video and it looks like someone was holding the camera from that height. you just cannot tell that it was on the multicopter. It was awesome.

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 »

Great Mr Fiero!

Thanks for sharing us your result! I hardly wait to try it out, but need to wait till the "align_board_yaw" will be implemented. I'm very curious about it, because I plan to use my big bird for making video, so the tight PH will be very handy.

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 »

I have to add this snip-it that I found about the toolchain needed to compile. I found it on this page http://wiki.paparazziuav.org/wiki/Installation/Linux . I am posting this just in-case someone may need it for linux.
gcc-arm-none-eabi as Debian/Ubuntu package
Note that there are actually two different toolchains available that unfortunately have the same package name!

ARM gcc-arm-embedded toolchain
includes libstdc++ and newlib-nano

Debian gcc-arm-none-eabi toolchain
does not include libstdc++
does not include newlib-nano

Both toolchains should work for most use-cases (if you don't need C++ or nano specs), although the ARM gcc-arm-embedded toolchain is better tested.
gcc-arm-embedded toolchain

On most Ubuntu versions (currently lucid, precise, raring, saucy and trusty) the gcc-arm-embedded toolchain can be installed as a debian package from the ppa:

sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded
sudo apt-get update
sudo apt-get install gcc-arm-none-eabi

Note bug1309060 on Ubuntu 14.04 you have to explicitly install the gcc-arm-embedded version. You can list the available versions with apt-cache policy gcc-arm-none-eabi
sudo apt-get remove binutils-arm-none-eabi gcc-arm-none-eabi
sudo apt-get install gcc-arm-none-eabi=4-8-2014q2-0trusty9
gcc-arm-none-eabi Debian toolchain

Debian testing (jessie) and Ubuntu 14.04 (trusty) have the gcc-arm-none-eabi package in the official repositories (universe), and can be installed with:
sudo apt-get update
sudo apt-get install gcc-arm-none-eabi

User avatar
Crashpilot1000
Posts: 631
Joined: Tue Apr 03, 2012 7:38 pm

Re: Harakiri aka multiwii port to stm32

Post by Crashpilot1000 »

@ farzadsw: Thank you very much for your offer, dude! Sorry I was a little shocked because that Keil stuff is sooooo expensive for me (checked at digikey it's over 5K € now!). Optical flow should be in theory no problem to integrate into the existing GPS / ACC fusion algo (basically just another velocity source). But to be on the safe side I would suggest that you collaborate with Dominic Clifton or maybe Timecop since they know how to program and can maintain/debug committers.
@ e_lm_70: No problem! If anyone has an official and legit Keil key to sell for 50€ I am in.
@Mr-Fiero: Thank you very much for your feedback and the linux compiling hint! It's still called Testcode because I think you still have the chance to get problematic situations with GPS when reception gets problematic (sudden GPS on / off situations -> wrong tilt into one direction). Note: Mwii & BF are equally affected. But help is on the way! BTW do you mind posting what parameters you changed - so maybe it's reasonable to adjust harakiri defaults.
@bulesz: Hi! I see the board rotating in BF is really good (was part of the sensors unf*cking initative if I remember right). My code is still on the older align each sensor individually method. The main reason is that the FC is quadratic and has a front arrow so there seems to be no striking reason to mount it somehow rotated into a copter. Hmm, will have to see.
@dc: Thank you for your PM! My versioning (or the lack of it) is horror I know, but scoop through the code it's not cluttered all over the place in many little files so it isn't too hard to get trough. I have no plans to implement sonar without baro support in harakiri for several reasons in the near future. (BTW: whats so hard to wire up a 4$ BMP breakout board to an acro version to have a good combined sonar/baro/acc function.) For strict indoor use (like in mining tunnels etc) there has to be some different approaches in some areas of the code and I think it's better to cook up a different firmware for that maybe using multiple sonars and optical flows combined with some extra hardwarelogic.

@all: Have been working really hard on MHefny's zero pid autotuner and I think a working code seems to evolve. However my expectations of an autotuner are not: All zero pids, hit a button and *pling* all done. I focused on the P (Roll/Pitch/Yaw) alone so it can adjust (within a predefined range in percent of predefined P) in flight to fight wobble and to make it more responsive - so the idea is to have an autoadjusting best acro P in flight (so autotuner can be left on all the time).
Cheers Rob

EDIT: Gtune is working now! (at least on my 2 tested copters...). https://github.com/Crashpilot1000/TestC ... 6f7fdd11d6
Currently no hex because no "how to use it" in the readme. Basically you need a half ways tuned copter airborne in acromode (in levelmode only yaw axis is tuned). The only parameter you can set is the percentage Gtune is allowed to play with the P value. There are 2 percentages one for roll and pitch and one extra for yaw (note: yaw tune disabled in tri and bicopters). gt_rplimp = 50 and gt_ywlimp = 50 that means if you have a roll P of 3,5 ("35") at power up the range would be: 1,7("17") - 5,2 ("52"). Besides that the P limits that can not be broken are: 1.0("10") and 19.0 ("190"). Too low percentage values will turn off tuning for that axis / these axes. ToDo: Save initial P values and restore them when Gtune is turned off. And that has to be done in a reasonable context because now if you go berserk on the gtune switch, gtune will be initialized again with the already tuned P and new calculated range. Thinking of the right user friendly and practical way is not so easy imho. The easiest and probably the best way would be a setable range instead of the percentage stuff.

User avatar
Crashpilot1000
Posts: 631
Joined: Tue Apr 03, 2012 7:38 pm

Re: Harakiri aka multiwii port to stm32

Post by Crashpilot1000 »

Short notice on GTUNE. I farted around with it today and having predefined limits for each axis is the better logic than the percentage stuff. However it works best when coming from a too high P and is not so good when coming from lower P. I think there is a way around that, that needs more testing to get that working symetric in both directions (uptuning and downtuning P). The downside of that approach is that you have 6 more parameters (hi and low limits for each axis). I think a tuner should work without a parameter but these are only limits and I think most people know the P limits of their copters so setting a range shouldn't be too much of an obstacle and is more like a safety feature to prevent the tuning algo going berserk on your setup (haven't seen that in my copter but I don't know what YOU fly). Anyway the algo does not saturate into one or the other direction so that is a good sign of general fitness imho. The charm of Mhefnys logic is that it is simple (even I can understand it). Of course there are situations where the judgment of the tuner is wrong but that is no problem because being 30% (or so) wrong and 70%(or so) right results in the correct response if it is done fast enough. One thing I did to improve the judgement quality is to rough down the gyrodata because they don't need to be so precise for tuning (compared to other tasks like leveling out copter in conjunction with acc). So cleaner and more imprecise gyrodata are actually a good thing in tuning roll and pitch from my observations. In my next life (hmm I am catholic I don't think we believe in rebirth - will have to look that up..) I will be a brainy math whizz knowing all the mathsecrets but until that time arrives I will stick to what I can understand and works better in the air.

Concerning the new YAW algo in 2.3 (that is present in current harakiri/testcode3_r30) I've read some complaints here: viewtopic.php?f=8&t=5465 . I am very happy with it (and it is a real improvement IMHO, but my algo is a little different and probably a little more precise than the mwii original) but I will implement the older (2.0? - 2.2) yaw algo in upcoming hex releases as a selectable cli parameter just to make sure you have a fallback if you hate the 2.3 yaw.
Cheers Rob

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 have been tuning a NEW unit, in 35KM/Hour wind...LOL. Got the PH to work really well though and altitude is close. This unit has RCtimer 1000KV motors, 11x4.5 CF props. X525 frame with Flip32+ FC. and allot more extras as its my cam unit. AUW is 1400. Its a bit heavy but works really well for what it is intended for. The GPS is a NEO7 MAX with upgraded 35mm antenna. While testing I am overcast and I only had 7 SV's, 8 SV's max.

one thing, in the wind i ended up with gps_expo = 0 as I found it works the best in the wind. I think once I have everything tuned if it needs to be smoothed out for FPV I will re-introduce the gps_expo at that point. that is also I think why you will notice i have gps_pos_p = 6 as higher numbers in the wind was to aggressive and would overshoot all the time.

Anyways as you requested here are my working params as this unit is now %90 tuned. I think it will be dead on PH when there is no wind. There was a time that the wind let up for me and it was sitting perfectly still. In the wind 15KM/H - 30KM/H it was only fighting in a circle of maybe .5M . Pretty good considering the wind was swirling and unpredictable where I was flying. This was using Testcode3 r30 firmware.

As you notice, I have changed quite a few settings, this is different from before because this unit on previous firmware was very tuned, but the settings are slightly different for some reason.

I had to stop testing, started to rain....flew at first but then it was starting to really come down.....arrrggg.

Oh, I did notice one small thing while testing this unit....while holding in PH and fighting the wind, when i went to adjust the altitude a bit, it did not respond, it just stayed the same. But when it did this, if I drop throttle while still in ph, and then back up above center, then it would respond. This was only 1 out of 20 times. I didnt have to hunt for center, just a drop and back above center stick and it was OK. The unit was quite busy fighting the wind, and I wonder if it was already having a time fighting the altitude already when i was trying to adjust.

# dump
Config:
FW: HarakiriSG pre2.6 TestCode3Aug 5 2014 / 18:02:51
ID|AUXCHAN : 01 02 03 04
00|ANGLE : LM- --- --- ---
01|HORIZON : --- --- --- ---
02|BARO : -MH --- --- ---
03|MAG : LMH --- --- ---
04|CAMSTAB : --- --- --- ---
05|ARM : --- --H --- ---
06|GPS HOME: --H --- --- ---
07|GPS HOLD: -M- --- --- ---
08|GPS AUTO: --- --- --- ---
09|PASSTHRU: --- --- --- ---
10|HEADFREE: --- --- --- ---
11|BEEPER : --- --- --- ---
12|HEADADJ : --- --- --- ---
13|OSD SW : --- --- --- ---
Current mixer: QUADX
Custom mixer:
Motor Thr Roll Pitch Yaw
Sanity check: OK OK OK
Enabled features: PPM VBAT GPS
Current assignment: AETR1234
Current settings:
rc_db = 5
rc_dbyw = 20
rc_dbah = 50
rc_dbgps = 5
rc_trm_ptch = 0.000
rc_trm_rll = 0.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 = 32
i_pitch = 30
d_pitch = 30
p_roll = 32
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 = 100
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

#

Hydroculture
Posts: 5
Joined: Wed Jan 22, 2014 5:42 pm

Re: Harakiri aka multiwii port to stm32

Post by Hydroculture »

Hallo Roberto!

Dear Roberto, can you confirm that frsky telemetry is working on testcode3?
Do I have to enable it anyway? (feature telemetry not there)

I use an KV-OSD to display gps/Voltage/RSSI, working nice on serialTX.

Receiver used is an d4r-ii in ppm mode. Receiver RX is connected to Nazes fryskyports TX.
Worked fine, using baseflight (no reason to turn back to BF :lol: )

looking forward to your answer,

best
Holger

SOLVED: feature telemetry is replaced by tele_prot=1. Working like a charm!!

p.s. Beeper is working as expected, too

User avatar
Crashpilot1000
Posts: 631
Joined: Tue Apr 03, 2012 7:38 pm

Re: Harakiri aka multiwii port to stm32

Post by Crashpilot1000 »

@Mr-Fiero: Thank you very much for posting your settings. I stripped them a little down to better see the difference in the relevant parts:

Code: Select all

Preset:
=======

acc_lpfhz            = 10.000
accz_vcf             = 0.985
gps_ins_vel          = 0.600
gps_lag              = 2000
gps_expo             = 20
gps_ph_settlespeed   = 10
gps_ph_brakemaxangle = 15
gps_pos_p            = 10
gps_posr_p           = 70
gps_nav_p            = 15


Mr.Fiero:
=========

acc_lpfhz            = 20.000
accz_vcf             = 0.990
gps_ins_vel          = 0.500
gps_lag              = 500
gps_expo             = 0
gps_ph_settlespeed   = 200
gps_ph_brakemaxangle = 20
gps_pos_p            = 6
gps_posr_p           = 65
gps_nav_p            = 10


I noticed that you have a very narrow rc deadband for roll and pitch of 5 ("rc_db = 5") but for other people I would suggest keeping at least a value of 10 (note: 20 is preset) because otherwise the PH or the new Gtune (currently not in last hex) could bail out too early and have no effect at all.
If I understood it right you were able to create a situation during althold when passing the midstickposition was not detected? Haven't already found what occasion I missed in the logic but you did the right thing (besides the always working turning off althold). Putting throttle low in althold will engage autoland after 2sec of keeping the actual hight and reset altholdcascade when the throttlestick is actually lifted out of the low autoland area (at any time during autoland cascade).
Note on Gtune: It is working but I am currently not happy with the yaw axis tuning (roughed up gyrodata too much for yaw). I think there will be 7 parameters. 6 for low and high limit for roll/pitch/yaw and one parameter in the range of 0..10 for the tuning strength (0=soft 10=very hard).

@Hydroculture: Danke for your telemetry and beeper feedback!

Cheers Rob

User avatar
Bamfax
Posts: 55
Joined: Thu Jan 10, 2013 9:08 pm

Re: Harakiri aka multiwii port to stm32

Post by Bamfax »

Hey Guys,

yesterday I upgraded to T3 r30 as well. For me this was an upgrade from "TestCode4Apr 2 2014 / 22:33:35" to "TestCode3Aug 5 2014 / 18:02:51".

I have flown four LiPos, slowly testing out the changes Mr-Fiero introduced. Big thanks for sharing, Mr-Fiero.

Step 1:
- Upgrade to r30
- Changed over from gps_type 1 (unknown GPS Config), to gps_type 4 and Fiero's GPS Konfig
Results:
- Flyback is almost gone (normally max 1m, seldomly up to 3m)
- My Crius v2 did not like the GPS Config. It was having 1-2 Sats less than it has normally. It was having a hard time getting over 6 Sats. I had it sitting for around 10 minutes, then started flying probably 15min, still the same afterwards. It was also a cloudy day. I then changed back to gps_type 1, this resulted in 1-2 Sats more. I definitely need to give that more testing, for now I am back to gps_type = 1.
- Rob, one question here: The gps_type 1 configblock, is that a permanent GPS config, or can I change to gps_type 4 here an it's completely running on the Fiero manual config I uploaded before?

Step 2:
- Changed gps_lag from 2000 to 500
- Changed gps_ph_settlespeed from 10 to 200
Results:
- This definitely kicks in the PH a lot earlier
- But the PH does not seem to cope too well with high speeds: The copter starts doing directional corrections a lot earlier, but they are very random, as if the copter is initially not really sure where his PH position is and how to get to it. It always ends up in a stable PH. But often with a long overshot (5-15m) after "fingeroffsticks" and random searches for the parking position.
- So this did not really work out for me.

Step 3:
- Changed gps_ph_settlespeed back to 10
- gps_lag still at 500
Results:
- Smooth prebrake with a long overshot after "fingeroffsticks", but without changing the direction the copter was travelling. Nice.
- Overshot is still there, maybe 5m? But it's looking good, since the copter continues in the same direction.
- Then PH corrections start (later than 0.5ms after "fingeroffsticks"). This is a lot more "one the spot", probably due to the copter already travelling quite slowly at this point. Then it locks into place. Nice.
- Flyback after prebrake/when PH engages is mostly 1m, sometime none at all, sometimes (seldomly) 3m.
- All in all, this looks very nice.

Step 4:
- Tried to increase the strength of the prebrake to further reduce the overshot.
- Changed gps_ph_brakemaxangle = 25
- Changed gps_ph_brkacc = 100
Results:
- Prebrake is stronger, overshot a little less. Looks good.
- Nevertheless this did not really apply a big change. From the looks prebrake does 1sec leveled flying, 1sec brake with 5 degrees tilt, 1sec brake with a little more degrees. I had hoped to get it to brake more aggressively, but this is not yet there. PH Angle is more visible than Prebrake Angle. Is that maybe due to the "Wurzelbremse", do I need to play around with gps_ph_minbrakepercent?

Step 5:
- Moved alt_d up to 100, now the minor Althold Alt drops are completely eliminated.
- Increased alt_p to 12, now faster climb and descent

ToDos:
- Althold descent is still a little relaxing. Is that all alt_p, or is there more?
- Is there already some way to get RSSI into Naze32 for the OSD (RX is FrSky D8R-XP with RSSI PIN)?

So I am getting the hang of GPS paramilitary tuning, err, parameter tuning. Thanks to you guys. And I feel at home again in the three, well, two and a half Harakiri threads out there ;).

All in all, T3 r30 was again a huge step forward, comparing to T4 April 2nd. Flyback is gone. Yaw seems to be more stable. Althold engage is nice. Two RTFhawks are now stowed away, may they dust in peace. Thanks for this great Firmware, Rob!

Here is my dump. The copter is a AUW 1.85kg QuadX with 15'' Props, 460kv Motors, 4S.

Code: Select all

FW: HarakiriSG pre2.6 TestCode3Aug  5 2014 / 18:02:51
ID|AUXCHAN : 01   02   03   04   05   06 
00|ANGLE   : -M-  ---  ---  ---  ---  ---
01|HORIZON : ---  ---  ---  ---  ---  ---
02|BARO    : ---  -MH  ---  ---  ---  ---
03|MAG     : ---  ---  ---  ---  ---  ---
04|CAMSTAB : ---  ---  ---  ---  ---  ---
05|ARM     : -MH  ---  ---  ---  ---  ---
06|GPS HOME: ---  ---  --H  ---  ---  ---
07|GPS HOLD: ---  ---  -M-  ---  ---  ---
08|GPS AUTO: ---  ---  ---  ---  ---  ---
09|PASSTHRU: ---  ---  ---  ---  ---  ---
10|HEADFREE: ---  ---  ---  ---  ---  ---
11|BEEPER  : ---  ---  ---  ---  ---  ---
12|HEADADJ : ---  ---  ---  ---  ---  ---
13|OSD SW  : ---  ---  ---  ---  ---  ---
Current mixer: QUADX
Custom mixer:
Motor   Thr   Roll   Pitch   Yaw
Sanity check:   OK   OK   OK   
Enabled features: PPM VBAT SERVO_TILT GPS FAILSAFE
Current assignment: TAER1234
Current settings:
rc_db = 20
rc_dbyw = 20
rc_dbah = 50
rc_dbgps = 5
rc_trm_ptch = -2.000
rc_trm_rll =  14.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 = 6
rc_rate = 85
rc_expo = 20
thr_mid = 50
thr_expo = 0
roll_pitch_rate = 0
yawrate = 25
devorssi = 0
rssicut = 0
esc_min = 1130
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 = 2
spektrum_hires = 0
vbatscale = 110
vbatmaxcellvoltage = 43
vbatmincellvoltage = 37
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 =  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 = 241
mag_time = 1
mag_gain = 0
gps_baudrate = 115200
gps_type = 1
gps_ins_vel =  0.600
gps_lag = 500
gps_ph_minsat = 6
gps_expo = 20
gps_ph_settlespeed = 10
gps_maxangle = 35
gps_ph_brakemaxangle = 25
gps_ph_minbrakepercent = 50
gps_ph_brkacc = 100
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 = 45
i_pitch = 50
d_pitch = 50
p_roll = 45
i_roll = 50
d_roll = 50
p_yaw = 60
i_yaw = 45
d_yaw = 0
p_alt = 120
i_alt = 30
d_alt = 100
p_level = 70
i_level = 20
d_level = 80
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

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

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

Oh, Rob, Thanks for the rc_db = 5 tip. I forgot to have rc_db = 10 and I just overlooked changing it all this time. I am still testing my new settings and need to finalize my tuning on the newer machine, but my weather is poor right now.

When I had a chance, a small window of good weather, I quickly flew and it was doing very well with my current settings, but I need to get a bit more time on my unit and finalize everything.

I had a previous unit already tuned and am finding that I have again moved to the same settings with the new firmware. I just wanted to see if it was the same between two units. I have also a 3rd unit, HEX, that I am only 60% tuned but it has a high power 1.2Ghz TX on it and I know now it was swamping the gps a bit. I am going to add a saw filter (bandpass) on the Ublox Max7m and retest. I expect by the time I do that It might be even better than my other units running same GPS. When I can tune the HEX, if it acts the same and tuning moves in that direction, then its a clear indicator for me that things have slightly changed. Anyways, its not a bad thing to re-tune everything after new firmwares. Its always ballpark from previous settings, just needs tweaking.

Weather permitting, I will finish tune, and post my results. At that point I will have the Ublox configs done for the Max7m hopefully.

oh yea, i should say, even though I am only 60% tuned on the HEX, I went for it. I sent the wifes Samsung NX2000 up, with a new lens. Yep, and got some really great photo's without incident. Pretty cool! Oh, so stressful. ... LOL


> Bamfax, you had less sv's because i usually get alot of sv's with the 35mm antenna's, so i reject quicker bad sv's. but, if you are low on sv's, then of course you need 6 or above to do good GPS functions. My next ublox config for the 7 will be set so it is back to a normal size antenna. I am trying a different thought, to grab all possible sv's, reject only ones that are really poor condition, but to use all available channels on the GPS and let it average everything. So, my next config post will probably work better for you as you will receive more satts. I should be done in 2 more days, if not, over the weekend for sure!!!

Also, i was thinking about your gps_settlespeed. I am high, because I guess my style and expectations are different. I want those corrections, as soon as possible. so, I set my settlespeed to 200cm/s as its the max. when you say that your unit did not try to make corrections in its path, but stayed on same flight path, I suspect it is not PH but rather stabilize until the PH kicks in, so you are drifting on that path till then. In my area, I have allot of wind, and if i allow this, the wind can push it off course before PH. So I rather have PH lock as soon as possible. If I dont get a good PH while moving, that is why brake, and gps_expo are critical as they directly seem to influence how it tries to hold while under those conditions. For me, my settings work, but it may not be others preference.

After I get it so it locks to PH with 200cm/s or less, then I try to smooth everything out after because my interests are FPV, Photography. But this is only after I tweak it. I always tune for good PH in wind, then re-test in calm weather. I find usually when I tune in the wind, the calm days are perfect PH's. So, take my settings with a grain of salt.......they are testing the limits of GPS functions, as thats my thing. I like the automation view of multicopters.

User avatar
Bamfax
Posts: 55
Joined: Thu Jan 10, 2013 9:08 pm

Re: Harakiri aka multiwii port to stm32

Post by Bamfax »

MrFiero, if you are flying in high winds with PH instantly on, and with that situation being your comfortzone, I assume your "parking into PH" behaviour must be a lot better than mine.

So yesterday I have seen two behaviours:
1) with high settlespeed, PH parking moves engaged quite fast, but did take 3secs and more to find PH position, with far overshot (5m+) and some erratic circling. As soon as PH pos was found, it was a lockon and staid there perfectly
2) with low settlespeed, upon "fingersoff", is was drifting leveled for 1s, some braking for 1s, then with a slowed copter, it did some PH parking moves and then locked on pretty fast (within 1-2secs).

You might be right that in 2) the initial drift was not a braking, but a normal leveled flying before prebrake engaged. From what the copter is doing for "parking into PH", and what your GPS config is doing (reject bad SVs), maybe your GPS setup is a lot better than mine.

So maybe I try kicking out the Crius CN-06 v2 NEO-6M with the 25mm and swapped to a LEA-6H with 35mm antenna. Speaking of it, it's now out in the garden, downloading the almanach ;) And I need a coffee :)

gps.jpg

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 re-testing some GPS settings tonight, they were pretty good yesterday, but I had to end testing again due to weather conditions.

This Ublox config is very close to what I like to see, I will upload it just incase you want to see yourself if it helps, but its still being tweaked and I will probably finish config hopefully in the time frame I indicated. It looks pretty bad outside today, but I hope I can get some testing done.

Anyways, if you want here are the files for Ublox Max7M. You can use in any ublox, but when you upload it will error on features other Ublox's may not have.
Attachments
August 20 2014.rar
Current Test file config for Ublox Max7
(1.48 KiB) Downloaded 178 times

User avatar
Bamfax
Posts: 55
Joined: Thu Jan 10, 2013 9:08 pm

Re: Harakiri aka multiwii port to stm32

Post by Bamfax »

Wow, that was fast. Thanks a lot again for all the GPS background, MrFiero.

I just came back from another 4 LiPos. I don't have much time right now, so this needs to be a short posting.

As far as gps_settlespeed high (200) versus low (10), I can confirm all settings as posted by MrFiero. Right now I am on these settings (dump </dev/brain), and they are feeling good:
- gps_lag 500
- gps_ph_settlespeed 200
- gps_expo 5
- gps_pos_p 7
- gps_maxangle 30

This kicks on PH very fast and starts quite some corrections (I gave maxangle a -5 to to increase my life expectation ;). This definitely looked better than yesterday, so I attribute that to the better GPS. Parking into PH felt mostly direct, mostly in an area up to 3m, until the PH Position was locked on. Flyback is sometimes there, but it's so little that this is just for the protocol.

I cannot say anything to MrFiero's old config, this is because I first had it sitting 40min in the garden, all setup with manual MrFiero config and gps_type 4, just to get me a faint SV reception. Then I changed to gps_type = 1 (still in the garden), which absolutely nulled all GPS reception. I assume walls and plants did not work to well on the gps reception. Then I extended the ground plate and moved out on the field, where I suddenly had 10 SVs, and flipping between gps_type = 1 and 4 did not change anything (same amount of SVs), so I assume gps_type = 1 writes a permanent config in the GPS. I did not have a laptop with me, so I could not re-write MrFiero's config. So all testing was with gps_type = 1.

With the above settings there were still some moments with PH engaged flying and "fingersoff" at increased speeds (maybe 30km/h?), where there was overshot and erratic corrections. I once had a situation where I was maybe at 250m alt, just sitting there, switching on PH, were it did some wild rolling, altough it was just a sitting duck before. Turning PH off an back on did cause the same. (ps.: just listed to the video, this might have been some winds at that altitdude)

I also had some more tries with gps_ph_settlespeed = 10 and more brake (gps_brkacc = 400), this did increase brake quite a bit, but still not "radical", and it also did cause braking in quite often random directions (not just breaking on the existing flight path). So I quickly stopped testing that, as it did not seem to be as beneficial as high settlespeed.

So PH is working great and the settings are quite good. The erratic movement are most likely coming from my GPS setup, there I still need to work on. The bigger antenna working better is a good hint in that direction.

MrFiero, I about to pack bags for holiday (without copter), it will try to get back on your new config next weekend.

User avatar
Crashpilot1000
Posts: 631
Joined: Tue Apr 03, 2012 7:38 pm

Re: Harakiri aka multiwii port to stm32

Post by Crashpilot1000 »

Thank you very much Bamfax and Mr.Fiero for discussing GPS details here, giving feedback and publishing configs!! I am mostly grounded with rain/thunder and bad GPS reception when it's not raining here. I think you are right some preset values should be changed to new defaults. Currently I can not chime in into your discussion with the lack of actual practical possibilities. I used the time to finish up a little G tune for Harakiri (https://github.com/Crashpilot1000/TestC ... G-Tune.txt) and I think it's working well. Will attach a hex here. It is just gtune and the possibility to change the yaw controller (old/mwii 2.3) with rc_oldyw = [0/1] 0 = multiwii 2.3 yaw (default), 1 = older yaw -> see readme.

Cheers Rob
Attachments
Testcode3_r73.zip
Presets and stuff like here: http://www.multiwii.com/forum/viewtopic.php?f=23&t=3524&p=54219#p54219
(182.68 KiB) Downloaded 178 times

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

Post by strips »

I have this mini Ublox MAX M8Q with a pretty small antenna. I wonder if anyone know of a bigger and more sensitive antenna for GPS and Glonass.

User avatar
Bamfax
Posts: 55
Joined: Thu Jan 10, 2013 9:08 pm

Re: Harakiri aka multiwii port to stm32

Post by Bamfax »

Gervais, who is quite experienced with gps, has written quite a lot about the ublox 8's. He actually recommends the mini 8 from csg-shop and the bigger one. I don't have the thread(s) handy, but if you google / forum search mwii.com, you should find them. If your's is not performing too well, it might quite probably be due to other reasons, like interference, as gps is a sensitive son...

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 a quick test with GPS config that I posted,but it was only 1 set of batts as I too have a rain/thunder/lightning issue. I did however fly in the rain anyways with nasty wind, and wow, did it ever lock on PH. seriously in such a nasty environment with 7SV's I was 1M max deviation while it was fighting the wind bigtime. I cant wait till I can test more but from what I saw today I like it. I tried the gps_expo again, but in the wind I took it down to 0 again.

This test was on my HEX, no cam this time and I didnt even trim it out for the missing front weight. Too much in a hurry before the storm hit full force.

Rob, once I am fully tweaked, Cant wait to test, and hopefully weather permitting I will upload it into my first test machine this weekend and test. I am very curious about the Gtune....Sounds really neat to have.

UPDATE: OK, I already have my test unit flashed now and calibrated, RTF so I can test the Gtune. I have a switch setup to activate the Gtune. Now I just have to look for a small window weather permitting to test. I will update my results then and compare my original PID's to Gtune PID's. I quickly flew in the house to make sure everything was operational and all looks very good. excluding GPS functions....LOL, and Gtune. You know, I always get tempted to see it PH in the house. Just sayin. Wife would kill me probably.
Last edited by Mr-Fiero on Thu Aug 21, 2014 5:44 am, edited 1 time in total.

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

Re:

Post by Mr-Fiero »

strips wrote:I have this mini Ublox MAX M8Q with a pretty small antenna. I wonder if anyone know of a bigger and more sensitive antenna for GPS and Glonass.


I am playing with this antenna these days, its cheap and works. you can also find it on ebay, but its from the same supplier...
http://www.goodluckbuy.com/32db-high-ga ... 386mm.html

you probably have the sma connector....but if it were my GPS, wink wink...I wish. I would just solder the antenna I posted onto the GPS and house it in heatshrink abound both antenna/GPS. If soldered correctly its better than a connector anyways.

Bamfax has a VERY valid point.....look for interference! try your gps powered via usb and look at signals, then try powering up the FC, radios and see if the signals drop....Thats the first test that should be done. Of course, a more sensitive antenna never hurts (except if interference is present).
Last edited by Mr-Fiero on Thu Aug 21, 2014 1:39 am, 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 gave maxangle a -5 to to increase my life expectation ;).


Bamfax, I originally thought that too, but I encountered a situation that my max angle on RTL was not enough to oppose a headwind......so I increased it back to a higher value. if RTL was engaged on failsafe and maxangle was not enough in headwind, then, well, you might have to run.... anyways I never thought of that situation but I am glad I noticed the problem before I really needed a failsafe RTL on windy day. And I have allot of windy days.........

mj666
Posts: 186
Joined: Wed Feb 12, 2014 12:02 pm

Re: Harakiri aka multiwii port to stm32

Post by mj666 »

Nice to see so much activity over the last weeks again on Harakiri development. Looks to be its really time to update. I will give it a try and update my big Quad as soon as I can. Thanks for all you efforts.

BTW: is someone still using the sonar to support altitude hold near the ground? Looks to be there is not much adoption yet. Harakiri has support for more sensors than the other available firmware for this hardware platforms and I’m wondering if it makes sense to invest in better support also there. In combination with the improved GPS functionality the should be very powerful.

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

Sv: Harakiri aka multiwii port to stm32

Post by strips »

Bamfax wrote:Gervais, who is quite experienced with gps, has written quite a lot about the ublox 8's. He actually recommends the mini 8 from csg-shop and the bigger one. I don't have the thread(s) handy, but if you google / forum search mwii.com, you should find them. If your's is not performing too well, it might quite probably be due to other reasons, like interference, as gps is a sensitive son...

Thanks,
I have the mini and the big one from that shop. I broke the big one :-( And it's a bit heavy for a mini quad.
Mr-Fiero wrote:
strips wrote:I have this mini Ublox MAX M8Q with a pretty small antenna. I wonder if anyone know of a bigger and more sensitive antenna for GPS and Glonass.


I am playing with this antenna these days, its cheap and works. you can also find it on ebay, but its from the same supplier...
http://www.goodluckbuy.com/32db-high-ga ... 386mm.html

you probably have the sma connector....but if it were my GPS, wink wink...I wish. I would just solder the antenna I posted onto the GPS and house it in heatshrink abound both antenna/GPS. If soldered correctly its better than a connector anyways.

Bamfax has a VERY valid point.....look for interference! try your gps powered via usb and look at signals, then try powering up the FC, radios and see if the signals drop....Thats the first test that should be done. Of course, a more sensitive antenna never hurts (except if interference is present).

It's 95% noise I believe. First I tried (just a test) right under VTX 5.8GHz antenna (600mW) and partly blocked by battery. No lock. Go figure :-)

Then I could just stretch the wires to strap it on top of the battery. Still below the VTX antenna. I got lock but not very good coverage. This was with Baseflight so I do not know how many sats.

Next mount will be in front away from any antennas and on a pedestal.

But a more sensitive antenna can't hurt. Will that antenna you linked enable Glonass. Isn't it on another band? Will also test your GPS setup with Glonass in addition.

User avatar
Bamfax
Posts: 55
Joined: Thu Jan 10, 2013 9:08 pm

Re: Harakiri aka multiwii port to stm32

Post by Bamfax »

MrFiero,

Just a quick one, your new config works great! Clear Sky (as opposed to yesterday), 5-7 sats right away, PH great - slowing for max 5m, short PH pos circling for 2secs in maybe 1m, lockon, done. Great.

I had two or three moments were there was a flyback and flyforward for 5m.

Just one Lipo, couldn't resist :)

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

Post by strips »

How about this one. It covers both bands: http://www.taoglas.com/antennas/GPS-GLO ... h_Modules/

User avatar
Bamfax
Posts: 55
Joined: Thu Jan 10, 2013 9:08 pm

Re: Harakiri aka multiwii port to stm32

Post by Bamfax »

Strips, I read a few posts before that you also bought the neo m8n with the big 35mm antenna from csgshop. Would you mind sharing your experiences with us on those two ublox 8series? Why are you now looking for a bigger antenna for the max m8q? I am also considering buying a newer gps, yours are the two I was looking at.

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

Sv: Harakiri aka multiwii port to stm32

Post by strips »

Bamfax wrote:Strips, I read a few posts before that you also bought the neo m8n with the big 35mm antenna from csgshop. Would you mind sharing your experiences with us on those two ublox 8series? Why are you now looking for a bigger antenna for the max m8q? I am also considering buying a newer gps, yours are the two I was looking at.

I broke it :-(

Flyaway and 100m drop.

But it gave me some more sats due Glonass. Never got around testing it with Harakiri.

User avatar
Bamfax
Posts: 55
Joined: Thu Jan 10, 2013 9:08 pm

Re: Harakiri aka multiwii port to stm32

Post by Bamfax »

Aaargh, that hurts to hear. Very sorry for that. you should have tried harakiri earlier ;). But it sounds like you found your copter again. Thanks for the info about the gps. Go for harakiri :)

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

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

Try not to use GLONASS. I auctually disable it in my configs that i shared as it will not help, unless its all you can recieve. If you have to run Glonass only your position data will not be as accurate. Seriously, GLONASS will not benifit running with GPS SV's for what we do. I see when I am testing, and I set limits for data integrity on the GPS, it rejects GLONASS right away because its just not as accurate position data. Its OK, just OK so it has its purpose, just not for flights.

The antenna I listed is
- Center Frequency: 1575.42 ± 3 MHz

Which is good for GPS. The GPS satellites broadcast on two carrier frequencies: L1, at 1575.42 MHz, and L2, at 1227.6 MHz.

The GLONASS satellites use two frequency bands: 1602.5625 to 1615.5 MHz and 1240 to 1260 MHz
So a Glonass antenna acutally is NOT better as your 1575.42 will be decreased slighly to accomodate GLONASS due to having to be wide band. You can never beat a tuned/centered antenna for any freq.

The best advantage of a ublox8 series engine, is the navigation update rates at 18Hz, and the added SAW filter.

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

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

Had to share, this looks interesting.

http://www.aquacopters.com/project-x-frame-black.html
https://www.youtube.com/watch?v=q0MxTKM2uVo

I think I need this for winter flying....A bit heavy for the 450 frame, but looks really good.

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

Re: Harakiri aka multiwii port to stm32

Post by strips »

Bamfax wrote:Aaargh, that hurts to hear. Very sorry for that. you should have tried harakiri earlier ;). But it sounds like you found your copter again. Thanks for the info about the gps. Go for harakiri :)


Yeah. I had it on a mini quad where the Naze telemetry port was broken. Had to use Baseflight and soft serial to get telemetry.

But now I have a new Nemesis quad and Naze where the telemetry port is working perfectly. I have only been testing with Baseflight until everything is satisfactory. But the geek in me needs to play with GPS hold soon :D

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

Re: Harakiri aka multiwii port to stm32

Post by strips »

Mr-Fiero wrote:Try not to use GLONASS. I auctually disable it in my configs that i shared as it will not help, unless its all you can recieve. If you have to run Glonass only your position data will not be as accurate. Seriously, GLONASS will not benifit running with GPS SV's for what we do. I see when I am testing, and I set limits for data integrity on the GPS, it rejects GLONASS right away because its just not as accurate position data. Its OK, just OK so it has its purpose, just not for flights.

The antenna I listed is
- Center Frequency: 1575.42 ± 3 MHz

Which is good for GPS. The GPS satellites broadcast on two carrier frequencies: L1, at 1575.42 MHz, and L2, at 1227.6 MHz.

The GLONASS satellites use two frequency bands: 1602.5625 to 1615.5 MHz and 1240 to 1260 MHz
So a Glonass antenna acutally is NOT better as your 1575.42 will be decreased slighly to accomodate GLONASS due to having to be wide band. You can never beat a tuned/centered antenna for any freq.

The best advantage of a ublox8 series engine, is the navigation update rates at 18Hz, and the added SAW filter.


Interesting what you are saying about not using Glonass. I had the impression that it would give slightly less precision (2.5m instead of 2m) but more reliable lock. Specially with coverage partly blocked. Do you know if the GPS "interpolates" the coordinates between Glonass and GPS or it just selects the best one?

There was a discussion some time ago about higher update rates. There was no good reason to have more than 5Hz except it might reduce the lag a bit.

User avatar
Crashpilot1000
Posts: 631
Joined: Tue Apr 03, 2012 7:38 pm

Re: Harakiri aka multiwii port to stm32

Post by Crashpilot1000 »

mj666 wrote:Nice to see so much activity over the last weeks again on Harakiri development. Looks to be its really time to update. I will give it a try and update my big Quad as soon as I can. Thanks for all you efforts.

BTW: is someone still using the sonar to support altitude hold near the ground? Looks to be there is not much adoption yet. Harakiri has support for more sensors than the other available firmware for this hardware platforms and I’m wondering if it makes sense to invest in better support also there. In combination with the improved GPS functionality the should be very powerful.


??? Harakiri has a very good working sonar part over a year now (+some additional sonars due to YOUR effort!) - and it naturally works in conjunction with GPS.
I've seen the recent sonar addition of the "other available firmware" - looks rather unusable for me in its' present state.

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

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

@ strips

running at higher updates dont really reduce the lag very much, but it will probably saturate your serial data line (also depending on other data/messages sent). but the advantage is the averaging will be better in the FC with its own filtering. for that unit , I would run at 10Hz as it would never hurt! Why run at 5 if you can run at 10? 5Hz is reccomended for older generation Ublox engines, and if you set an older engine higher it will output, but the position updates are not accurate.

GLONASS is not 2.5M....try more like 3-5M. (try it by setting only GLONASS on Ublox) And yes, the PDOP mask and HDOP mask will probably end up filtering the GLONASS sooner than GPS data. YOu might see more SV's, but they are useless if they are not better than the more accurate/good SV's, and in fact if your GPS engine is setup to accept that data, it will also average into your existing nav data.

If you watch your deviation, you can see the GLONASS move more when you combine. Anyways, the one advantage of GLONASS combined data, is a faster fix. GLONASS however can provide a better DOP if you have a situation that you cannot get a good DOP with just the GPS SV's.

Then, again to a GLONASS combined antenna, I just do not like a wideband antenna. I would rather have a very sensitive narrow centered antenna, with a good working GPS solution without trying to get a better DOP by using a system that cannot do better than GPS anyways. I might combine GLONASS only to use as a backup(later), but not as my main position updates. That is why I keep trying to filter/enhance the GPS only.

Maybe, i am biased for two reasons.
I dont have a Ublox 8 (hopefully soon) yes the 7 has GLONASS but my antenna's are not setup for that
and, My video TX is 1Watt @ 1080 Mhz and therefore I need my tight GPS antenna otherwise the Video TX swamps the GPS

So, all i am saying, is it works for me, and unless I see an advantage by my tests for GLONASS being an advantage, I just keep focused on GPS only for now. Just like SBAS is supposto be more accurate. It is, but its not practical for flight. I found when it tries to add the corrections, because your first demand for GPS on FC is so dynamic, then fixed, when the corrections kick in, you will drift. every time. So just because its more accurate, does not mean its practical for flight GPS functions.

Just my flavour...As I said, I will introduce GLONASS when I have finished with the GPS system and re-test. GPS works good in my location for %100 fix.

Here is a thought.... between GLONASS and GPS there can be a 40cm difference. You can consider this a deviation. Deviation is what we dont want. We are already taking a system that specs at these cheap devices at 2M accuracy, and then expecting them to hold within a few cm's hopefully (best case). The only reason they will even function is because regardless of the 2M listed, at the point you demand a position function, you are dynamically placing the position expectation, and depending on the deviation your GPS has, the FC predicts how to get to the first demand. So adding another 40cm or more in the deviation only amplifies that error. Again, only in a less than ideal environment, GLONASS might help.

There are of course better GPS's, but they are out of most peoples price range. I had a GPS once sub centimetre up to 450KM/Hour, but it was $40,000.00. but it worked awesome! It used both GLONASS and GPS and it was beta at the time. we are really expecting allot from our GPS's and I am really amazed they do what they do.

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

Re: Harakiri aka multiwii port to stm32

Post by strips »

@Mr-Fiero

Sounds reasonable :) And I keep forgetting an important rule. Keep it simple. It's important to have a baseline before trying new things or it's only guessing.

I actually have a couple of those GPS-antennas you linked earlier in this thread. I hope to load Harakiri on the Nemesis today but don't know when I will be able to test it. Need to relocate the GPS further away from VTX antenna.

Debogus
Posts: 24
Joined: Wed Jun 18, 2014 5:08 am

Re: Harakiri aka multiwii port to stm32

Post by Debogus »

So I gather "align_board_yaw" still isnt available on Testcode3 ?
Id move the board but it put the usb in a stupid place ( guess I could wire up a remote plug......)

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

Sv: Harakiri aka multiwii port to stm32

Post by strips »

Slight difference in antenna size :-)

uploadfromtaptalk1408747881665.jpg

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

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

I forgot to upload a video of a PH last week. Its VERY tight. it hardly moves.....


https://plus.google.com/114605860380045 ... ZgjTCHTyco
Last edited by Mr-Fiero on Sat Aug 23, 2014 1:33 am, edited 2 times in total.

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:Slight difference in antenna size :-)


Nice...LOL, yep they are big. Go big, or go home. I cant wait to hear how much difference it makes for signal strengths of the SV's.

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

Re: Sv: Harakiri aka multiwii port to stm32

Post by strips »

Debogus wrote:So I gather "align_board_yaw" still isnt available on Testcode3 ?
Id move the board but it put the usb in a stupid place ( guess I could wire up a remote plug......)


Crap. Is this so? With my new mini H-quad the only sensible orientation is 90 degrease alignment. Harakiri will have to wait if this is the case.

Mr-Fiero wrote:
strips wrote:Slight difference in antenna size :-)


Nice...LOL, yep they are big. Go big, or go home. I cant wait to hear how much difference it makes for signal strengths of the SV's.


When I have time I will try your GPS config without Glonass with the small antenna. Then switch to the big one and we'll see :) Have to try with u-center if I can not change board alignment.

User avatar
Crashpilot1000
Posts: 631
Joined: Tue Apr 03, 2012 7:38 pm

Re: Harakiri aka multiwii port to stm32

Post by Crashpilot1000 »

Due to popular demand added align_board_yaw. (See the readme.txt for further description here: https://github.com/Crashpilot1000/TestC ... ME.txt#L46). I don't know how your copters look like but when everything is so cluttered that even the board had to be placed 90 degree off it may be likely that you mag is fu**** up as well.
Cheers Rob.
Attachments
Testcode3_r79.zip
Presets and stuff like here: http://www.multiwii.com/forum/viewtopic.php?f=23&t=3524&p=54219#p54219
(182.71 KiB) Downloaded 502 times

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

Sv: Harakiri aka multiwii port to stm32

Post by strips »

Crashpilot1000 wrote:Due to popular demand added align_board_yaw. (See the readme.txt for further description here: https://github.com/Crashpilot1000/TestC ... ME.txt#L46). I don't know how your copters look like but when everything is so cluttered that even the board had to be placed 90 degree off it may be likely that you mag is fu**** up as well.
Cheers Rob.


Sweet Rob! You're awesome!

I would always strive to have the board the correct orientation but a mini H-quad almost requires the USB port sticking out to the side. Very difficult to access the board front and back.

dopplerguru
Posts: 5
Joined: Sat Aug 23, 2014 5:14 pm

Re: Harakiri aka multiwii port to stm32

Post by dopplerguru »

Have been using r30 on 280 quad with naze32 v5. Works good in ph and rth mode with one problem. I use arm switch to arm and disarm, sometimes in rth copter gets in a state where it will never exit rth and will not respond to stick commands. Does not respond to any switch settings either including disarm. Copter eventually crashes and props keep running until battery is removed. Am using openlrs with telemetry and can see copter is receiving control commands. Seems harakiri is getting stuck in rth mode and will not exit till battery is pulled. This only happens less than 10% of the time rth is used. I do not see provisions for kill switch anymore - how can U force copter shutdown when copter gets stuck in rth mode? Disarming and switching to manual mode does not always get copter out of stuck rth mode. Need an emergency kill switch so I don't break more props, motors, and escs caused by crashed copter stuck in rth mode. Overall working very good and much better than my apm quads.

Thanks

User avatar
Crashpilot1000
Posts: 631
Joined: Tue Apr 03, 2012 7:38 pm

Re: Harakiri aka multiwii port to stm32

Post by Crashpilot1000 »

Hi! Harakiri in it's current state is designed to never put you out of control. Ending up with an unresponsive copter (roll/pitch/yaw/aux channels etc) sounds more like an openlrs / electrical / whatever issue. The Killswitch is only a sidenote in the readme. Setting rc_killt = 200 will set the Armswitch to be a Killswitch. "200" means the Armswitch must be set to off for at least 200 ms in a row. The killswitch is disabled during an Air-Trim session (https://github.com/Crashpilot1000/TestC ... ME.txt#L89).

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

Re: Harakiri aka multiwii port to stm32

Post by strips »

I just did some quick and dirty tests on some of my GPSs.
2014-08-23 21.46.29.jpg


I used Mr-Fieros setup "August 20 2014.rar" on the Ublox Max M8Q. Wanting to try only GPS with multiple antennas. I had not time to load the same config on the others. I got very poor results on the mini-gps. Have to do more tests as it should perform much better. I'm also not able to set more than 5Hz on single GNSS. I might be doing something wrong.

Mini Ublox Max M8Q - stock antenna
Took over 500s to get a lock and lock is not very good.
Snip20140823_2.png


Mini Ublox Max M8Q - big GPS-only antenna
Two visible sats not in use. No lock after 15 minutes. Incompatible antenna?

Big Ublox Neo M8N with Glonass. Did not change config. Would be interesting to test GPS-only on this one. Actually incredible that it works at all after a 100m drop :o Bent corners and cracked PCB.
Got lock after very short time! MANY sats!
Snip20140823_3.png


Ublox Neo 6 - CN-06 v3
Lock within 30 sec. Did not change config.
Snip20140823_4.png

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

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

The antenna/GPS combination that didnt work, might be because the larger antenna is an active antenna, where as the GPS might of been passive.....Usually Ublox is compatible with active antenna's if it ends in an m... like NEO8M or MAX7M. Look at the GPS engine on that board and get the whole number from it and look it up on Ublox's site. I just looked here http://www.u-blox.com/images/downloads/ ... 876%29.pdf

it seems that depending on how the engine has been installed, you can use either a passive, or with pin 13 use and active antenna. So maybe that board was designed to use a passive gps antenna. RF in is pin 11. You could mod it.... A small antenna like that being passive would be terrible performance!

you can run a GPS without an antenna and do no damage, so power up the GPS, leave antenna unplugged, and measure to see if a voltage is present on the center pin. (carefull, dont short to outside) If there is a voltage present, it should work with an active antenna. It will be probably 3-4volts DC.

Yea, your unit with the cracked PCB looks pretty awesome. heatshrink it and see if you press on the boards/GPS that it is still reliable and wont cut out. maybe you could repair it with a clear nail polish where its questionable. But all in all, now you know your one Ublox 8 with that antenna is not good! Try running deviation meter for a while. Then flash config and do it again to see if its better.

Thanks for posting your results, Its interesting what you found. I would say that your Mini Ublox Max M8Q - stock antenna is poor. And it needs GLONASS to help it even function. seems to be a poor performer for sure. but if you either mod it for a good active antenna (best fix) or get a better antenna atleast, maybe it will be a good unit still. Its a great engine, just have to get it working right.

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

Sv: Harakiri aka multiwii port to stm32

Post by strips »

Mr-Fiero wrote:The antenna/GPS combination that didnt work, might be because the larger antenna is an active antenna, where as the GPS might of been passive.....Usually Ublox is compatible with active antenna's if it ends in an m... like NEO8M or MAX7M. Look at the GPS engine on that board and get the whole number from it and look it up on Ublox's site. I just looked here http://www.u-blox.com/images/downloads/ ... 876%29.pdf

it seems that depending on how the engine has been installed, you can use either a passive, or with pin 13 use and active antenna. So maybe that board was designed to use a passive gps antenna. RF in is pin 11. You could mod it.... A small antenna like that being passive would be terrible performance!

you can run a GPS without an antenna and do no damage, so power up the GPS, leave antenna unplugged, and measure to see if a voltage is present on the center pin. (carefull, dont short to outside) If there is a voltage present, it should work with an active antenna. It will be probably 3-4volts DC.

Yea, your unit with the cracked PCB looks pretty awesome. heatshrink it and see if you press on the boards/GPS that it is still reliable and wont cut out. maybe you could repair it with a clear nail polish where its questionable. But all in all, now you know your one Ublox 8 with that antenna is not good! Try running deviation meter for a while. Then flash config and do it again to see if its better.

Thanks for posting your results, Its interesting what you found. I would say that your Mini Ublox Max M8Q - stock antenna is poor. And it needs GLONASS to help it even function. seems to be a poor performer for sure. but if you either mod it for a good active antenna (best fix) or get a better antenna atleast, maybe it will be a good unit still. Its a great engine, just have to get it working right.


The mini antenna should be an active antenna.
I'll check for voltage on gps connector. Maybe it's defective or I have the config wrong. I'll contact csgshop. Maybe he/they can enlighten me :-)

Another thing I'm unable to use your 8Hz on the Max M8Q. The config showed as red in ucenter and refused to take. All I'm able to is 5Hz and that's with only GPS. I'm wondering if I disabled the other GNSS wrong somehow.

So I believe I'm doing it wrong. It's almost always user error :-) (Have worked in Internet support once)

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

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

I was wondering myself if the config is a bit different for the 8 series gps. In ucenter config, look under CFG-ANT setting and make sure its powered. When its done, you can always confirm with the voltage measurement on center pin. make sure to send to GPS and do a EEPROM save.

dopplerguru
Posts: 5
Joined: Sat Aug 23, 2014 5:14 pm

Re: Harakiri aka multiwii port to stm32

Post by dopplerguru »

Hi Rob, rc_killt works great. When is gps_auto planned for completion? Thanks

e_lm_70
Posts: 297
Joined: Fri Aug 09, 2013 8:35 pm

Re: Harakiri aka multiwii port to stm32

Post by e_lm_70 »

Since here there are lot of gps expert ...

Today I may have killed my good MTK gps ... I did stick on a arm using the standard transparent tape, that this time was over the antenna ... and in the operation to remove that tape ... I notice I was taking away the metal thin part over the ceramic

I stop before remove it all .. possibly 3/4 got removed from ceramic .. and I put back in place the tape for keep the metal on the ceramic ... so ... it is more or less as before, but it got some cut

On my test .. gps accuracy on the air was quite bad ... still I got 5/5 sat from ground ,., and 9 in the air ... but performance wise ... it was really moving around quite much (+/- 7m)

Not sure how much is the damage done or the new gps location ... 7cm from mobius and over the gimbal controller ...

This gps module does not look to have a removable antenna ... so .. no idea how I could eventually replace

ps: When gps is accurate ... actually even the old multiwii code does work fine for position hold ... it is when gps is poor that some special filter/math/etc is needed ...

Post Reply