Harakiri aka multiwii port to stm32

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

Re:

Post by Mr-Fiero »

strips wrote:Not good at all.

Tested a few flights with the new gemfan 5030 3-blade props. Rate was the only mode I dared fly. Even that was not pleasant. I do not know if excessive vibrations can cause sudden 90 plus degree yaw turns or if the mag is way off.

I have not checked the props in a balancer but that's my next step.


try flying with mag off to find out where the issue is.

If it still does that jump in yaw, then you can rule out mag. check esc calibration, and then make sure your motors are same speed with the motor test either via CLI or GUI.

Crashpilot1000 is right, mag is needed for GPS functions, so to be more clear, I was suggesting mag off only in stabilize so you can find your yaw issue, but if its an issue in GPS modes, then its a different problem and it will be related to your mag. If you are not using GPS functions and have sudden yaw, it is due to motor speed, and can be a blade flutter dragging the speed of a motor (very bad blade, or very bad balance), or the motor its self dropping in speed due to either ESC, Motor issues, ESC supply (Bullets) or anything that will cause a sudden change in motor RPM.

I have a couple of machines some of witch have no vibration dampening but the Harakiri is very forgiving.(i think being 32bit helps with the filters also) If ever I think I have an issue with vibration, I lower the lpf to 20 for testing and if it clears things up then I start reducing vibrations and raise the lpf back up as far as it will go and still fly without jitter. If you have to you can even set lpf to 10 just for testing.
Last edited by Mr-Fiero on Thu Apr 24, 2014 6:16 am, edited 1 time 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 »

My latest tests were in the wind again but I had good success with Testcode3.

I waited for the GPS to settle with 8-9 satts (cloudy weather). When I activated PH it locked right away, each time. Each time it held position within .5Meters and with a burst of wind it was 1M max.

I tested PH for a total of 4 batteries and had very good success. The only reason why I quit testing is because I had a motor fall apart.... the shaft dropped from the bottom of the motor, but I was really low to the ground and flying above long dried grass and it landed softly. That will teach me to try really cheapo motors off ebay. Another lesson that anything can happen.

Now I think I am going to reflash Testcode4 and try again to see the differences.

hinkel
Posts: 109
Joined: Sun Sep 09, 2012 7:24 am

Re: Harakiri aka multiwii port to stm32

Post by hinkel »

Hi Crashpilot1000 !
I like your Harakiri failsafe it is very fine ! :)

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

Re: Harakiri aka multiwii port to stm32

Post by Crashpilot1000 »

Hi! Just wanted report back after my easter vacation! Thanks for the feedback and the video! I think strips you have some nasty vibrations going on. Don't bolt the FC directly to the frame. I always use 3-4 strips of doublesided foamtape stacked in every corner of naze (no special brand from the hardwarestore, just the cheapest roll I could find.). I never had 3 bladed props but imagine balancing them might not be easy. The code is more vibration sensitive. You can reduce acc trouble by reducing acc_lpfhz (= 10 Hz is default) you can reduce it down to 1Hz (try 5, 2 and 1Hz to see if that solves your trouble). Doing so will make angle/horizon much more vibration resistent but it will slow down finding the horizontal plane. In another thread I read about Harakiri killing off flightcontrols, well I have 3 (Nz3+4 and MW32v2) FC at work and all are fully operational without unhealthy heating of parts. Concerning the mag declination. The HMC has a resolution of 1-2 degree. A correct magdeclination is important but no need to go overprecise with that subject - however having undisturbed magfunction is vital.
Cheers Rob

subaru4wd
Posts: 316
Joined: Sat Dec 08, 2012 2:16 am

Re: Harakiri aka multiwii port to stm32

Post by subaru4wd »

Rob.

I recently had to switch to Baseflight to get the OSD Switch.

Will harakiri adopt the OSD switch function? I would really like to go back to Harakiri and see about getting a functional Return to Home.

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

Re: Harakiri aka multiwii port to stm32

Post by Crashpilot1000 »

But there is an OSD SW checkbox. Hinkel pointed that out some time ago and suggested a fix. So the checkbox is not recognized by osd? If that is the case it must be a protocol thing. Currently I am picking up where I stopped before vaction. I will look at the OSD repos and mwii protocol what is expected to turn on/off osd.

subaru4wd
Posts: 316
Joined: Sat Dec 08, 2012 2:16 am

Re: Harakiri aka multiwii port to stm32

Post by subaru4wd »

sorry, i should have stated this was with SummerGames 2.5

I havent ran any of your other code.

subaru4wd
Posts: 316
Joined: Sat Dec 08, 2012 2:16 am

Re: Harakiri aka multiwii port to stm32

Post by subaru4wd »

Okay, i am having one hell of a time getting my GPS to work with Baseflight.

Rob, where can I find some of your latest code to run?

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

Re: Harakiri aka multiwii port to stm32

Post by Crashpilot1000 »

Hi, Subaru. Testcode4 is currently the last uploaded code. I have something newer at hand right now but weather stops me from GPS testing (rain or bad gps conditions or both ...). There are also a few other things implemented. I think I have some nice addition for the multicopter mixing part concerning behaviour in full throttle situations. Testing suggests it's nice :) - stuck to non-float operations so maybe that will be a very nifty addition for 8bit mwii as well since it also makes the copter much more cooperative/recoverable in out of whack PID oscillations. Basically it's just a compression of the range if the calculated PWM range overshoots. Multiwii does a substraction of the overshoot, wich I think is a smart move and a very good idea but I thought hey, let's see what a scaling of the range will do in those situations. Haven't played with TPA / have no flight experience with TPA on my copters but I guess TPA users have a good chance of reducing it.

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

Sv: Harakiri aka multiwii port to stm32

Post by strips »

Crashpilot1000 wrote:Hi! Just wanted report back after my easter vacation! Thanks for the feedback and the video! I think strips you have some nasty vibrations going on. Don't bolt the FC directly to the frame. I always use 3-4 strips of doublesided foamtape stacked in every corner of naze (no special brand from the hardwarestore, just the cheapest roll I could find.). I never had 3 bladed props but imagine balancing them might not be easy. The code is more vibration sensitive. You can reduce acc trouble by reducing acc_lpfhz (= 10 Hz is default) you can reduce it down to 1Hz (try 5, 2 and 1Hz to see if that solves your trouble). Doing so will make angle/horizon much more vibration resistent but it will slow down finding the horizontal plane. In another thread I read about Harakiri killing off flightcontrols, well I have 3 (Nz3+4 and MW32v2) FC at work and all are fully operational without unhealthy heating of parts. Concerning the mag declination. The HMC has a resolution of 1-2 degree. A correct magdeclination is important but no need to go overprecise with that subject - however having undisturbed magfunction is vital.
Cheers Rob


Thanks. I will give it a new go soon. I just got a set of Himodel 5x4.5x3 props to test. They are much more balanced than the gemfans. And they're thick and stiff enough to sand for balance.

I have mounted the Naze32 on rubber rubber stands. So my first priority is stable and smooth rate mode.

Do you have a link for TestCode4? I believe I'm running TestCode3 which you had in a post earlier.

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

Re: Harakiri aka multiwii port to stm32

Post by Crashpilot1000 »

You can stick to TestCode3 and wait a little for the next version. I attach here the compiled version of TestCode4 from the repo.
Cheers Rob.
Attachments
TestCode4HEX.zip
(106.2 KiB) Downloaded 624 times

subaru4wd
Posts: 316
Joined: Sat Dec 08, 2012 2:16 am

Re: Harakiri aka multiwii port to stm32

Post by subaru4wd »

I use TPA, it works great to get rid of high throttle oscillations.

I cant find your repo, i think i found it but last updates were months ago?

Where do we go to get testcode3?

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

Sv: Harakiri aka multiwii port to stm32

Post by strips »

subaru4wd wrote:
Where do we go to get testcode3?


In this post: viewtopic.php?p=48650#p48650

subaru4wd
Posts: 316
Joined: Sat Dec 08, 2012 2:16 am

Re: Sv: Harakiri aka multiwii port to stm32

Post by subaru4wd »

strips wrote:
subaru4wd wrote:
Where do we go to get testcode3?


In this post: viewtopic.php?p=48650#p48650



Ahh yes, there it is. Im sick of using Forums as a repo. Was hoping there would be a wiki, or at the very least a compiled .hex somewhere on the github or google code or whatever people use these days.

Thanks Strips

User avatar
Dilbert66
Posts: 45
Joined: Fri Apr 04, 2014 6:09 pm

Re: Harakiri aka multiwii port to stm32

Post by Dilbert66 »

github with change control is the better way. Interested folks can even see what has changed from version to version normally. They can clone the project and be able to follow it's development and even contribute if they so desire and the project lead is open to it. The project would then be nourished from multiple minds working on the issues at hand. With this project, I'm confused. Obviously it's a one person work which is fair enough but for group dev it's not going to work very well as it is.

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

Post by strips »

Sweet smoothness! I just balanced my new props. Rate mode was smooth. Angle was smooth except it yawed a bit in a fast wobbly decent. Alt-hold was perfect! Kind of weird I newer got enough sats to engage pos-hold after 5 minutes in clear weather. But it has been over a week since the GPS was powered last.

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: Harakiri aka multiwii port to stm32

Post by timecop »

Dilbert66 wrote:github with change control is the better way. Interested folks can even see what has changed from version to version normally. They can clone the project and be able to follow it's development and even contribute if they so desire and the project lead is open to it. The project would then be nourished from multiple minds working on the issues at hand. With this project, I'm confused. Obviously it's a one person work which is fair enough but for group dev it's not going to work very well as it is.


That's like beating a dead horse.
The reason this fork is garbage is because of the repeated delete-repository-and-reupload-shit-on-each-release.
Already been mentioned a million times, so just let it be. Nothing of value to see here anyway.

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

Post by strips »

Still on testcode3 I got perfect gps and alt hold!

I'm only touching the RX to change altitude a couple of times.
http://youtu.be/Ki7uO1kyFsA

This was under perfect conditions. No wind. Only bloody mosquitoes! Huge monsters.

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

Re: Harakiri aka multiwii port to stm32

Post by strips »

I got asked about my setup so I'll post it here.

Most of my general unstability problems were due vibrations. Got some new props I where able to balance properly it flies like a dream.

Code: Select all

# dump
Config:
FW: HarakiriSG pre2.6 TestCode3Mar 31 2014 / 18:35:35
ID|AUXCHAN : 01   02   03   04 
00|ANGLE   : --H  ---  ---  ---
01|HORIZON : -M-  ---  ---  ---
02|BARO    : ---  --H  ---  ---
03|MAG     : ---  -MH  ---  ---
04|CAMSTAB : ---  ---  ---  ---
05|ARM     : ---  ---  -MH  ---
06|GPS HOME: ---  ---  ---  --H
07|GPS HOLD: ---  ---  --H  ---
08|GPS AUTO: ---  ---  ---  ---
09|PASSTHRU: ---  ---  ---  ---
10|HEADFREE: ---  ---  ---  ---
11|BEEPER  : ---  ---  ---  -MH
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 = 20
rc_dbyw = 20
rc_dbah = 50
rc_dbgps = 5
rc_trm_ptch =  0.000
rc_trm_rll =  0.000
rc_minchk = 1100
rc_mid = 1502
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
devorssi = 0
rssicut = 0
esc_min = 1100
esc_max = 1950
esc_nfly = 1300
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 = 1
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 = 25
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 = 220
mag_time = 1
mag_gain = 0
gps_baudrate = 115200
gps_type = 4
gps_ins_vel =  0.600
gps_lag = 600
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 = 35
i_pitch = 30
d_pitch = 30
p_roll = 35
i_roll = 30
d_roll = 30
p_yaw = 60
i_yaw = 45
d_yaw = 0
p_alt = 100
i_alt = 30
d_alt = 80
p_level = 70
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


RcControlSettingAux_Harakiri.PNG

subaru4wd
Posts: 316
Joined: Sat Dec 08, 2012 2:16 am

Re: Harakiri aka multiwii port to stm32

Post by subaru4wd »

I flashed TestCode3 today and letting the quad sit for a few minutes outisde, I finally got a GPS lock.

Tracking 10 sats in my house. I might get a chance to do some test hovers in the front yard soon.

alistairr
Posts: 51
Joined: Thu Sep 26, 2013 10:30 am

Re: Harakiri aka multiwii port to stm32

Post by alistairr »

Hey Strips. Is your mini quad using sonar as well? That test code 3 looked pretty locked in.

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

Sv: Harakiri aka multiwii port to stm32

Post by strips »

alistairr wrote:Hey Strips. Is your mini quad using sonar as well? That test code 3 looked pretty locked in.


No sonar. Only perfect flying conditions. I haven't been able to replicate that kind of precision again. In windy conditions it actually drifts 1-2m down before settling altitude. And 3-5m horizontally before halting and slowly inching itself back to where it's supposed to be.

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

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

Here is an update. Finally nicer weather! Very welcome after a nasty long winter......

With Testcode4 I never got a good lock on the GPS. I even tried more aggressive settings and it does not hold position well. I even had it still try to drift to the right, but I think its because my trims were out and it seems that when PH is activated, it is even more delayed or worse, in testcode4. I keep having to switch PH back and recover as it just does not hold, but having wind does not give me as much time to lock.

But, even trying to compensate for the delays, It still does not perform like I am able to do in testcode3.

To confirm this, I reflashed testcode3 and it worked right away. I had to change my settings back as it was too sensitive. I flew testcode3 on my test unit for a total of ten batteries 4400mah each for 15minutes per batt. ( 80 % drain ) Every test was perfect, and I have only .25M altitude variations.

This unit I have the 35mm ceramic active antenna on the NEO6 GPS engine, and the GPS is rejecting angle to horizon at 8 degrees. its running 8hz update at 115200 buad.

I have perfect locks and for a whole battery I only see maybe 1M drift MAX (Wind), but then it returns nicely. For the whole flight, It drifts only a couple of times for the entire 15 minutes of flight. Its very tight each and every time. 90-95 % of my flight is seriously within .5M MAX LONG/LAT. Altitude hold is also just incredible (yes i finally covered my baro ). My altitude for 90 % of my flights was within .5M max variation in the slight wind. Of course in the past I did tune my PID's for altitude hold so it helps now perform well.

One thing I did have to get used to is that if you re-position while in PH, you have to hold new position with your sticks ( if let go too soon, it tries to return to what seems to be the original postion ) and wait for the GPS to average the new position for a few seconds, then after that it holds again very nice.

I am still testing, but Testcode3 for me seems to be a better choice as it is working very well, even in the wind for GPS functions. When I was doing this last test the wind (as allways) was blowing, but it was only 10KM/h to maybe 25KM/h, so this was a calm day for me. The previous tests were in more aggressive wind.

I still have to test RTL and a few other modes, but I just wanted to be sure of the GPS first.

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 for your feedback mr.fiero!
My gps development is currently a little blocked so i concentrated on mixer and althold stuff - so I really appreciate your gps - feedback!
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 »

Rob, I am so glad your firmware GPS functions work ! ....

I had an issue where my TX dropped power (bad connector in battery bay). The unit had to fly itself for about 5 minutes in a very tight space as I was flying between my power lines, and close to my roof. I had my OpenLRS failsafe set to PH as I have not tested the RTL yet.

Well, it worked perfectly and stayed away from a power line right beside my unit for the time my TX was down. It gave me time to remove battery cover, unplug, and tighten pins, and plug in power up, and take back control. Normally I dont fly in this tight area, but at the time I was taking pictures of my roof so I could inspect for any damage from winter months.

Awesome, usually in the past if anything like this would of happened it was a crash for sure, but I was so impressed at the performance. I usually worry the wind will push it, but it flew very nice in PH Failsafe, in the wind.

I should also mention, when I set my OpenLRS failsafe, I did it quickly but my radio did not have the ARM switch activated when I set the sticks. I didnt think about this at the time, but when I needed the failsafe, because you have it set that if PH is activated but ARM is not active, it ignores it and stays active while in PH. This worked well for me in this situation.

Colorado CJ
Posts: 2
Joined: Sat Apr 05, 2014 7:10 pm

Re: Harakiri aka multiwii port to stm32

Post by Colorado CJ »

What GUI are you guys using with these firmwares. It seems every GUI I try is either buggy or plain does not work with the Harakiri or test code 3 firmware.

I finally got my scratch built quad all put together and would really like to use test code 3 to get GPS functionality.

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

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

I use BaseFlight GUI if I am looking for a quick tune or change on basic PID's but mostly I stay with the CLI. (multiwii 2.2 works too)

I do not like to use a GUI much because they do not follow code development and they usually are missing features/settings, especially with BETA firmwares! What is nice about the CLI, is I take my dumps, and add "set " to each line, and then can copy/paste into next controller for quick setup. Also having a dump to look at all the settings is really nice.

There is no gui that has all the settings, but the CLI does!

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

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

OK, today I flew in the rain turning to small hail. LOL I have a neighbour friend that is into multicopters, and he drove by while I was flying, he probably thinks I am crazy. :roll:

Anyways, I did notice something new, and I am sure its probably normal. Its related to the baro.

While flying, I had an 1M drop in altitude as soon as PH was activated 9 out of 10 times, but then it was holding altitude, with slightly more variation than my previous tests up to .5M each time. It was a slow variation, and would stick to new altitude. I suspect as the wind was about 10KM/h and with the rain turning to hail it was temperature differences on the baro. (spike filter on baro a good idea? or does it already have this in the code?)

Only today have I ever seen altitude with this much difference, but its not normal conditions so I am sure everything is good. I just wanted to post results under different conditions, thats all.

Well, I had a few flights with same results on baro. even though i was counting on the fact that rain was non conductive, I was pretty wet on my FC and had to bring it in to air dry it all. This is my test quad so its not critical, but I do not want to have it die too early. Its a flip32+ so the baro is under the FC and it was dry.

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: The baro already has that filtering to put out most spikes. On the other hand the hight reading is very temperature (sunlight etc) sensitive. I also own a "compatible" that does serious artificial heating of the baro not helping it's function, my N4 also artificially heats up the baro but less worse.
Nothing much to do to fight that - at least I am not aware of a solution. The hightdrop in forward flight (though throttleangle compensation) is more than in old SG2.5 because I simply forgot to implement my little "accz trick" in the "testcode3/4" after reworking parts of the IMU.
@Colorado: I use the original mwii 2.1 gui, especially on my slow centrino - several - years - old -WinXP - Laptop.
Cheers Rob

hinkel
Posts: 109
Joined: Sun Sep 09, 2012 7:24 am

Re: Harakiri aka multiwii port to stm32

Post by hinkel »

Hi Crashpilot1000 !
Because your Althold is very fine.
I am testing an automatik althold support. If you are flying and you don't move the throttle stick for 2000ms, althold is engage autonomously and
disable if throttle stick move more then deadband. The goal behind is to keep a stable altitude during flite and don''t move some switch. .

Code: Select all

cfg.al_suptime  = 2000; // 0 = disable // althold is engage autonomously after for ex: 2000 ms when throttle stick is not moving deadband Throttle = 60 
    cfg.al_deadsup                = 60;         // Throttle deadband when Althold support is use 
    cfg.al_maxthrsup              = 1790;       // Over this throttle value Althold support is disangage

It is like a poor man sonar , I don't know ! :D

Regards
hinkel

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

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

> hinkel

I like your idea would an excellent feature, it would work for what I prefer to do as it would also free up a position on my 3 way switch. Yes I have more switches but my style is i prefer to simplify my switches. right now i like stabilize/PH/RTL and I think your suggestion would blend with the stabilize nice. It makes sense. What an interesting idea.

Now i have to test Harakiri AH and add stabilize at same time to see how It acts. I never tested the Alt hold yet by itself as I was focusing on GPS, maybe Harakiri already has it so if you adjust altitude with throttle it will hold to new level while in dead band. Now you got me curious.

You know, another interesting idea is the new "hybrid" flight mode in arducopter. I think its both altitude and position but still gives full control out of deadband.

have you already modified harakiri? and if yes have you tried it in the newer testcode?

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: The baro already has that filtering to put out most spikes. On the other hand the hight reading is very temperature (sunlight etc) sensitive. I also own a "compatible" that does serious artificial heating of the baro not helping it's function, my N4 also artificially heats up the baro but less worse.
Nothing much to do to fight that - at least I am not aware of a solution. The hightdrop in forward flight (though throttleangle compensation) is more than in old SG2.5 because I simply forgot to implement my little "accz trick" in the "testcode3/4" after reworking parts of the IMU.
@Colorado: I use the original mwii 2.1 gui, especially on my slow centrino - several - years - old -WinXP - Laptop.
Cheers Rob


Hi,

Your project is lookong outstanding, and it sound the best one for my need over my DIY naze32 alike boards.

One question puzzle me ... how precise need to be acc calibration for make alt hold accurate ?

Any small angle during calibration ... a small angle per the sensor inside the chip ... will cause a wierd Z reading:

Let assume the sensor is a bit inclinated, so at the time of calibration the Z acc will be a bit less then 1g ... but the firmware will map this as 1g internally

Now, when the board get a bit inclination, and still is not moving at all, the Z axis may report a reading higher then the one at calibration time ... so .. the firmware may assume the copter does accelerate vertically ...

So .. all these Z acc compensation for noise baro ... still they sound tricky to me
Also the lame 6 position calibration from APM R&D, sound even a more wierd approach, since it complicate things, without solving the original problem.

Thanks a lot in advance for your point of view about it.

Does you firmware support X and Y acceleration for improve GPS hold too ?

hinkel
Posts: 109
Joined: Sun Sep 09, 2012 7:24 am

Re: Harakiri aka multiwii port to stm32

Post by hinkel »

Mr-Fiero wrote:> hinkel

I like your idea would an excellent feature, it would work for what I prefer to do as it would also free up a position on my 3 way switch. Yes I have more switches but my style is i prefer to simplify my switches. right now i like stabilize/PH/RTL and I think your suggestion would blend with the stabilize nice. It makes sense. What an interesting idea.

Now i have to test Harakiri AH and add stabilize at same time to see how It acts. I never tested the Alt hold yet by itself as I was focusing on GPS, maybe Harakiri already has it so if you adjust altitude with throttle it will hold to new level while in dead band. Now you got me curious.

You know, another interesting idea is the new "hybrid" flight mode in arducopter. I think its both altitude and position but still gives full control out of deadband.

have you already modified harakiri? and if yes have you tried it in the newer testcode?


Mr Fiero

I don't know if this idea is excellent ? I just test in the backyard and it working funny . The modified Harakiri is Summer Games 2.5 and there are other modification Inside :
* Failsafe info for OSD KVteamosd or MWOSD
* GPS time for MWOSD ( Shikra Patch )
* A don't fall from sky security for people like me " when your are in autoland and switch baro off ....... :lol: "
* In Baro mode if you yaw Throttle stick have no influence (Mode 2 Transmitter only)
* and some newer modification from Crashpilot1000
This is just a test code don't fly with it because it is very special and certainly not working on Naze32 rev5 !
http://github.com/hinkel/SummerGames2.5/tree/barotest

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

Re: Harakiri aka multiwii port to stm32

Post by Crashpilot1000 »

@Hinkel: Hi, dude! You are known to me as someone with very good ideas over the years aside the mainstream copterfunctions.
I just want to repeat your idea here if i understood it right. You do a "normal" flight (with your new function) and when you idle on the throttlestick for 2 seconds althold is automatically engaged. When movement on the throttlestick re-appears althold is disengaged and the real throttlestick throttle is used again. Besides triggering autolanding and deadpilot failsafe stuff there might be some other problems with this procedure. During althold the althold controller will rise the virtualthrottle so that when re-engaging real throttlestick throttle (esp. with a deadband) you might see a rapid hightloss you will have to compensate for on the sticks quickly. To avoid that the althold should be able to rescale the real throttlestick input (= un-linearize it) for that flight session based on the averaged altholdthrottle and the real stickinput. I bit my teeth on that before, perhaps I was wrong with that idea and therfor just ran into the same wall over and over again. The althold should only be possible then in between a certain throttlestickrange like "copterflying = true" (or some other lower limit, perhaps a new number) and a upper limit (like you suggested) otherwise there might be trouble on the limits of the rc throttlerange. I have a hard time finding your github repo with google please can you post the link again, because it seems you already have tested code at hand (as I know you :) ) so just if you like to share it you are welcome.
@ Mr-Fiero: I have nothing new to present, because I was a) *lazy* (TM) and b) had to organize a birthdayparty as well...
I read across the vrbrain guys post on 3DR concerning that hybrid mode as they posted it. From what I read there it seems to be a similar idea harakiri already had at play: Oversteer PH with the sticks, but I guess they got the re-engagement of PH smooth and slick (without flyback to some previous gathered GPS position, like observed with my stuff). I can not flight test arducopter code anymore since I put my apm out of business after having much damage and after having a tree stopping a flyaway - I washed my underwear from brown stains (i think they call it "brownout") and shelfed the apm.
@ e_lm_70: Thank you for the flowers but baseflight has much improved and is definitely better structured and organized than my stuff. Harakiri was just started because there was no movement in the BF trunc that has dramatically changed and I am really happy about that! There were several lowlevel driver changes that BF made for good reason I didn't take over because a)I didn't want to change stuff that I knew worked very solidly b)I don't know that lowlevel interrupt stuff. Concerning your acc calibration question. Yes there is accelerometer and gps velocity fusion going on as well to improve fast reactions on sudden x/y changes. The acc calibration. Well that is a field that is beyond my limited mathematical understanding but I farted around with that a lot (even fusion of MPU6050 acc and adxl and mma). At the end of the day it seems to be sufficient to me to use the invense supplied 1G value (at the set scaling) and calibrate it like multiwii suggests with a flightcontrol that is eyeballed, maybe better, horizontal. That http://imaginaryz.blogspot.de/2011/04/l ... -data.html algo gets better mag offsets but I couldn't get it to work better on acc or gyro offsets. The 3DR (since the opensource dev is completely company driven, that's why I mention that company here) acc calibration routine was lifted/copied/whatever people may call it from a project that used uncalibrated adxl (analog?) sensors, it adds hassle to the calibration but is (just from my findings) of limited use of already precalibrated digital parts like mpu, mma etc. Besides the supplied 1G value calibration method you can extend it by using pythagoras term to get the total sensor value of the resting sensor for 1G reference to cancle out slight mounting tilting. I once did it but not right of what I found out later when putting the copter upside down - I might revisit that procedure but don't expect miracles from it. However, everybody expects temperature drifts on the gyro part but they are more severe on the acc (especially z) values from what I've seen. So having a practical temperature compensation that really has impact on real life performance seems to me the first thing to engage concerning the calibration aspect of gyro AND acc. Ending up with explanting a flightcontrol putting it with lipo into a fridge/radiator is no practical option - or flinging around a big model around for acc calibration in a tight timeframe - I would sacrifice precision over practical and hasslefree operation any day. But that is a question of philosophy. There are probably some intelligent mathematical tricks available but they are beyond me.
P.s.: Sorry for slow going..
Cheers
Rob


EDIT: I just send this text because I was afraid the froumsoft would eat it, that's why I respond to your latest post here.
Thank you very much for putting your code on display, dude, I will definitely have a look at your work and I think many others will appreciate your work and effort as well..!

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

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

crashpilot1000

yea I too parked my APM2.5 , 4 units..... for almost the same reasons as you. When they do fail, its spectactular! Skydrops are common too. and pixhawk is way too new. \it might suffer skydrop issue too. Too early to tell.

funny but with your firmware i just dont crash.... close, but only because i deserved it (my faults). I have had only success so far. I think I will fly Testcode3 as it just works for me, and whenever, someday your code changes, \i will continue to follow it and test.

\i run same hardware on the different FC flashed with Harakiri and its funny how I dont get skydrops anymore, its been great. lol

subaru4wd
Posts: 316
Joined: Sat Dec 08, 2012 2:16 am

Re: Harakiri aka multiwii port to stm32

Post by subaru4wd »

Wow there are some great ideas in here!

I esepcially love the Failsafe information being sent to the OSD.

Hope to see some of these features in Harakiri soon :)

hinkel
Posts: 109
Joined: Sun Sep 09, 2012 7:24 am

Re: Harakiri aka multiwii port to stm32

Post by hinkel »

@Crashpilot1000 !
Thanks for reply
You understood the function right .
The new stuff will not corrupt Failsafe and Autoland and it is use between a certain throttlestickrange as you imagine,
ESCnoFlyThrottle and cfg.al_maxthrsup,
For the moment I will test it on FPV ASAP to see if it is Problematic .

subaru4wd
Posts: 316
Joined: Sat Dec 08, 2012 2:16 am

Re: Harakiri aka multiwii port to stm32

Post by subaru4wd »

So today I got to fly a FULL day (7+ hours) of nothing but Quad FPV. I got to iron out a ton of bugs with my setup, and things were flying smooth.

I am using Harakiri TestCode3 and I noticed when flying in pure manual mode... i would be cruising in a straight line hands off the sticks. Fast forward flight. After a few seconds, i would begin to get some yaw drift, and it would get worse. As soon as I used the stick and gave any yaw command, it picked its new line and stuck to it... no problem. But if I did not give any yaw commands and tried to maintain a straight forward it would begin to get lazy an start to get some really nasty yaw wag.

I am going to be going through all the gopro video so I will try to find the clip.

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 »

subaru4wd wrote:So today I got to fly a FULL day (7+ hours) of nothing but Quad FPV. I got to iron out a ton of bugs with my setup, and things were flying smooth.

I am using Harakiri TestCode3 and I noticed when flying in pure manual mode... i would be cruising in a straight line hands off the sticks. Fast forward flight. After a few seconds, i would begin to get some yaw drift, and it would get worse. As soon as I used the stick and gave any yaw command, it picked its new line and stuck to it... no problem. But if I did not give any yaw commands and tried to maintain a straight forward it would begin to get lazy an start to get some really nasty yaw wag.

I am going to be going through all the gopro video so I will try to find the clip.



Why you don't activate the MAG if you want to be 100% sure to keep the "line" straight ? Without mag, early or later you will get some Yaw drifting.

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:...
@ e_lm_70: Thank you for the flowers but baseflight has much improved and is definitely better structured and organized than my stuff. Harakiri was just started because there was no movement in the BF trunc that has dramatically changed and I am really happy about that! There were several lowlevel driver changes that BF made for good reason I didn't take over because a)I didn't want to change stuff that I knew worked very solidly b)I don't know that lowlevel interrupt stuff. Concerning your acc calibration question. Yes there is accelerometer and gps velocity fusion going on as well to improve fast reactions on sudden x/y changes. The acc calibration. Well that is a field that is beyond my limited mathematical understanding but I farted around with that a lot (even fusion of MPU6050 acc and adxl and mma). At the end of the day it seems to be sufficient to me to use the invense supplied 1G value (at the set scaling) and calibrate it like multiwii suggests with a flightcontrol that is eyeballed, maybe better, horizontal. That http://imaginaryz.blogspot.de/2011/04/l ... -data.html algo gets better mag offsets but I couldn't get it to work better on acc or gyro offsets. The 3DR (since the opensource dev is completely company driven, that's why I mention that company here) acc calibration routine was lifted/copied/whatever people may call it from a project that used uncalibrated adxl (analog?) sensors, it adds hassle to the calibration but is (just from my findings) of limited use of already precalibrated digital parts like mpu, mma etc. Besides the supplied 1G value calibration method you can extend it by using pythagoras term to get the total sensor value of the resting sensor for 1G reference to cancle out slight mounting tilting. I once did it but not right of what I found out later when putting the copter upside down - I might revisit that procedure but don't expect miracles from it. However, everybody expects temperature drifts on the gyro part but they are more severe on the acc (especially z) values from what I've seen. So having a practical temperature compensation that really has impact on real life performance seems to me the first thing to engage concerning the calibration aspect of gyro AND acc. Ending up with explanting a flightcontrol putting it with lipo into a fridge/radiator is no practical option - or flinging around a big model around for acc calibration in a tight timeframe - I would sacrifice precision over practical and hasslefree operation any day. But that is a question of philosophy. There are probably some intelligent mathematical tricks available but they are beyond me.
P.s.: Sorry for slow going..
Cheers
Rob


Thanks Rob,

Luckily you have "limited mathematical understanding" ... otherwise my head would have exploded ... I'm not sure I got much of what is above.
So .. can we summarize with part in bold above ?

"Eyeballed" .. it means calibrate the control board as flat as possible ... that is different to calibrate the control board in the spot that the copter hover stable in the simple angle mode.
If the CoG is not perfectly center, the copter tend to require a little angle for hover on the spot, compared to the Eyeballed.

The assumption of Eyeballed, it is that 6050 chips are produced and mount over the board with the sensor almost perfectly horizontal to the ground level ... so mainly we just calibrate the value of 1G and the zero on the X and Y accelerometer ...
PS: Ideally we should calibrate the 6050 in the space, or into a free falling zero gravity environment :D ... free falling calibration could be an idea :mrgreen: ... instead of 6 position calibration like APM people .. just throw the control board from the 10th floor

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

Re: Harakiri aka multiwii port to stm32

Post by Crashpilot1000 »

@subaru4wd: Thanks for the report. Besides using magnetometer correction for yawdrift, you could try turning down the yaw "I" term. But I will recheck what's going on in the new multiwii yaw controller and my port of it - I suspect a building up yaw "I" because I put that calculation to float variables.
@Hinkel: Back from work and checking out your changes :)
@e_lm_70: Freefall would not work for acc calibration, don't get me wrong the calibration method using the predefined 1G value also compensates for mounting errors, what I meant was to get the real sensors 1g value. In flight you can use airtrim (it's always active - no cli stuff involved-, must be activated by stickcommand before arming - very simple procedure, see readme.txt)
Last edited by Crashpilot1000 on Mon May 05, 2014 7:25 pm, edited 1 time in total.

subaru4wd
Posts: 316
Joined: Sat Dec 08, 2012 2:16 am

Re: Harakiri aka multiwii port to stm32

Post by subaru4wd »

yeah i dont fly with my mag enabled, and yesterday was my first flight with some new motors. I have a lot of tuning left to do, so i will report back once thats done. It was just the only complaint i had after a 7hr day of FPV :)

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

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

I dont know if its just me but Testcode3 is doing something that is not consistent. Not a major issue, just wierd.

When I activate PH, I have noticed if you give it 2 seconds while holding position with sticks, it will then hold that position and altitude at that spot VERY well. Is this GPS settle speed in the params? My GPS has minimal drift right now, and I was watching via telemetry on map to make sure it was not moving first, so I was activating well below the settle speed. I dont think it was this.

If you do not let it settle, it drifts first then locks PH, but once holding it does it VERY well with .25M drift (maybe/max) for a total of 15 minutes, with altitude only .5M max for this same time.

What I have noticed between 3 multicopters (all running Harakiri Testcode3 with copied params), is that if I want to make an altitude correction to gain height, once past dead band it will climb at a rate related to stick position, if you return to dead band, it holds.

But

This is not always 100 percent for climbing while in PH. It will climb 5 out of ten times and work, and the other times, it does nothing, even with throttle max it still wont climb. It just holds altitude. if you descend though, it works 10 out of 10 times. decent always works.

I verified this about 20 times now between my different multicopters, and I think maybe my next test is to see if I can duplicate this in another mode such as altitude hold.

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 »

@Mr-Fiero

I did notice something similar with AltHold in other "firmware" ... in my case my educated guess was due to the "extreme" filtering. Having an "extreme" filtering it cause to have in the firmware a value that can be old even 1 second or half the second old ... like with filtering of 40 samples at 20Hz .. it cause that the end result is the "real" value but 1 second in the past ... so filtering means to work with old data.

So .. if you are moving and then you click on any hold .. the sensed data cold be old ... due to the filtering.

Anyhow ... it sound to me that the firmware to try here is TestCode3 .. my DIY Naze alike board is ready ... so ... time to decide which firmware to use and put this in the air.

Reading you guys ... I have really high hope ... 0.5m altitude accuracy ... I can get easily with my MultiWii board with just using the 5611 sensor (easy) ... but 0.25m horizontal accuracy in GPS hold ... it sound like a "dream" ... my MultiWii board does 10 time worst ... with +/- 2.5m ... and this is already consider good in the Atmega 8bit world with MultiWii

rank
Posts: 31
Joined: Fri Dec 06, 2013 5:27 pm

Re: Harakiri aka multiwii port to stm32

Post by rank »

My appologies for not reading through the thread. Just curious how the sonar is performing with the latest harakiri? Also, any cheap sonar you could recommend?!

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 »

rank wrote:My appologies for not reading through the thread. Just curious how the sonar is performing with the latest harakiri? Also, any cheap sonar you could recommend?!


My experience with Cheap sonar is quite bad.

On grass you don't get any reading above 50cm.

On asphalt you get a sonar reading up to 1m sometime up 150cm

Since in general I fly over grassl, 50cm is nothing unless you want to have a double check when the copter is on the ground in case of automatic landing.

Integrate a Sonar is very simple ... just 1 pin for trigger the start, and 1 pin for read the echo .. the time difference between trigger and echo is more or less the distance.

With cheap sonar, it is a waste of time ... the expensive ... I don't know ... but 5611 is already all you need for a precise altitude information.

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

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

> e_lm_70
I just want to point out.......

remember that I have been focusing on GPS and have upgraded my antenna's to 35mm active to try to get the horizontal more accurate with better signals from satts. My GPS fix is tight and has minimal deviation viewable via Ucenter. With Ucenter I can keep deviation plot within 1M max for hours, oh, and its in a basement while testing. I have also reduced as much as possible any RF interference to the GPS (real fun due to OpenLRS having a harmonic on GPS freqs) . My next step is to upgrade the GPS engine. I want to get a Ublox 8 onto a 35mm active ceramic antenna and increase my position update rates and see how it works then. Right now its the neo6 engine. My interest in Harakiri is the GPS functions, but, damn does it fly nice!

You will see good PH accuracy as you hope, I just wanted to point out I am splittin hairs to get it so tight on my GPS, as most GPS's to me seem only able to hold within 1M - 2M. I am however very pleased with Testcode3 and I have had no failures to date, just small quirks. Some quirks are probably just me, but I keep posting my results on the forum just in-case Crashpilot1000 notices anything he can use.

Thanks for the explanation about the filter, I really felt that it was an filter or average. Next flights I am going to test what you have said, and try it while still for adjustments, as well as moving and see what happens.

I cant wait to see how your flights go. I dont doubt you will love the alt hold once your dialed in.

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

Re: Harakiri aka multiwii port to stm32

Post by mj666 »

I have quite good experience with the Mabotix MB1242 I2CXL. This is connected via the I2C bus. The PWM version Mabotix MB1240 should work in the same way. Both are supported by Harakiri.

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

Re: Harakiri aka multiwii port to stm32

Post by Crashpilot1000 »

Hi guys, short notice.
PH accuracy can not be long term better than the underlying gps feedback, however acc support helps but needs gps correction.
Sonar: Thanks to mj666 strong effort, some I2C Sonars are also supported. The more expensive MB parts do way better over grass than the 5$ HC04. However MB parts come with a catch when connected over I2C because they only support slow I2C speed so mj666 has done an I2C speed switching algorithm.
Althold: Yep, the algo waits for the throttlestick to center before it accepts an altchange. When you are too quick on the throttlestick it may not be recognized, because the deadband around the center is skipped too fast and missed in the relatively slow loop. That also annoys me (forcing myself to be slow at the center so the algo gets it) that can be fixed to work more convenient.

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

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

Oh, Thanks for that about the alt hold. Explains it! Now I can adjust my flying to match expectations.

Would it help a bit if I increased my dead band? I am going to try to increase it to 10 and see if I can mask how it acts a bit. I am thinking 5 percent dead band might be easily missed for stick center while flying with altitude hold.

Post Reply