Harakiri aka multiwii port to stm32

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

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

@ crashpilot1000

I had a question, when I activate PH on a really heavy HEX 2900 AUW, my normal hover is 55%-60% stick with loaded camera, but when I activate PH or Alt hold, it wants to climb as its out of the deadband, and I do have to reduce throttle to %50. I thought maybe thr_mid setting would maybe change this, so I set it to %60 and it didnt change anything.

Obviously in PH, altitude is always to be center before hold, but would it not be better to have that altitude hold wherever the throttle mid is set to?
Last edited by Mr-Fiero on Mon Aug 25, 2014 8:44 pm, edited 1 time in total.

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 »

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.


yééz, this is the news I was waiting for... :)

ps: on Tue night BF4 time... :)

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

Re: Harakiri aka multiwii port to stm32

Post by Debogus »

Read and read and keyword searched but......Is there a way to input RSSI into a aux channel like in baseflight....from Frsky dr4 .....

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

Re: Harakiri aka multiwii port to stm32

Post by Debogus »

dublepst

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

Re: Harakiri aka multiwii port to stm32

Post by Bamfax »

Maybe the cli setting devorssi helps you. It assumes there is another channel after the last input channel (4+rc_aux). Rssi is taken from that appended channel.
Where does the d4r put the rssi signal? How to you put it into an aux channel?

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

Re: Harakiri aka multiwii port to stm32

Post by Debogus »

It is outputted on channel 2 reciever pin after 3-4 are bridged .
With baseflight you would plug this into pin8(aux4)

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: That is no problem, however I will stick to the physical centerpoint for althold regulation. It *should* do althold no matter where the stick is when turning on althold. Checking that logic is next (see: https://github.com/Crashpilot1000/TestCode3/issues/2).
@Debogus:Frsky RSSI is currently not implemented maybe later maybe not. It's open source so you can implement it or put in the RSSI into osd directly or stick to BF. On my DHTU Rssi is displayed all the time and can be coupled with acoustic alarm I guess the same goes for Taranis so normally you are flooded with RSSI information with frsky without further hardware hassle.
@Bamfax: BTW is that Devo RSSI working?
@bulesz: Hopefully we are on the same sides, otherwise I will need AWS to slow down your squad...
Has anyone tried out Gtune?

Cheers
Rob

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

Re: Harakiri aka multiwii port to stm32

Post by Debogus »

It will give me beeps at the transmitter for warning was just trying to dodge the bullet of doing that micro soldering on the mavlinkosd to get the info into the goggles.....

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 playing with G-Tune on one unit.
So far, this is what I have done.

>I programmed G-Tune to be activated via dedicated switch.
>before launch, in acro mode, I activate it. Then I fly a bit and do some sky-jumps also. I noticed that is wanted some time to settle each time so after some movements, I hover just for a bit.
>Land it (I saw the original code forgave landings)
>Read my PID's and if acceptable , then save to FC. I am using MultiWii EZ-GU while testing.

I leave the G-Tune switch activated until the save.

I have not had enough time on it, but what I noticed so far is that it did tune my P on the PID's. I didnt see any other changes to I, or D yet. I left the G-Tune at its defaults so maybe its a bit soft for tuning my Multicopter. I need to test more. the good news, is that it did not do anything weird. It made my P's a bit higher, but nothing was strange. I suspect if I run it longer, maybe after maxing the P, then the rest of the tune might start if it does I or D.

I only had two batts and got distracted by visitors when testing. I will be testing again in the next few days....I will post results then.

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

Re: Harakiri aka multiwii port to stm32

Post by Crashpilot1000 »

@Debogus: Sorry to let you alone for now with this but I have currently absolutely no nerve to look into that and it's more a cosmetic problem.
@Mr_Fiero: Great, nice to hear that it is working with your copter as well! The original Hefny zeropid doesn't contain a D calculation and the "I" calculation ended up way too small so I focused just on the leading P part. He currently implemented a code that is supposed to find the wobble frequency so that might come in handy for tuning a D part but I haven't looked/tried/ported his latest code (https://github.com/HefnySco/Multiwii_GTune). I think it's better to disengage the P tuner before landing just to make sure the presented P values are based on an airborne situation. I think the current implementation is usable because it will show you 2 things:
1. Are your current pids generally too low or too high?
2. Do you need different P (and probably "I") on one axis? Because even symetric copters may have differences there because of the heavy lipo. Finding different P for Roll and Pitch by hand is quiet timeconsuming - the tuner does that in seconds.
So it is helpful to get a better setup.

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

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

@ Crashpilot1000
I was enjoying having the P adjust with Gtune. It did tell me I was too soft. The really interesting thing, is my rubber dampening is softer on roll, than pitch, and Gtune noticed that and tuned for it. I never knew it was as different as it showed after Gtune.

I will dis-engage Gtune before landing as you suggest for future tunes.

I want to point out that MultiWii EZ-GU already had Gtune in AUX settings. Pretty up to date software for the android!

I was focusing on GPS tonight. Gtune will be this weekend! Tonight I was testing a Ublox Max7 that I added a bandpass saw filter that is really tight. (1575.42mhz 2meg pass) (http://www.digikey.ca/product-detail/en ... ND/3175429) It was performing sooooo much better yesterday. I went out today, and it worked pretty good, but not as good as yesterday. I fiddled around with it and got it to PH pretty good! but it bothered me that it was a hair off. Then.... late at night, holy freakin cow, northern lights bigtime! then I jumped on the android and checked software for GPS accuracy, and it said extreemly high solar activity and expect poor GPS accuracy. damn, if it will PH in that condition, I am very happy. I am just being really fussy as it was only drifting maybe .25M

So, since the GPS is nearing total competion (I want one more full day of testing) then I can focus on flying Gtune. After one unit is done, I plan on trying it on all the multicopters. Batteries are charging, and hopefully since summer is almost over, I can get some major flight time this weekend.

Thanks for the Gtune code injection. It seems to be functional so far!

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

Sv: Harakiri aka multiwii port to stm32

Post by strips »

Mr-Fiero wrote:@ Crashpilot1000
I was enjoying having the P adjust with Gtune. It did tell me I was too soft. The really interesting thing, is my rubber dampening is softer on roll, than pitch, and Gtune noticed that and tuned for it. I never knew it was as different as it showed after Gtune.

I will dis-engage Gtune before landing as you suggest for future tunes.

I want to point out that MultiWii EZ-GU already had Gtune in AUX settings. Pretty up to date software for the android!

I was focusing on GPS tonight. Gtune will be this weekend! Tonight I was testing a Ublox Max7 that I added a bandpass saw filter that is really tight. (1575.42mhz 2meg pass) (http://www.digikey.ca/product-detail/en ... ND/3175429) It was performing sooooo much better yesterday. I went out today, and it worked pretty good, but not as good as yesterday. I fiddled around with it and got it to PH pretty good! but it bothered me that it was a hair off. Then.... late at night, holy freakin cow, northern lights bigtime! then I jumped on the android and checked software for GPS accuracy, and it said extreemly high solar activity and expect poor GPS accuracy. damn, if it will PH in that condition, I am very happy. I am just being really fussy as it was only drifting maybe .25M

So, since the GPS is nearing total competion (I want one more full day of testing) then I can focus on flying Gtune. After one unit is done, I plan on trying it on all the multicopters. Batteries are charging, and hopefully since summer is almost over, I can get some major flight time this weekend.

Thanks for the Gtune code injection. It seems to be functional so far!


Where do you live? To see the northern lights.

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

Re: Harakiri aka multiwii port to stm32

Post by Bamfax »

Rob, devorssi is working great, I had a good time using this feature. Many thanks again for this feature.
A few month ago I also hopped on the Frsky train, so this will keep me busy with these new telemetry features I am learning to enjoy.

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:
Where do you live? To see the northern lights.


Southern Alberta, Canada. We see them a few times a year.

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

Sv: Harakiri aka multiwii port to stm32

Post by strips »

Mr-Fiero wrote:
strips wrote:
Where do you live? To see the northern lights.


Southern Alberta, Canada. We see them a few times a year.

Wow. Maybe you got different earth magnetics (for lack of a better word) on your side of the globe :-) In south of Norway we also see it a couple of times a year or maybe not at all. In Denmark you almost never see it. And you are about as far north as Germany if I'm not mistaken.

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

Re: Harakiri aka multiwii port to stm32

Post by Crashpilot1000 »

@Bamfax: Thank you very much for the DevoRssi feedback, I feared I wrecked it during the versions... For the others that don't know about it (didn't know about that as well until bamfax told me about it: http://www.deviationtx.com/). Will probably buy a Taranis at one point in time when my TX is F.U.B.A.R.
I haven't looked too much into RSSI in general because my video TX (or my eyes in LOS flight) tilt out much before my RC equipment could fail. Is there a standard for RSSI feedback in general (not speaking of PWM or analog here)? Is it a real percentage or some non linear dB stuff?
@MrFiero: Those SAW filters seem to very beneficial! Perhaps it is a good idea to collect those infos in another thread because they are of general interest (multiwii/cleanflight/baseflight etc.)and your work may get lost here. Maybe a quick'n'dirty photo of your wiring would be helpful and maybe a collection of good working config files (for different ubloxes). A collection of gps / vendors that already come with SAW filters (I think Autoquad, Openpilot and 3DR GP$ already have that, just wondering if my 30€ navilock is also equipped with that because it works better than the other one I have...). Just a thought.
@Bulesz: Thanks for the BF4 fight on Tuesday! .. Though "lancang dam" ended up in a nasty baseraping session... leaving no chance for them ... that was not very gentleman like....but hey, they would have done the same with us. BTW: I think they hated our supply/engineer/attack heli combo...
@all:
Gtune is in its present state just a little helper. And flying with lower or higher P than suggested is not wrong it depends on your flying style / main purpose of copter. Thinking about porting the Gtune idea over to the baro to have a "Btune" hmm.. wondering if that could work.. only one way to find out. This WE is packed with other stuff - hope to do something on sunday.
Cheers, happy WE and no crashes!
Rob

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

Post by strips »

Kind of irritating not having a quad to put Harakiri on. I need a sturdy gps mount to get it away from other antennas and a pedestal is not an option. I have already smacked my Nemesis 250 in the ground enough. Don't want to destroy the GPS.

But I do have a heavily modified Turnigy talon 630 quad with APM. it flies well enough but am not satisfied with descents. Very wobbling. More than I would expect. My 250 with Baseflight is super smooth in descents.

How well would Harakiri work on a 630 frame with 15" props and AUW ~2.5kg? Can I expect less wobbling descending than APM?

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

Re: Harakiri aka multiwii port to stm32

Post by Crashpilot1000 »

Too bad I broke my crystal ball yesterday. Descent wobbles are mainly aerodynamically induced (even propeller shape), however the general reactiontime of the flightcontrol/esc/motor combo is also a factor and in that regard especially the dampening D part. I have no flying Arducopter anymore after some incidents.. so hard to say but the 8 bit is so stuffed that the cycle time is around 10ms so that is not helping the situation. But I would give it (naze/flip32/mw32) a try (CF/BF/Harak) chances are good that you will see an improvement with your 2,5Kg stone. Harakiri has a different handling of the D part than Mwii/BF. It is mainly due to BRM's input to attach an pt1 element (Hz filter) and I find it very helpful to reduce descent wobble. Orig mwii/bf, probably CF as well use a 3 values moving average on the 2000DPS gyrovalues/4. Harakiri uses a little (ca. 20%) more precise gyro data and a frequency adjustable filter instead of the moving average FIR filter. So when your PID tuning is done and still too much wobble you can play around with maincuthz = 12 [1-100Hz].

Vertigo
Posts: 41
Joined: Mon Jul 08, 2013 6:58 pm

Re: Harakiri aka multiwii port to stm32

Post by Vertigo »

Im slightly confused. I want to try harakiri, I managed to flash it to a naze test board using baseflight (flashed the .bin). But I dont understand how to configure the "cli" options. I cant connect using baseflight, and I can communicate with the board using MultiwiiConf, but there is no CLI there. Sorry if I missed something obvious?

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

Re: Harakiri aka multiwii port to stm32

Post by Bamfax »

Open a normal serial connection to the FC and type 3x Enter or ### (3x "#")

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

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

115200 baud is default for the terminal.

This GUI is functional... In the CLI of this software, you can set your extra options. I dont use a GUI much myself and use a terminal to change my settings as a GUI does not reflect everything the Harakiri firmware has for options.

cGiesen's GUI: http://www.klick-punkte.info/download/B ... tGUI23.zip

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

Re: Harakiri aka multiwii port to stm32

Post by Bamfax »

Btw, I found "termite" to be a simple, clean and nicely working Serial Terminal Program: http://www.compuphase.com/software_termite.htm. Copy and paste works and it hides all that terminal detailgore. At least for me, that is. It is the opposite of hterm, etc, so hardcore geeks, avoid ;)

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

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

Bamfax wrote:Btw, I found "termite" to be a simple, clean and nicely working Serial Terminal Program: http://www.compuphase.com/software_termite.htm. Copy and paste works and it hides all that terminal detailgore. At least for me, that is. It is the opposite of hterm, etc, so hardcore geeks, avoid ;)


Thats awesome, very clean prog...cut/paste works well. my new fav.

-----------------------------------------------------------------------------------------------------------------------------

found a good whitepaper about GPS/FPV issues, not related to setup. I am only posting this for anyone who is interested. Its simplified and a good read. It does however talk about dirty supply to GPS, and thats been one of my findings. The active antenna setups have very little filtering as well as the GPS boards that house the engines. Of course better GPS's boards have some filtering. Anyways here the paper is.......


http://www.dpcav.com/data_sheets/whitepaper_RFI.pdf

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

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

Tonight I was working with Gtune on a x450 CF 1000KV 10x4.7 props AUW 1100g

It was working well and increasing the P's. It did tune my yaw very nice. It actually surprised me with the final number, but it was holding yaw better than ever after the tune. When it increased the P's on pitch/roll it took it to the point of being a touch jumpy. I dis-engaged the Gtune and landed and saved. It flew good, except the touch jumpy. I need to fly it more though as I think my level setting is possibly too high causing the issue.

My only question is, how long to fly to get a complete tune? is it very short or should it all be averaged over maybe a whole lipo flight of 15 minutes? The reason why I am wondering, is because I saw the increase, but did not see a decrease. Maybe my flight was not long enough as I was testing for only 3 minutes per flight. I was doing that because when I landed I wanted to make sure the numbers still were reasonable. And they were.

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

Sv: Harakiri aka multiwii port to stm32

Post by strips »

Crashpilot1000 wrote:Too bad I broke my crystal ball yesterday. Descent wobbles are mainly aerodynamically induced (even propeller shape), however the general reactiontime of the flightcontrol/esc/motor combo is also a factor and in that regard especially the dampening D part. I have no flying Arducopter anymore after some incidents.. so hard to say but the 8 bit is so stuffed that the cycle time is around 10ms so that is not helping the situation. But I would give it (naze/flip32/mw32) a try (CF/BF/Harak) chances are good that you will see an improvement with your 2,5Kg stone. Harakiri has a different handling of the D part than Mwii/BF. It is mainly due to BRM's input to attach an pt1 element (Hz filter) and I find it very helpful to reduce descent wobble. Orig mwii/bf, probably CF as well use a 3 values moving average on the 2000DPS gyrovalues/4. Harakiri uses a little (ca. 20%) more precise gyro data and a frequency adjustable filter instead of the moving average FIR filter. So when your PID tuning is done and still too much wobble you can play around with maincuthz = 12 [1-100Hz].


You should take better care of crystal balls ;-)

Thanks. I know it's turbulence created but I'm hoping a "faster" and more controlled FC might reduce it. You have given me a reason to try it out. I need to film it before and after switching to Harakiri.

Vertigo
Posts: 41
Joined: Mon Jul 08, 2013 6:58 pm

Re: Harakiri aka multiwii port to stm32

Post by Vertigo »

Bamfax wrote:Open a normal serial connection to the FC and type 3x Enter or ### (3x "#")


Thanks, that seems to work.

One more question (for now); what does harakiri do when a valid home position is registered, but the GPS reception is lost during the flight and then a failsafe RTL is triggered ? Im flying with a 1.3 GHz FPV setup and as a result, my GPS reception is rather poor, so this may happen. Will it fly to the African East coast (as Naza's seem to do), or will it hover, autoland, or something?

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: Gtune is fiddeling with the P's all the time (if enabled). There is no special point in time when it is done. I've not seen saturation effects in my copters (that doesn't mean you have none...) - however the P fiddeling is limited to preset 2.0-7.0 range if your copter needs something like 8.x it will flat out at P of 7.0. Thats why the range is adjustable (see https://github.com/Crashpilot1000/TestC ... G-Tune.txt). So please make sure you don't see those limits as saturation. If you still have saturation let me know, then it's time to scale down "gt_pwr" internally to the "negative" side.
@strips: I know there was a guy that built a monster of a copter (with build in crane to rescue/pick up other copters) with harakiri. So I am pretty confident the 2,5Kg stone will fly as well.
@Vertigo: I should do a readme on the failsafe. If the internal Failsafe of Harakiri (not speaking of internal FS settings of your receiver here) is triggered it tries the best to do something healthy with the copter depending on available sensors and their status. If GPS becomes unhealthy and a Baro is present it will center the (virtual) roll / pitch sticks, engage level mode (and magmode to try stabilizing yaw) and do an autolanding (without PH because GPS isn't working..).
Please look into config.c for details on parameters.

Besides having FEATURE_FAILSAFE enabled there are some variables that might be of interest for you:
https://github.com/Crashpilot1000/TestC ... fig.c#L279
https://github.com/Crashpilot1000/TestC ... fig.c#L295

Code: Select all

cfg.rtl_mnh = 0; // (0 - 200m) Minimal RTL hight in m, 0 disables feature
cfg.rtl_cr = 80; // [10 - 200cm/s] When rtl_mnh is defined this is the climbrate in cm/s
cfg.rtl_mnd = 0; // 0 Disables. Minimal distance for RTL in m, otherwise it will just autoland, prevent Failsafe jump in your face, when arming copter and turning off TX
cfg.gps_rtl_flyaway = 0; // [0 - 100m] 0 Disables. If during RTL the distance increases beyond this value (in meters relative to RTL activation point), something is wrong, autoland

cfg.fs_delay = 10; // in 0.1s (10 = 1sec)
cfg.fs_ofdel = 200; // in 0.1s (200 = 20sec)
cfg.fs_rcthr = 1200; // decent Dfault which should always be below hover throttle for people.
cfg.fs_ddplt = 0;   // EXPERIMENTAL Time in sec when FS is engaged after idle on THR/YAW/ROLL/PITCH, 0 disables max 250
cfg.fs_jstph = 0; // Does just PH&Autoland an not RTL, use this in difficult areas with many obstacles to avoid RTL crash into something
cfg.fs_nosnr = 1; // When snr_land is set to 1, it is possible to ignore that on Failsafe, because FS over a tree could turn off copter




Will it fly to the African East coast (as Naza's seem to do), or will it hover, autoland, or something?


Yes, why not, probably pretty places there... Ok serious now. If something goes wrong (like jammed motor in an hexa/octo etc, suddenly mag going crazy, strong unfightable wind etc.) and copter is spiraling away the calculated distance between the homeposition on engaging RTL and the currently gps reported spot distance to home will increase and not decrease like expected. So the RTL is a return to somewhere else for whatever reason. That's where gps_rtl_flyaway comes into play. Lets say you set gps_rtl_flyaway = 50 (meters).
Failsafe occurs 800m away from the homepoint and RTL is engaged (you or failsafe). Those 800m are calculated and stored for comparison. If on the supposed way home the distance increases beyond your threshold of 50 m (like distance suddenly 850m) it will try PH and autoland. So it will flyaway but not too much.
fs_ddplt is a dead pilot detection in seconds. So if the RX is still receiving healthy but unchanged signals for that period of time (in seconds) dead sticks/internal TX error or a dead pilot is assumed and FS engaged.
fs_jstph is for the people that don't want RTL (even if possible) but just a PH and autoland (flying in the woods or other cluttered areas).
rtl_mnh is the minimal hight in meters BEFORE RTL to avoid trees etc. So copter does PH checks if minimal hight is ok, climbs if necessary (with predefined climbrate rtl_cr) and then does RTL. So if rtl_mnh = 35 (meters, more than enough to avoid trees in my area..) and RTL engaged in 100 m hight, no climbing/descending is done just RTL sequence (autoland).
fs_rcthr is just for the guys that don't have a baro to ensure a smooth autolanding (that value is ignored, if baro is present). Even the cheapest Bosch baro can save your copter a great deal (broken arms, bent motors etc..), so hard to understand why not to have such a simple safety device even if no althold is desired in flight. If it's going down with a baro guided autolanding or just a predefined throttle makes a difference... that difference can be much more expensive than a 4$ BMP breakout board...
rtl_mnd is the minimal distance in meters where a complete RTL sequence with - if defined rtl_mnh - is done. Reason: Failsafe can be just engaged if the copter is airborne. The airbornestatus is assumed after an autostart sequence (like as_trgt = 2 (meters), althold and throttlestick middle -> airjump to 2 meters - don't try this indoors...) or if the esc_nfly throttle is exceeded. So in the worst case you exceeded esc_nfly on the ground and the copter thinks it could be airborne and you have set a minimal RTL hight like rtl_mnh = 35 meters and something goes wrong with your transmitter (you turn it off, or it fails) it will do PH and climb to 35 m and that maybe into your face. So if you set rtl_mnd = 20 meters an RTL sequence in that radius around the homeposition will not be possible, you will have to walk and pick it up. If RTL is triggered (by you or failsafe) beyond that distance, a complete RTL will be done.

What is a Homeposition in Harakiri?
The homeposition is set when Harakiri has a valid set of Lat/Lon GPS coordinates and the copter is armed. So simply watch the red led. It will start to flicker when 5 sats are found and you can count the flickers to know how many sats are seen right now. After a flicker block a pause of 2 seconds is done, then the flickerblock is send again. Example: you see it flicker 2 times and then pause (ca. 2secs) and then flicker again lets say 3 times. You know Harakiri received valid GPS data coming from 6 sats and then having most probably better data from 7 sats etc. If you arm now your homeposition will be taken from these reported values.
Worst case: User: "Fu** that red LED stuff I want to fly" Lifts off with no red led flicker (no sats, no homepos). During flight a FS occurs (user: "Ohh sh*t..") with no homepos -> Autoland (or no baro: fs_rcthr and fs_ofdel). Or during flight 5 sats are reached and copter (obviously) armed - Homepos set somewhere on the flightpath. FS occurs - copter will do "RTH" to that random point of the flight where the homelock was done.
Other example: Copter is sitting in place A with sufficient GPS reception and was armed but then disarmed and carried to place B while still under power and then armed again - liftoff etc.. In this case the last armingpoint (place B) is the homeposition. So armed status will set a homeposition if at least 5 sats are present, disarming will clear the homeposition.


-Sorry for my bumpy English-
Cheers Rob.

Vertigo
Posts: 41
Joined: Mon Jul 08, 2013 6:58 pm

Re: Harakiri aka multiwii port to stm32

Post by Vertigo »

Thank you very much for a very elaborate explanation!

Failsafe sounds pretty sensible, however the way it works, it sounds as if I should disable the FS function of my receiver, so the flight controller understands its a FS situation and not a manually triggered RTL as it seems to react slightly differently, correct? Or will it also autoland if RTL is triggered manually (via AUX) and there is no GPS lock? Alternatively, is there a way to trigger a FS situation via AUX, so that I can use the receiver failsafe function and still, for instance, motors get disarmed after some time too?

Speaking of which, I assume "cfg.fs_ofdel" is the time after which motors will be disarmed? Does it start counting the moment FS occurs, and ignores time to climb to min rth height etc ?

Finally, something completely unrelated, and just an idea; I like having expo on my throttle stick around the hover position. However, that position changes over time as the battery discharges (or I mount different props ets). I was trying to program my taranis in such a way that it would adjust the exponential curve when I hit a switch, and use the current throttle position as new center point for the expo. But it would actually make much more sense if the FC did this; after all, it could do it gradually and continually since it can figure out what throttle position is needed on average to maintain altitude, at least if you are not flying crazy aerobatics all the time. If one day you run out of things to add to the firmware, perhaps this is something you could work on ? :).

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

Re: Harakiri aka multiwii port to stm32

Post by Crashpilot1000 »

cfg.fs_ofdel is just for the guys with no baro. After Baro autoland the copter is turned off automatically after a while. There are parameters that can influence the time needed before disarm (or even sonar, look at config.c al_XXX) the presets are safe to not reach a haslanded condition while still airborne.
You can set both. If you set the RX to turn on the "GPS HOME" box on signal loss it would do the same sequence (climb if defined, autoland, disarm) like triggered by failsafe.
The midstick hoverstuff is different than in BF so it is highly recommended to not have the TX fiddle around with the throttlestick to compensate for some draining lipo in baromode. In Harakiri in althold/baromode the throttlestick becomes just a stick that gives your wishes to the FC (autostarting, autolanding, rising, diving) not a real throttle. You can have a relatively high alt P because the strength of the variobrake (alt I) will brake oscillations in a wider range. So in the sum the P can compensate for a draining lipo quiet well. (note: "alt D" is the strength of the throttleanglecorrection). So I am not sure if your observations/proceedings are based on BF/CF or Harakiri?
Cheers Rob

Vertigo
Posts: 41
Joined: Mon Jul 08, 2013 6:58 pm

Re: Harakiri aka multiwii port to stm32

Post by Vertigo »

In Harakiri in althold/baromode the throttlestick becomes just a stick that gives your wishes to the FC


I wasnt talking about althold mode; I do want manual throttle control, and its okay -even desirable- that with a full battery hover is achieved with, say 30% throttle, and with an empty battery at say 50%. THats how it is with any flightcontoller/firmware right now (when you are not using alt hold). What I would like one day is that the sensitivity of the throttle (expo) is reduced around the actual "mid" point (ie, hover point), be it 30 or 50 or something inbetween depending on battery weight, charge, or what props Im using. I was trying to tell my taranis when I achieved hover by flipping a switch and make it adjust the expo center accordingly, but I didnt manage, and figured the flight controller could do this better without flipping switches.

Anyway, I tried harakiri today, and didnt manage to get my MTK GPS to work (it worked fine using BF). I experimented with GPS type settings and baud rates, but it wouldnt detect it. Since weather predictions are finally looking up, I reverted to baseflight for now, Ill revisit harakiri once it starts raining again.

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

Post by strips »

@Crashpilot1000
Interesting stuff about dual acc in the Cleanflight thread. You thinking of doing something like that in Harakiri?

flyka737
Posts: 3
Joined: Sat Jun 07, 2014 5:18 pm

Re: Harakiri aka multiwii port to stm32

Post by flyka737 »

Hello guys, i'm new to naze32 and i would like to try TestCode3. How do i flash it to the board, and what configurator should i use for it, since as i heard baseflight configurator won't work for either. Cheers: Csabi

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

Sv: Harakiri aka multiwii port to stm32

Post by strips »

flyka737 wrote:Hello guys, i'm new to naze32 and i would like to try TestCode3. How do i flash it to the board, and what configurator should i use for it, since as i heard baseflight configurator won't work for either. Cheers: Csabi


Look here for last FW: https://github.com/Crashpilot1000/TestCode3

To flash you can use Baseflight Configurator. To configure you use CLI. You can use a Multiwii GUI but I wouldn't use it for anything else than verifying RC / AUX.

DaggyMAC
Posts: 3
Joined: Sun Aug 31, 2014 2:33 pm

Re: Harakiri aka multiwii port to stm32

Post by DaggyMAC »

Baseflight configurator after flashing Testcode3_r79 to afromini32 board don't want to establish connection anymore. What program should I use to have CLI? I am running Mac.

Is testcode3_r79 compatible with afromini32 board with BMP180 barometer?

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

Sv: Harakiri aka multiwii port to stm32

Post by strips »

DaggyMAC wrote:Baseflight configurator after flashing Testcode3_r79 to afromini32 board don't want to establish connection anymore. What program should I use to have CLI? I am running Mac.

Is testcode3_r79 compatible with afromini32 board with BMP180 barometer?

I made this mini howto on rcgroups. Maybe it can help you. I did that on a Mac. http://www.rcgroups.com/forums/showpost.php?p=28963817&postcount=4271

DaggyMAC
Posts: 3
Joined: Sun Aug 31, 2014 2:33 pm

Re: Harakiri aka multiwii port to stm32

Post by DaggyMAC »

Hi strips, thank you for pointing me right direction. I've tried your mentioned method in Terminal app, but I was not getting full dump configurations, so I was searching a little bit and found great free app in App store called SerialTools. With this app I can easily manage all configurations in CLI. Thank you :)
Attachments
SerialTools
SerialTools

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

Sv: Harakiri aka multiwii port to stm32

Post by strips »

DaggyMAC wrote:Hi strips, thank you for pointing me right direction. I've tried your mentioned method in Terminal app, but I was not getting full dump configurations, so I was searching a little bit and found great free app in App store called SerialTools. With this app I can easily manage all configurations in CLI. Thank you :)

Thanks for the tool tip. Screen is a bit cumbersome.

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

Re: Harakiri aka multiwii port to stm32

Post by Crashpilot1000 »

@Vertigo: Ahh, ok I didn't get that with the throttlestuff. I have no intentions to implement that - but it could be done probably using vbat. MTK 3329 (with different firmwares) is tested for basic function and works in NMEA and both binary formats however ublox is recommended. But BF is also fine, of course.
@strips: I did some stuff with dual acc but couldn't get mpu and mma to work beneficial together. They worked together but the practical result was not better. The fact that I failed to produce something better using mma & mpu together means nothing. I have hopes that BRM can turn something up.
Thanks for the rcg link! Testcode3 should be (can not test that) N5 (incl. Buzzer) compatible (you will see that immediately). That xjet guy stired up the frsky 18ms ppsum problem again (http://diydrones.com/profiles/blogs/why ... appointing http://forums.openpilot.org/topic/16146 ... cppm-mode/) and ppl start disabling channels etc. at rcg and that is worth a little "lol". Well my frsky has the problem and is unflashable however I use 8 channels at full range with confidence because the problem is fixed in software - discussed that here (incl. alternatives besides flashing): viewtopic.php?f=23&t=3524&p=54219#p54189. The baseflightgui is compatible to baseflight and not multiwii, harakiri etc. In this context also @DaggyMAC there is a link in the downloadbox you clicked that leads here: viewtopic.php?f=23&t=3524&p=54219#p54219 and should sum up the basic usage (flashing/gui/cli). AFAIK the BMP180 is compatible with BMP085 so it should be (can not test that) compatible (you will see that immediately). I've spent *some* time with the BMP085 and think that I squeezed the most out of this part (tested - have a copter using it..).
Cheers Rob

flyka737
Posts: 3
Joined: Sat Jun 07, 2014 5:18 pm

Re: Harakiri aka multiwii port to stm32

Post by flyka737 »

Strips you are the best! <3 Also can't forget crashpilot who made all that happen. lol :D Cheers

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

Re: Harakiri aka multiwii port to stm32

Post by Debogus »

What is the term in harikari for motor stop...... as in when armed the motors dont spin up at low throtle
MWOSD has a new beta that has a harkari setting.......Trying to set this up .....one more time........Last time I gave up was MWOSD wouldnt show modes or arm disarmed from harikari

Vertigo
Posts: 41
Joined: Mon Jul 08, 2013 6:58 pm

Re: Harakiri aka multiwii port to stm32

Post by Vertigo »

Crashpilot1000 wrote:. MTK 3329 (with different firmwares) is tested for basic function and works in NMEA and both binary formats however ublox is recommended.


Do you need to configure what port it is connected to (serial/softserial/.. ?) Or otherwise activate GPS somehow ? My MTK is soldered to channels 3 and 4 (default), and the GPS didnt show up using "status" or in mw gui with any of the GPS types and a few baudrates I tried. Anything else I could have missed?

Anyway, a U-blox NEO-6M is on its way for another quad.

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

Re: Harakiri aka multiwii port to stm32

Post by Debogus »

Never mind I remembered .......rc_motor =2
OK does anyone know what setting might be pertinent to the MWOSD so it will read modes on the OSD ?
Ive put the latest MWosd ver 1.2 that actually has a box for harikari in the config.h
Tommrow will check on goggle....crossing fingers

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 messing around with the GPS engines and have figured a few things out. I'll keep it simple.

First of all, my SAW filters with a 2 meg bandwidth work very well, but they have a side consequence. when I dump the L2 band with the bandpass set to L1, it limits my GPS receiver to only half the channels. Its not a bad thing though because it really rejects noise. Testing on a Neo6 I can only get ususally 8 - 10 channels, once in a while another channel still receives but I filter it with a signal to noise ratio. I dont care about he other band as its swamped by my TX video 1.2Ghz.

8 good SV's are perfect. I need to stress the word "good". I would take 8 good SV's rather than say 12 SV's good/bad any day! But, I get 8 SV's in my basement. 8-10 outside, still not bad!

The problem with the newer GPS's are the antenna's are wideband, and even though they can receive more SV's, even GLONASS, its not always a good thing for what we are trying to do. Just because you receive a large number of SV's, they may not all be good quality. Also another major point here that I have ran into several times, its not the position accuracy we need for flight, but rather a relative position, with as little as possible deviation from that position. The only deviation that we need is the actual flight deviation, not GPS deviation.

Thats why when "Assist Now" or "SBAS" is enabled, it works against having a good PH. Trust me, I have tried, again and again to make it work, until I found the jumps in flight was when the corrections kicked in, or out. It looses the relative position and tries to output from the GPS a corrected position.

I dont have a Ublox 8 engine to play with. Hopefully soon, just for testing, but I dont think it has much over previous engines if they are set-up right. The two benefits I can see, would be the SAW filter (even though it wont be tight) and the number of channels with the parallel processing. It might be a faster fix, but because we only have a limited number of SV's at any given time, they accuracy would be the same as compared to a properly set-up predecessor. GLONASS might appear more accurate when you drive around and compare against a map, but again, thats not what automatic flight needs. If one has a Ublox 8 engine, play with the deviation and see what it looks like. I would be curious. I bet if GLONASS were disabled there would be less deviation. Also to note is that the max7 series wont do GPS and GLONASS at the same time, its either/or.

Anyways, even with my limited channels on the Neo6 engine, its a very tight PH for me! The setup I have is the 35mm active antenna, with the 2meg bandpass SAW installed. But, y config file was relaxed so it would still be senitive to the SV elevation, but filters a bit on PDOP and HDOP. Also the config rejects a bit more noisy SV's. I did this so its still compatible with smaller antenna's.

Its got SVINFO active as I found at 115200 baud there are no errors and has allot of headroom anyway to the FC. SVINFO enables one to view the SV's in Ucenter. I also found that with the Neo6 engine, most extra messages have been disabled and only a few are active. I was trying to reduce the payload on the engine but I found when its already stripped of most, a few extra active does not make any difference how the engine performs. I will post the Neo6 config as its working very well for my multicopters. I have the engine NAV rate set to 5hz as its all the Neo6 will handle accuratly. I am also almost done the MAX7 config, but its so close to the Neo6 excluding the 5hz. I set the 7 series to 8 or 10hz.

Most of GPS errors can be reduced by looking at power supply noise, antenna gains/noise, and any other interference on GPS freqs. Signal strength/quality is very important!

Anyway, this config has no magical solutions to fix a bad GPS, but I can say, its probably as good as it gets for set-up on the Ublox. If you test, either watch the deviation in Ucenter, or use your GUI on map, and see how much it drifts. You will know if anything you did made a difference by a quick test like that.

Remember, make sure your GPS works good, its critical for proper operation for Harakiri to perform at its best...... This GPS config file, is a good start, but of course you still have to tune Harakiri as well.

I have ordered these GPS's for testing. Paul is usually pretty fussy at what he uses, and he really boasts about this GPS. So, we will see how they perform when I get them. Should be interesting.
http://witespyquad.gostorego.com/ublox- ... plane.html
Attachments
NEO6 35mm FLIP32-CAM September 2 2014.zip
NEO6 config for Ucenter
(949 Bytes) Downloaded 163 times
2014_09_02_18_31_36_Greenshot.zip
Screenshot of Ucenter deviation test, worse case, in basement!
(162.23 KiB) Downloaded 134 times

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

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

I want to quickly note about Gtune.

I have right now 4 units with Gtune. I am finding that every one was tuned low on my P's. I think this was because I mainly use my multicopters for photography and I like it smooth, therefore I have always had the habit to tune low.

I have however found something out. I have had such a time trying to tune my heavy HEX AUW 2.9Kg for a good PH. I was trying everything but when it was in PH, it would start out good, then it would start to gradually circle, growing each rotation until eventually it would just make a too aggressive move and I would have to stop the PH.

I was going after the GPS first, then settings in Harakiri, and never really made it work. I thought maybe it might be the 1.2G tx right beside the GPS (part of the reason of trying a SAW filter), but on another unit, same setup it works in PH VERY well. Then, since I was having so many issues I just thought I would dump Gtune into this unit. I let Gtune run, and was very surprised it increased the P on all my settings by such a large number. (3.2 to 4.9) It was flying good after Gtune, so I just thought lets try the PH. It Held! Really well for a whole battery each time, and in the wind. Now I think what a major part of the problem is that my HEX was not responsive enough to handle the PH corrections and because it was so sluggish, it would amplify each move needed, but never be able to apply the corrections in a reasonable time. I never thought that my P's had anything much to do with PH (duh) , but now I know it can make a big difference. I am sure it was much more prevalent due to my units size and weight.

Gtune, will be a great tool to get into the tune ball park! I have really enjoyed the quick tunes and Gtune seems to always work so far for me.

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

Sv: Harakiri aka multiwii port to stm32

Post by strips »

Mr-Fiero wrote:I want to quickly note about Gtune.

I have right now 4 units with Gtune. I am finding that every one was tuned low on my P's. I think this was because I mainly use my multicopters for photography and I like it smooth, therefore I have always had the habit to tune low.

I have however found something out. I have had such a time trying to tune my heavy HEX AUW 2.9Kg for a good PH. I was trying everything but when it was in PH, it would start out good, then it would start to gradually circle, growing each rotation until eventually it would just make a too aggressive move and I would have to stop the PH.

I was going after the GPS first, then settings in Harakiri, and never really made it work. I thought maybe it might be the 1.2G tx right beside the GPS (part of the reason of trying a SAW filter), but on another unit, same setup it works in PH VERY well. Then, since I was having so many issues I just thought I would dump Gtune into this unit. I let Gtune run, and was very surprised it increased the P on all my settings by such a large number. (3.2 to 4.9) It was flying good after Gtune, so I just thought lets try the PH. It Held! Really well for a whole battery each time, and in the wind. Now I think what a major part of the problem is that my HEX was not responsive enough to handle the PH corrections and because it was so sluggish, it would amplify each move needed, but never be able to apply the corrections in a reasonable time. I never thought that my P's had anything much to do with PH (duh) , but now I know it can make a big difference. I am sure it was much more prevalent due to my units size and weight.

Gtune, will be a great tool to get into the tune ball park! I have really enjoyed the quick tunes and Gtune seems to always work so far for me.

Sweet. Can't wait to test it 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 »

Going to hopefully test Gtune tomorrow. built another quad, now number 7. I made it from misc parts i had laying around, and built it larger than my x600, but its 400grams lighter! AUW is 1100grams with 2 x 3s 2200mah batts. This unit has 750KV whitespyquad motors (220w i think) and 12x5.5 CF props. all my electronics are in a 50mm square in the center that I milled to fit CF booms. Should be interesting. Man, I was trying for 1000g, but maybe over time I can shave another 100g off the unit, maybe.

I am going to use Gtune right off the batt and see how it performs. Weather permitting.....and weather has been a bit on the crappy side for the last few days.

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

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

Gtune worked on the new unit. It quickly took me to usable P values but on the 750kv motors, it wanted high p's at 9 and 9.2. I would of never tried those high values, but it did fly very well after Gtune. The only thing that did not turn out, is with the 750kv motors, they were sluggish, and in my area with winds allot of the time it wont work for me. So tonight I changed the motors to 1000kv with 11x5 CF props, and tomorrow i will run Gtune again on the unit and see what happens.

It is nice to have Gtune to quickly setup a unit. I am enjoying it.

OK, on another topic, on my units, Home position is always set to when the FC gets the minimum SV's, and gets a fix. It keeps that home position until the FC is rebooted. Is there a way to have home position set every time its armed instead? If it were this way, the only conflict would be if you landed some-place other than home, and disarmed. but that's rare in most cases. I think it would be better if it were set on every arm because it would always update the new relative position, and altitude each time. If flight times are long, or if you have a long time inbetween flights say if you landed for a bit and continued, the deviation for the total duration is larger, and if you RTL you can be a few meters off target. I feel it would be minimized if it were updated every launch.

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

Re: Harakiri aka multiwii port to stm32

Post by Mr-Fiero »

@ Crashpilot1000

maybe this might work better. I have more to do on it but its a start. Basic settings are in there. I am not a coder, so I dont know where to put only the UBX configs. Anyways, I figure this would enable me to use gps_type = 1 and have these settings push to the Ublox.

https://github.com/mr-fiero/TestCode3/b ... /drv_gps.c

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

Re: Harakiri aka multiwii port to stm32

Post by Crashpilot1000 »

Sorry dudes for not posting here quiet a while now. I will try to answer/comment on the last posts here.

@flyka737: Thanks!

@Debogus: There are several options for motor stop stuff. Look here: https://github.com/Crashpilot1000/TestC ... ME.txt#L92 . Having a non working OSD is most likely to a serial problem (wrong wiring, wrong baudrates) or a missing armed status. Having wrong flightmode reports in the osd are most likely an configuration issue of the osd soft?

@Vertigo: Softserial is not implemented and I don't see it for several reasons. Dominic Clifton did a great job on that subject and I think many stm devs will embrace his work with other projects! MTK 3329 has different firmwares. In doubt you can always use NMEA mode. This old post has still valid connection pictures of sonar and gps: http://www.fpv-treff.de/viewtopic.php?f ... 368#p20577 (scroll a little down). Concerning your MTK look in the next post on that site: http://www.fpv-treff.de/viewtopic.php?f ... 368#p20580. However MTK 3329 has more lag than Ublox. I've reports that some ppl quiet happily use the 10€ ublox here: http://www.banggood.com/GY-NEO6MV2-Flig ... 15384.html . BTW: Whatever some sales pages suggest: You must have a groundplate for GPS. GPS functions are not tested with MTK. They WILL work but you will probably have to alter "gps_ins_vel" (probably lower value).

@Mr-Fiero: Wow! I see you are really knee deep in the ublox innards! I have no idea how to mount/wire up such a filtering device - could you post a picture of your wiring? Altering / extending the config block in gps.c to your needs is completely OK and no problem! I will try it out but I guess it will be a good replacement of the existing block. Since you've messed around so much with ublox I think original mwii / cleanflight / baseflight should have a look at it as well.
Concerning the homeposition. The homeposition is set when the copter is armed because having a homepos set on launch after landing may not be detected correctly. The groundhight is recorded ("set to 0" agl) and will probably vary during flight (baro may heat up, weather/airpressure change etc) so the Autolanding code doesn't use the absolute hight for the "has landed condition".
Thank you very much for the Gtune feedback! So it's working on Quadcopter 700gr, 1200gr and Hexacopter 2900gr!
Cheers Rob

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

Re: Harakiri aka multiwii port to stm32

Post by Debogus »

Thanks Rob....Starting to get the different than BF stuff about motor stop board rotation. etc..... On baseflight have to make sure to tell it turn telem off ...even if it already sez it is....Then its also the MWOSD and making sure to click the armed box in OSD GuI thats a problem with BF as well.....Almost there.....Just different enough to confuse the hell out of me.....What is working fine on BF isnt working here.... Latest beta release of MWOSD has a setting for Harakiri...... so hoefully that is it
Keep up the good work .....Ill get it eventually.......

Post Reply