LibrePilot Forum

General Category => General Discussion => Topic started by: TMGsi on November 05, 2020, 01:23:45 pm

Title: Circling positionHold
Post by: TMGsi on November 05, 2020, 01:23:45 pm
Circling positionhold.

I am not managing to make the positionhold acceptable.
The drone when I activate the positionhold is circulating. consequently rtb is kind of weird.

I've done the calibration of the compass and the gps naza is only with the auxiliary compass.

I only calibrate the compass, I don't make any adjustments. (all values on the x, y and z axes are at zero. Do I need to have any value to stop circulation?)

I need a tip to be able to end this positionhold circling.
Sometimes the positionhold is good, but there are few.

Thanks.
Title: Re: Circling positionHold
Post by: TMGsi on November 05, 2020, 06:33:45 pm
I ask the patience of the members of the group.
This problem of mine seems to have been answered in another topic of mine. (about another problem)

The only alternative I have not yet done is to braid the esc power wires. In the meantime, I put a post about 20cm over the fc and the fc about 7 cm from the pdb. That is, the gps is above the engine wires about 27cm.

But both are all in the middle of the drone, (I think that may be the problem)
Title: Re: Circling positionHold
Post by: TMGsi on November 05, 2020, 06:35:21 pm
Could someone with a well-regulated drone show me a picture of their setup and how the engine wires looked?
Title: Re: Circling positionHold
Post by: jdl on November 05, 2020, 09:54:24 pm
I guess you're talking about the so-called "toilet bowl", not exactly circling...

MAGs should be really well calibrated, please search the forum and Librepilot documentation; preferred calibration procedures and lot of helpful info / advices there...

In short, best practice is to use Oplink for wireless communication with the PC durung the calibration procedure, not USB cable. Live Oplink telemetry would also help to observe MAG status / alarms during actual flight.

Reset the Home Location before calibration start. Do it outdoors, far away from any metallic objects / structures, including underground pipes, power lines, etc. I have a favourite spot far away from the city, in the fields, where I do always achieve successful MAGs calibrations. Althougt this is a little bit extreme... ;)

27cm separation should be more than enough, at least according my experience. 15-20 cm should already be fine...

Quote
Could someone with a well-regulated drone show me a picture of their setup and how the engine wires looked?

https://forum.librepilot.org/index.php?topic=4889.msg32749#msg32749 (https://forum.librepilot.org/index.php?topic=4889.msg32749#msg32749)

The quad flies stable in autonomous modes, incl. PositionHold. The only issue (in all my autonomous quads when doing PH) are the fast tiny oscillations you have mentioned in your other topic, they seem not be MAGs related...

AuxMag is no more than 4-5cm away from power lines, even when current drawn exceeds 80-90A during throttle bursts there are not red MAG alarms in the telemetry log. Twisting the cables does the job!
Title: Re: Circling positionHold
Post by: TMGsi on November 06, 2020, 12:10:32 am


Quote
Could someone with a well-regulated drone show me a picture of their setup and how the engine wires looked?

https://forum.librepilot.org/index.php?topic=4889.msg32749#msg32749 (https://forum.librepilot.org/index.php?topic=4889.msg32749#msg32749)



you chose a GPS without a compass, do you think a compass outside GPS is better?  another question.  does esc dshot protocol work with FC Revolution?  in mine i just had the oneshot to choose from.  does FC revolution store flight information for later viewing?  what a good setup this yours.  good flights.
Title: Re: Circling positionHold
Post by: jdl on November 06, 2020, 07:52:01 am
Thanks! :)

Separate GPS & Compass are for saving weihgt and space. I've used in the past Beitian BN-880 with great success but it's heavier and bulkier than BN-200 GPS (approx. 5gr) and GY-273 Mag (approx. 1gr.). BN-880 also didn't support Galileo (not that a big deal) once I've used it. And separate setup also allows for more flexible compass positioning.

The 4-in-1 ESC I've used in this particular setup works very well with DSHOT1200. With current "next "Librepilot Revo firmware this is the useable DSHOT speed! Setting to lower speeds (600,300, etc.) intruduces some issues. I believe this is going to be fixed. Beware that DSHOT1200 requires really short wires between FC and ESC, maybe 5-7cm. I would not use DSHOT1200 is ESCs are on the arms of the quad, distance is much longer... Oneshot125 is a pretty good choice.

AFAIK, Revo does not support logginig flight information locally ("blackbox" like). Flight information is viewable and recordable on PC / Android phone through Oplink telemetry.

Btw, you should also check if your Auxmag (mounted on the mast) is well aligned with the Revo FC, and not rotating during flight! Even relatively small misalignments can lead to the "toilet bowl" behavior.

Title: Re: Circling positionHold
Post by: TheOtherCliff on November 06, 2020, 09:17:20 am
16.09 supports OneShot* MultiShot

Next adds DShot, but there appears to be issues with it and I recommend you avoid it.
https://forum.librepilot.org/index.php?topic=4883.msg32723#msg32723

I use PwmSync or PWM@490 and there is very little reason to bother with the highest speed protocols.

"Toilet bowl" is often caused by mag problems such as poorly routed poorly twisted motor cables, bad mag calibration, using USB for mag calibration without degaussing the USB plug, putting the drone down on ground or metal between the 6 mag cal steps, etc.
Title: Re: Circling positionHold
Post by: TMGsi on November 06, 2020, 10:58:30 am
Thanks! :)

Btw, you should also check if your Auxmag (mounted on the mast) is well aligned with the Revo FC, and not rotating during flight! Even relatively small misalignments can lead to the "toilet bowl" behavior.

How to check if it is aligned? Only visually? (I think it's aligned, but visually)

Or check in another way? do not know.

(I had given up on having the compass on my osd, but when you see your video, you have no crazy compass problem on osd. What did you do?) You have the same micro minimosd as me. What is your osd firmware?
Title: Re: Circling positionHold
Post by: TMGsi on November 06, 2020, 11:08:55 am

"Toilet bowl" is often caused by mag problems such as poorly routed poorly twisted motor cables, bad mag calibration, using USB for mag calibration without degaussing the USB plug, putting the drone down on ground or metal between the 6 mag cal steps, etc.

I have a physical compass, with it I can see where I have trouble with the compass.

On the drone, I calibrate the compass on a wooden table, and my physical compass revealed that there is nothing interfering there.
(but it is inside the house) I will change places for a test, I will calibrate outside the house and also find a place where the physical compass shows a place without disturbance.

If you don't stop with this "toilet bowl", I'll rewire the engine. Leave them WELL wrapped up.
Title: Re: Circling positionHold
Post by: TheOtherCliff on November 08, 2020, 04:39:40 am
Mag calibrations are probably good if running INS13 mag health is green and compass heading in GCS matches correct direction of north and health stays green (or yellow) with flight power to motors (props on).
Title: Re: Circling positionHold
Post by: TMGsi on November 08, 2020, 10:23:04 am
I'm not able to do the thermal calibration.
  I've tried it several times and it doesn't end successfully. 

what can i be doing wrong? 
this calibration I never did.
Title: Re: Circling positionHold
Post by: TMGsi on November 08, 2020, 10:30:31 am
a doubt.

 I don't have the oplink, so if the flying compass turns red, the osd will show "critical compass"?

  before, did this message appear before starting the engines, but in flight?

 this message never came up again after I am doing the calibration correctly.
Title: Re: Circling positionHold
Post by: TMGsi on November 08, 2020, 11:00:01 am
I have more doubts.

 when the rtb is triggered ( by the radio switch or by loss of signal) it starts the rtb normally, but the direction of the drone does not change, that is, it flies backwards (I know I could give the yaw command at that moment  to turn it around) would there be a way to change that, so when entering the rtb he turns himself to where the gps marked his takeoff point before going to his destination? 

and the other doubts. 

would it be possible to calibrate the compass with the radio stick command?  without usb cable or oplink?
Title: Re: Circling positionHold
Post by: TheOtherCliff on November 09, 2020, 01:23:59 am
I'm not able to do the thermal calibration.
  I've tried it several times and it doesn't end successfully. 
what can i be doing wrong? 
this calibration I never did.
Remove FC from drone.  Put it in plastic baggie in freezer for 5-10 minutes, not longer.  Remove from freezer but leave FC in baggie.  Plug in USB cable, place baggie, then some folded cloth and small weight (not metal) on table (not metal) on top of baggie and quickly begin the thermal calibration.  Weight holds it so it does not move during long (many minutes maybe) calibration.  Do not bump table or make shaking foot steps during calibration.

Things I do, but not really necessary:
Because my FC has seen 75C in summer time in dome on pavement, I extend my calibration to hot temperature by putting FC and cloth and weight in a cardboard shoe box with a hot light bulb (like 60W incandescent) underneath.  When calibration says it gets up above 60C or so I unplug the hot light and a few minutes later the calibration sees that it is not getting hotter and stops automatically.

a doubt.
 I don't have the oplink, so if the flying compass turns red, the osd will show "critical compass"?
  before, did this message appear before starting the engines, but in flight?
 this message never came up again after I am doing the calibration correctly.
I have no idea about OSD showing "critical compass".  Big problem is when it is OK on ground, but mag health goes red with the high current of flight power.  Second bit problem is when mag cal is not done well for reasons listed elsewhere in this post.

I have more doubts.
 when the rtb is triggered ( by the radio switch or by loss of signal) it starts the rtb normally, but the direction of the drone does not change, that is, it flies backwards (I know I could give the yaw command at that moment  to turn it around) would there be a way to change that, so when entering the rtb he turns himself to where the gps marked his takeoff point before going to his destination? 
This is by design so that when flying to Base or some Waypoint, you can turn it and look with FPV.
There is a setting in System->Settings->VtolPathFollowerSettings called YawControl which you can change to PathDirection.  I think this changes what you want.

and the other doubts. 
would it be possible to calibrate the compass with the radio stick command?  without usb cable or oplink?
No.  Not without someone writing code to do this; but here are some thoughts.

Mag calibration, you should:
- do calibration outdoors, away from metal (buildings, tanks, cars, etc.) but I have done it inside wooden home...
- never put model down on ground or metal anything once you have started because it is actually always recording.

I have done it with USB cable, but I degaussed (demagnetized) the USB cable end and used flight battery / ESC power at 5.5 to 6 volts (more than USB power) to make sure it used ESC power and not USB power and used a 3 meter USB cable with a laptop all outdoors.

An interesting experiment for someone who has OpLink telemetry would be:
- with model and FC clamped firmly to table and using flight battery power and no USB plugged in
- use OpLink telemetry to view mag scope and compass
- plug in USB cable to USB charger, not computer so telemetry does not change from OpLink to USB
- plug in other end of USB cable to FC, then look at mag scopes and compass to see how much it changed
Title: Re: Circling positionHold
Post by: jdl on November 09, 2020, 10:51:47 am

How to check if it is aligned? Only visually? (I think it's aligned, but visually)

Or check in another way? do not know.

(I had given up on having the compass on my osd, but when you see your video, you have no crazy compass problem on osd. What did you do?) You have the same micro minimosd as me. What is your osd firmware?

Visual alignment should be enough. But you might also want to check how is the mag chip (L883 / DA5883 markings) on the PCB inside the GPS/MAG plastic enclosure positioned (oriented).

I'm using a modified MinimOpOsd firmware. Some features were discarded to free space and I've coded new ones that I felt being more useful. I've always intended to make it available to LP community, and I plan to do this in near future. What stopped me till now was that the default OSD Config Tool 2.1.3.0 is not really compatible with it. Charset differs, some fields have totally different layout and meanings.
I've recently had some free time and dedicated it to match the OSD Config Tool to my firmware. I'm almost at the final, and hope in a week or two to upload the new config tool, charset file and MinimOpOSD hex files (for RevoFC) for quadcopter and plane use. There is also a version dedicated to quadcopter (w/ CC3D) use, with voltage sensor connected to MinimOSD.


Quote
a doubt.

 I don't have the oplink, so if the flying compass turns red, the osd will show "critical compass"?

  before, did this message appear before starting the engines, but in flight?

 this message never came up again after I am doing the calibration correctly.

If I recall right, the original MinimOpOsd firmware shows "MAG CRITICAL" only while FC is not armed. Not in flight. My version does the same. This could be easily changed but I feel having MAG alarms during fligh to be impractical.

If you don't have an Oplink, you may probably use a separate HC-05/HC-06 Bluetooth module onboard and route the telemetry through it.

https://librepilot.atlassian.net/wiki/spaces/LPDOC/pages/10354702/Setup+a+bluetooth+for+telemetry (https://librepilot.atlassian.net/wiki/spaces/LPDOC/pages/10354702/Setup+a+bluetooth+for+telemetry)

Title: Re: Circling positionHold
Post by: TMGsi on November 09, 2020, 07:06:12 pm

I'm using a modified MinimOpOsd firmware. Some features were discarded to free space and I've coded new ones that I felt being more useful. I've always intended to make it available to LP community, and I plan to do this in near future. What stopped me till now was that the default OSD Config Tool 2.1.3.0 is not really compatible with it. Charset differs, some fields have totally different layout and meanings.
I've recently had some free time and dedicated it to match the OSD Config Tool to my firmware. I'm almost at the final, and hope in a week or two to upload the new config tool, charset file and MinimOpOSD hex files (for RevoFC) for quadcopter and plane use. There is also a version dedicated to quadcopter (w/ CC3D) use, with voltage sensor connected to MinimOSD.


Man, that's cool. Success in your work. This is going to be very useful.
Title: Re: Circling positionHold
Post by: TMGsi on November 09, 2020, 09:37:19 pm
(https://photos.app.goo.gl/bhZAeUHs8T2PJU4V8)

https://photos.app.goo.gl/bhZAeUHs8T2PJU4V8
 (https://photos.app.goo.gl/bhZAeUHs8T2PJU4V8)
Title: Re: Circling positionHold
Post by: TMGsi on November 09, 2020, 09:48:59 pm
I don't know how to post a photo
Title: Re: Circling positionHold
Post by: TheOtherCliff on November 10, 2020, 07:22:58 am
Either upload/attach the photo file to your post or provide a direct link to the photo file such as ending in ".jpg".  The link you posted was to a web page that had the photo on it.

Looks like you got thermal calibration done successfully.

I suggest that you redo the other calibrations.  I recall that thermal calibration changes them a little and they should be redone.
Title: Re: Circling positionHold
Post by: TMGsi on November 10, 2020, 10:10:22 am
photo upload test.  Best gps location for me.
Title: Re: Circling positionHold
Post by: TheOtherCliff on November 10, 2020, 12:29:08 pm
That should work OK if it is configured to use only the aux mag.

It might be a little top heavy.  It might need a little more careful tuning, but should work.

Is the mast really good and stiff or does it wobble a bit?  Loose and wobble might cause issues.
Title: Re: Circling positionHold
Post by: TMGsi on November 10, 2020, 09:07:20 pm
after having successfully completed the thermal calibration.  the drone was left with some disturbance on the yaw. 

the drone takes off normally, but when I clicked the key to positionhold the drone makes a very strong movement on the yaw.

 when switching to any flight mode it spins on the yaw.

 and I did all the calibrations after doing the thermal calibration.

 after that i ask,

do you need to calibrate the thermal?  instead of improving after calibrating it got worse. 

my version of librepilot is 16.09.
 will upgrading to the latest version of librepilot improve?
Title: Re: Circling positionHold
Post by: TheOtherCliff on November 11, 2020, 09:32:27 am
after having successfully completed the thermal calibration.  the drone was left with some disturbance on the yaw. 

the drone takes off normally, but when I clicked the key to positionhold the drone makes a very strong movement on the yaw.

 when switching to any flight mode it spins on the yaw.

 and I did all the calibrations after doing the thermal calibration.
This may be a result of setting VtolPathFollowerSettings->YawControl  :(
It turns to point in the direction that it moves for the little motions in PH

Does it spin constantly at a constant rate or does it spin say 30 degrees and hold there or does it spin randomly?

The following will not help if it spins randomly.

One reason would be if the GPS / compass was rotated a little.  You could rotate the GPS / compass a little to correct it or even easier, you could change the Attitude->Magnetometer->orientation->Yaw.  One way should make it worse and the other way should make it better.

Another reason is if any power cables are not twisted.  Sometimes you might install a different battery or a battery without twisted cables and you get an electromagnetic field when you draw current in flight.

Did you use any yaw trim?  Basically, transmitter trims should always be centered.  With everything (drone and transmitter) powered up as for flight, and GCS USB plugged in, you can look at input page to see if received yaw value equals neutral as shown by GCS yaw value.

do you need to calibrate the thermal?  instead of improving after calibrating it got worse. 
No.  The only reason you might need to redo thermal calibration is if the FC got moved during thermal calibration.  That is the reason for putting a weight on top of the FC.

my version of librepilot is 16.09.
 will upgrading to the latest version of librepilot improve?
No.  Very probably not.
Title: Re: Circling positionHold
Post by: TMGsi on November 11, 2020, 10:45:33 am
that's right.

  what was causing the yaw disturbance was the change in the yawcontrol.  (I thought he would do it only on RTB, but he does it in all flight modes) and I also thought it was a smooth and precise movement. 

however it was a very strong movement to the point of making the drone lose control. 

I went back to the default value and solved this problem.
 I will be without turning when I enter the rtb (although I can turn manually) of all my problems this is the least important.
Title: Re: Circling positionHold
Post by: TMGsi on November 11, 2020, 11:01:54 am
I saw a video and in the video he managed to leave all axes at zero.
https://youtu.be/qLsd4O75N9o
 (https://youtu.be/qLsd4O75N9o)


 I can't get it to zero.  (in the video he changes the roll to 180 and yaw to -90) I don't need to make this change,

what I found interesting was that every movement he made the axes returned to zero)

what do you advise me to do? 

a note: the drone does not stay and the positionhold in the DJi drone standard, but I can fly and make a longrange safely.

 what I'm looking for is a fine adjustment.  see a picture of how it looks in mine.
Title: Re: Circling positionHold
Post by: TheOtherCliff on November 11, 2020, 01:19:22 pm
You are using a DJI/Naza GPS/mag mounted upright with the arrow pointing forward.  This needs to be 0,0,0.

He was using a mag board that normally needs to be either 180,0,180 or 0,180,0 (they are the same rotation) and he had it mounted with the arrow pointing sideways.

Generally, aligning it to be level and pointing forward carefully by eye is good enough.  Then for DJI and OP GPS/mag orientation is set to 0,0,0 and for other it is set to 0,180,0.

A good way to test is in Velocity Roam.  When you press the pitch stick forward does it go straight forward or a little sideways?  If it is consistently a little sideways in the same direction (in more than one flying field) you might adjust the aux mag yaw orientation a little if it bothers you.
Title: Re: Circling positionHold
Post by: TMGsi on November 13, 2020, 06:07:29 pm

I have done it with USB cable, but I degaussed (demagnetized) the USB cable end and used flight battery / ESC power at 5.5 to 6 volts (more than USB power) to make sure it used ESC power and not USB power and used a 3 meter USB cable with a laptop all outdoors.


I haven't tried that yet.
I don't understand how to do this.

What I understood was: Did you cut off the usb power via the computer and solder the esc power supply wire?






I'll buy a 2m or 3m usb cable and try.


I use librepilot on a tablet that runs windows and android. On windows librepilot installed, so what powers the tablet is a voltage of 1 cell of lipo battery. (so I think the disturbance transmitted to the compass is less on this tablet). This thought of mine is not very certain because the drone is not yet excellent in positionhold, it was good, not excellent. (and my new gps that is not enough for me to test soon)
Title: Re: Circling positionHold
Post by: TMGsi on November 13, 2020, 06:24:03 pm
I made a representation in paint, what did you do?
Title: Re: Circling positionHold
Post by: TheOtherCliff on November 13, 2020, 09:18:15 pm
To summarize: Use "aux only" mag setting.  Use a 2-3 meter USB cable, outdoors, away from metal buildings, tanks, cars, watches.  Do not set model on ground once you start.  Hold it in the air, away from USB cable as much as reasonable.  Since you are using "aux only" mag, don't worry about demagnetizing the USB plug or the ESC/BEC voltage or cutting or soldering.

The rest of this post is details, and after I wrote it, I realized that simple summary was more important.  :)

I have done it with USB cable, but I degaussed (demagnetized) the USB cable end and used flight battery / ESC power at 5.5 to 6 volts (more than USB power) to make sure it used ESC power and not USB power and used a 3 meter USB cable with a laptop all outdoors.

I don't understand how to do this.

What I understood was: Did you cut off the usb power via the computer and solder the esc power supply wire?

The metal in the micro end of the USB cable that plugs in the FC might have slight magnetism.  Being so close to "On Board" mag during calibration, the magnetism might make the calibration bad.  I have a soldering "gun" with big electro-magnet that I use for de-magnetizing.  BUT: You can skip the USB end de-magnetizing if you are using "aux only" setting, because it does not matter if the "on board" magnetometer is calibrated badly if using "aux only".

USB standard is 5V, so your tablet has a circuit to increase the voltage from 1 cell voltage.  The biggest computer or the smallest phone would all thus be equal for USB power.  A 2-3 meter USB cable should be OK to do calibration with really any computer.  I prefer 3 meter...

FC has diodes in it so that it will use either 5V USB power or 5V power coming from ESC.  Which ever has the highest voltage will be used, so I used 5.5V ESC power to be higher than 5V USB power (electro-magnetism does not depend on voltage, only on current and the FC regulators are linear...).  This is to make sure that FC power uses the same traces on the FC board during calibration (ESC power) that it uses during flight.  This is overkill.  :)  This is really about getting "on board" magnetometer calibrated well.  AGAIN: If you are not using "on board" mag, you can probably not worry about the voltage.  You still need ESC power though.  The FC circuits do not let USB power come out to any ports (such as GPS/mag on Flexiport / Mainport).  Only ESC power comes out to ports.

What I understood was: Did you cut off the usb power via the computer and solder the esc power supply wire?
I simply made sure the ESC power voltage was higher so that it would be used.  No cutting or soldering.

You raise a very good method (to make sure it uses ESC power) that I had not though of.  Simply cut the + power lead in the USB cable.  Only the + lead, usually pink.  Leave the other wires connected.  AGAIN: This mess can be skipped if you are using "aux only" mag and don't care about "onboard" mag calibration.
Title: Re: Circling positionHold
Post by: TMGsi on November 13, 2020, 10:50:28 pm


understand,
I will not worry about demagnetizing the usv cable, as it is for the onboard compass. It was well explained.

so much so that I posted a photo showing the status of the compass, onboard (5.5%) and auxmag (0.4%)
a very big difference between them.

Only my axes (x, y, z) that do not return to zero, in the photo it shows them too. (and I think my positionhold is not perfect so the axes have a little problem with zeroing)


But, I will try with the 3m usb cable.
Title: Re: Circling positionHold
Post by: TheOtherCliff on November 14, 2020, 01:02:44 am
Only my axes (x, y, z) that do not return to zero, in the photo it shows them too. (and I think my positionhold is not perfect so the axes have a little problem with zeroing)

But, I will try with the 3m usb cable.

These axes only compare "onboard" mag with "aux" mag, they are mainly to help you correct for aux mag mounting angles not correct, and even for some small mag fields in the model.  You should ignore them because you are using aux mag only and know there could be problems with onboard mag calibration.

I posted a photo showing the status of the compass, onboard (5.5%) and auxmag (0.4%)
a very big difference between them.
These numbers are entirely calculated from the measured strength of the mag field and have nothing to do with direction (which is the important part for us).  This is because the FC just doesn't know where north is except by looking at the mag/compass.  Using the mag/compass to define where north is, it obviously doesn't make sense to score the mag/compass accuracy based on where it thinks north is.  :)  :o ::)  The next best thing is field strength.  Your onboard mag field strength measurement is 5.5% off of what it is known that it should be, but your "aux mag" field strength is only off by 0.4%.  Use the aux mag and forget about the onboard mag.  :)