Pixhawk - Marvelmind

Frequent questions asked online, offline, in forums are answered here
Hendrik
Posts: 31
Joined: Wed Dec 07, 2016 12:29 pm

Re: Pixhawk - Marvelmind

Postby Hendrik » Tue Apr 18, 2017 1:36 pm

Hi Amolad, freaad,

I did overrule the compass by using the predicted value, which keeps everything else intact:

in AP_NavEKF3_MagFusion.cpp:
with declination pointing north can be synchronised with pointing north of marvelmind map
twice:

Code: Select all

        // set the yaw to zero and calculate the zero yaw rotation from body to earth frame
        Tbn_zeroYaw.from_euler(euler321.x, euler321.y, _ahrs->get_compass()->get_declination()); // Hendrik was; 0.0f);



this does the trick:

Code: Select all

/*
if (use_compass() && yawAlignComplete) {
    measured_yaw = wrap_PI(-atan2f(magMeasNED.y, magMeasNED.x) + _ahrs->get_compass()->get_declination());
} else {
    measured_yaw = predicted_yaw;
}
*/
measured_yaw = predicted_yaw;


commented error message

Code: Select all

//    GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_INFO, "EKF3 innovYaw: %f\n",innovYaw);


added error message when copter not pointing north before/at arming
in AP_Arming.cpp

Code: Select all

    // check if start angle is between +- 5 degrees. Hendrik
    if ((ahrs.yaw_sensor > 500) && (ahrs.yaw_sensor < 35500)) {
        if (display_failure) {
            gcs_send_text(MAV_SEVERITY_CRITICAL,"PreArm: Yaw too large for auto start");
            GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_CRITICAL, "PreArm: Yaw too large for auto start %d deg", ahrs.yaw_sensor / 100);
        }
        return false;
    }


So the way it works is as follow:
Rotate marvelmind with the xy button to create a north reference in the marvelmind map. (may differ from magnetic north)
Place copter (rover) in the map with north pointing in the same direction as north on the marvelmind map.
On pixhawk compass should be enabled and compass 1 selected. (If not than errormessages about compass prevent auto mode)
The yaw on Missionplanner gives the offset voor de declination
Enter -yaw in declination of compass in Missionplanner.
Reboot pixhawk.
Yaw should be around zero now.
Everything is good to go on auto.

EKF3 settings follow later. (GPS and accels maximal influence, baro and calculations get lower influence)
GPS z is better than Baro, so try to eliminate Baro as much as possible

Hope this helps

Hendrik

freaad
Posts: 27
Joined: Fri Dec 09, 2016 1:59 am

Re: Pixhawk - Marvelmind

Postby freaad » Tue Apr 18, 2017 6:02 pm

Thank you Hendrik
I will try it.
I also read other beacon company's comment(https://www.pozyx.io/Documentation/wher ... he_anchors).
Looks like I keep the same height with other 4 stationary beacon and that could be the problem for me.
If you don't mind could you send your modified code for me? My email is donghok4@gmail.com
I am little worry about compiling. I used to use the python so not sure that I can finish to make firmware perfectly. Or could you send the version of firmware I want to use same version of firmware with you.. I am using the pixhawk2.1 and I am using the EKF2 but I checked the code and your adivce looks like work.
Last edited by freaad on Tue Apr 18, 2017 6:39 pm, edited 2 times in total.

Easyaerial
Posts: 5
Joined: Sat Apr 15, 2017 6:13 am

Re: Pixhawk - Marvelmind

Postby Easyaerial » Tue Apr 18, 2017 6:24 pm

Hey Henrik,
I'm very interested in your results so far with Marvelmind. Can you please shoot me an email to ivan@easyaerial.com - we can provide drones for you to test on. Thanks

Hendrik
Posts: 31
Joined: Wed Dec 07, 2016 12:29 pm

Re: Pixhawk - Marvelmind

Postby Hendrik » Tue Apr 18, 2017 7:49 pm

1 result of today:

https://youtu.be/eYbDVO5rEFk

The results are very good. Except for height steadiness.

We are building new drones and will finetune with them.

amolad
Posts: 34
Joined: Wed Jan 18, 2017 12:56 pm

Re: Pixhawk - Marvelmind

Postby amolad » Fri Apr 21, 2017 12:17 pm

Hi Hendrik,

Sounds interesting! Will give it a try today

freaad
Posts: 27
Joined: Fri Dec 09, 2016 1:59 am

Re: Pixhawk - Marvelmind

Postby freaad » Wed Apr 26, 2017 1:13 am

Dear hendrik
I don't get it your explanation

Rotate marvelmind with the xy button to create a north reference in the marvelmind map. (may differ from magnetic north)
Place copter (rover) in the map with north pointing in the same direction as north on the marvelmind map.
Could you give some tip about this part.
The yaw on Missionplanner gives the offset voor de declination
Enter -yaw in declination of compass in Missionplanner.

Reboot pixhawk.

Yaw should be around zero now.
My yaw is 350 value and my direction is circleing every 10 second.

Hendrik
Posts: 31
Joined: Wed Dec 07, 2016 12:29 pm

Re: Pixhawk - Marvelmind

Postby Hendrik » Wed Apr 26, 2017 5:51 pm

@freaad

Did you create a new firmware with the changes?

Did you use the following button
Screen Shot 2017-04-26 at 16.35.29.png
Screen Shot 2017-04-26 at 16.35.29.png (6.39 KiB) Viewed 6461 times
to align your map with N on the map.
You mustn't rotate the map manually. The button should do the work.
(press button, choose left bottom beacon, right bottom beacon, left top beacon)

Result should be like:
IMG_5241.JPG
IMG_5241.JPG (99.56 KiB) Viewed 6461 times


At compass setting in Mission planner, disable "Obtain ..." and at "Degrees" fill in the yaw offset.
Reboot.

Yaw should be round 0.
Attachments
Screen Shot 2017-04-26 at 16.41.39.png
Screen Shot 2017-04-26 at 16.41.39.png (44.36 KiB) Viewed 6461 times

freaad
Posts: 27
Joined: Fri Dec 09, 2016 1:59 am

Re: Pixhawk - Marvelmind

Postby freaad » Wed Apr 26, 2017 5:56 pm

Thank you for your answer.

I found the button. I will try it.
Also I wanted to change the those parameter on the mission planner but I couldn't do it(maybe I need update about my mission planner also).
my value was 0 o -60
My yaw state was more the 300.

freaad
Posts: 27
Joined: Fri Dec 09, 2016 1:59 am

Re: Pixhawk - Marvelmind

Postby freaad » Wed Apr 26, 2017 7:00 pm

mission.PNG
mission.PNG (4.84 KiB) Viewed 6457 times

I set the what you said before.However I still have floating about my yaw.

yaw2.PNG
yaw2.PNG (9.39 KiB) Viewed 6457 times


I attached my log file about status.
It is rotating seriously.
Attachments
2017-04-26 10-46-43.zip
(118.96 KiB) Downloaded 139 times

Hendrik
Posts: 31
Joined: Wed Dec 07, 2016 12:29 pm

Re: Pixhawk - Marvelmind

Postby Hendrik » Fri Apr 28, 2017 9:02 am

@freaad

Yaw is floating indeed.
But with good calibration of accels it should be less than a degree in a few minutes.
When the yaw is too big I reboot the pixhawk.
My flying path is within a few minutes.

Letting the pixhawk rest for a few minutes before reading yaw and modifying declination seems to help.

(with the modified firmware and calibrated accels)
I put the drone in homeposition.
Attach the battery and wait a few minutes.
I set declination to 0
Then I reboot the pixhawk and read the yaw.
I enter the yaw as -yaw in declination.
Then I reboot the pixhawk and everything is good to go.


Return to “FAQ”

Who is online

Users browsing this forum: No registered users and 4 guests