No deadband on Loiter? - Master

110 vistas
Ir al primer mensaje no leído

Glenn Gregory

no leída,
21 abr 2014, 4:37:31 a.m.21/4/14
para drones-...@googlegroups.com
Hi guys,

Has there been any work done on the loiter altitude controller since 3.1.2?

I flew with latest master 19/04/2014 and noticed in Loiter mode the copter kept changing altitude while in the usual deadband between 40-60% throttle. For example the screenshot below shows I got to ~2m and activated Lotier mode with the throttle in mid position and the copter maintained altitude. I then increased the throttle and once it got past the 60% it started increasing altitude as expected but then when I returned to mid-throttle previously the copter would level out and maintain that altitude. This wasn't the case and it kept rising at the same vertical speed. I then had to lower the throttle below 40% until the vertical speed stopped and returned the throttle to mid and it stayed at that altitude.

Has there been a changed in the functionality of Loiter or is this caused by some other changes?

I was going to search the code but thought I best ask here first incase it is undesired behaviour.

Glenn.


2014-04-21 15-19-27.log

Randy Mackay

no leída,
21 abr 2014, 9:22:33 a.m.21/4/14
para drones-...@googlegroups.com

Glenn,

 

      I think the issue is that the vehicle has a sonar enabled but it’s not working properly.  You can see the sonar alt in the CTUN message.

 

-Randy

--
You received this message because you are subscribed to the Google Groups "drones-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drones-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Glenn Gregory

no leída,
21 abr 2014, 6:26:30 p.m.21/4/14
para drones-...@googlegroups.com
Hi Randy,

Ok that probably is the case seeing as that was the other change I had made. I had enabled sonar to test the new sonar I had just connected and then realised sonar is not yet available for Pixhawk but I never disabled it. 

How would enabling sonar (but not recieving valid data) effect the alt_hold and loiter modes? Doesn't it just use the baro if there is no valid sonar data? Auto mode seemed to work fine.

I will disable the sonar and test again.

On other note was is the status of the sonar code for ADC on Pixhawk? 

Thanks,
Glenn

Randy Mackay

no leída,
21 abr 2014, 9:09:47 p.m.21/4/14
para drones-...@googlegroups.com

Glenn,

 

    With a sonar attached, alt-hold tries to attain a “desired” sonar altitude.  With a broken sonar, as you move the throttle stick up and down, the “desired” sonar altitude will also move up and down but inevitably it will be above or below the [bad] altitude being reported by the sonar.  This will make the copter keep climbing or descending chasing a sonar altitude that it can never reach.

 

     We don’t have any sanity checking on the sonar altitudes so we don’t have any indication of whether it’s sending us valid data or not.  It’s not completely trivial to add because we’re just reading a voltage and in this case the voltage is a reasonable voltage.  The only way to know it’s bad is by noticing that it’s not changing.

 

     The best way to improve the sonar reliability is probably to:

1.       Add the sanity checking that the values aren’t spikey but are moving

2.       Move towards an I2c sonar (or the pulsed light range finder) which has a better interface which we can use to determine if the sonar is working.

Glenn Gregory

no leída,
21 abr 2014, 11:18:04 p.m.21/4/14
para drones-...@googlegroups.com
Thanks for that explanation Randy. It makes sense now.

As you say range finders will be moving towards i2C so probably not worth spending time on extra sanity checks for the ADC versions.

I for one am getting very excited about the pulsed light range finder. I've backed and am looking forward to its arrival. Hopefully I can help out with testing / dev work.

In the mean time I shall try get my sonar working. Is the sonar code defined by default? What ADC pin is defined as default? I guess I need to search through the code to get familiar.

Thanks,
Glenn


Randy Mackay

no leída,
22 abr 2014, 1:46:35 a.m.22/4/14
para drones-...@googlegroups.com
Glenn,

Yes, the pulsed light range finder should be good. I've received another prototype recently and Allyson has already written a driver for it for the Pixhawk at least.

My knowledge of how to set-up the sonar is limited to what's on this wiki page: http://copter.ardupilot.com/wiki/sonar/. I've never tried to connect one to the Pixhawk or PX4 but if you know the pin then it should work. I somewhat doubt that we've got the correct pin numbers defined so that it will work.

SuperGoldfish has submitted a pull request to convert copter over to use the same sonar class as Plane. We will integrate this before AC3.2 goes out.
https://github.com/diydrones/ardupilot/pull/940

-Randy

-----Original Message-----
From: drones-...@googlegroups.com [mailto:drones-...@googlegroups.com] On Behalf Of Glenn Gregory
Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos