Replies

    • Is it possible that the autotune flight mode I can select as one of my 6 flight modes is not the same as the autotune discussed here?

      That AutoTune flight mode is really only meant to be displayed with ArduPlane.  In ArduPlane it is a flight mode, and in ArduCopter it is a function that can be invoked while in AltHold.

      I'm not sure you can invoke it from the ground station, my understanding is that ArduCopter's AutoTune can only be invoked via Ch7/8 :(

      Sorry!  If someone has different experience I'd love to hear it.

      • I took a look at the code in git.  It looks to me like you are correct for the 3.1 branch.  But it also looks like 3.2 may already support autotune as a flight mode, no channel 7/8 required.  I was prepared to code it up myself because this seems to me a useful feature, but it looks like I won't have to.  Someone please correct me if I am wrong.  I think I'll try the latest beta release.

        Thanks!

        --Brad

        • Developer

          Brad,

          Yes, you're right it's been turned into a flight mode in AC3.2.  There's a slight difference in how it's started in that when called from ch7/ch8 it uses autotune_start() and autotune_stop() while if called from ch5 flight mode switch it uses autotune_init().

          There's some extra code in the autotune_start() function (i.e. ch7/ch8) which backs up the current gains so I think it won't work well if it's triggered from ch5.

          This is all more by accident rather than a conscious decision though.  AC3.2 had so many other changes we didn't put any effort into making it work from ch5.  It should be possible though.

          • Randy,

            Thanks for the clarification!

            I had another brief look at the code.  It seems to be simple enough to rework it to make directly entering autotune flight mode via sw5 work about the same as via sw6/7  Switching directly from althold to autotune should be the same as selecting it via sw6/7 and switching back to althold should be the same as sw6/7 off so I think the same state machine can be used for restores, etc.  But I'm not yet familiar with the code base or this project so a few questions please:

            My initial thought is that changing the call to autotune_init() in set_mode() to autotune_start() and replacing the call to set_mode() in autotune_start() with a direct call to autotune_init() and reworking the AUX_SWITCH_AUTOTUNE case in do_aux_switch_function() to directly change modes via set_mode() may be all that is required.  Am I on a reasonable path?  Sw7/8 activation then seems redundant, should it be deprecated later (or even now)?

            If I work up a changeset that works for me, would you be interested in a pull request on github?  Even if I can't test sw7/8?

            Where is the best place to discuss code details prior to a pull request?

            Any reason something like this shouldn't go into 3.2?

            Please don't let this discussion stop you from just fixing this yourself if you have time!  It will take me a while to get setup for builds and test some code.

            Thanks!
            ---Brad

            • Randy,

              I did make similar changes I described above which makes autotune work from ch 5 and it worked well for me.  Should I submit a pull request?  Which branch should it be against?

              --Brad

              • Developer

                Brad,

                A pull request would be great.  Against master please!

                • Randy,

                  I did submit a pull request about a week ago but there has been no comment or merge yet.  If you have time, can you take a look at it and comment to let me know if it looks OK?  I think a few others would appreciate being able to autotune via ch5.

                  Thanks!

          • Ha!  Cool there you go... I never even looked! :)

          • Randy is it possible to have some flight modes on channel 6 ? like simple and auto or camera trigger rather than all those params we will not likely use ?

            Regards Reuben

            • Developer

              Reuben,

              At this moment it's not possible but it's on the to-do list (with 160+ other issues)...

This reply was deleted.

Activity

DIY Robocars via Twitter
RT @a1k0n: @DanielChiaJH @diyrobocars @circuitlaunch Here's my car's view of that race. About 8.4 second lap times for laps 2 and 3... both…
Monday
DIY Robocars via Twitter
RT @DanielChiaJH: Great racing against @a1k0n today at @diyrobocars! Pretty cool to both break sun-9s at the track today I think I got very…
Sunday
DIY Robocars via Twitter
Broadcasting the @circuitlaunch race live now at https://m.twitch.tv/diyrobocars Races begin around 2:00pm PT
Saturday
DIY Robocars via Twitter
RT @a1k0n: ran a huge number of hyperparameter tuning experiments yesterday; now I can train a new policy, far with better quality, in 15 m…
Saturday
DIY Robocars via Twitter
RT @a1k0n: Did I get rid of hand-tuned parameters? Yes. Am I still hand-tuning more parameters? Also yes. I have a few knobs to address the…
Sep 26
DIY Robocars via Twitter
RT @a1k0n: I'm not going to spoil it, but (after charging the battery) this works way better than it has any right to. The car is now faste…
Sep 26
DIY Robocars via Twitter
RT @a1k0n: Decided to just see what happens if I run the sim-trained neural net on the car, with some safety rails around max throttle slew…
Sep 26
DIY Robocars via Twitter
Sep 24
DIY Robocars via Twitter
RT @SmallpixelCar: @a1k0n @diyrobocars I learned from this. This is my speed profile. Looks like I am too conservative on the right side of…
Sep 24
DIY Robocars via Twitter
RT @a1k0n: @SmallpixelCar @diyrobocars Dot color is speed; brighter is faster. Yeah, it has less room to explore in the tighter part, and t…
Sep 24
DIY Robocars via Twitter
RT @a1k0n: I'm gonna try to do proper offline reinforcement learning for @diyrobocars and throw away all my manual parameter tuning for the…
Sep 23
DIY Robocars via Twitter
RT @circuitlaunch: DIY Robocars & Brazilian BBQ - Sat 10/1. Our track combines hairpin curves with an intersection for max danger. Take tha…
Sep 22
DIY Robocars via Twitter
RT @SmallpixelCar: Had an great test today on @RAMS_RC_Club track. However the car starts to drift at 40mph. Some experts recommended to ch…
Sep 11
DIY Robocars via Twitter
RT @gclue_akira: 世界最速 チームtamiyaのaiカー https://t.co/1Qq2zOeftG
Sep 10
DIY Robocars via Twitter
RT @DanielChiaJH: Always a good time working on my @diyrobocars car at @circuitlaunch. Still got some work to do if I’m to beat @a1k0n howe…
Sep 10
DIY Robocars via Twitter
RT @SmallpixelCar: My new speed profile for @RAMS_RC_Club track https://t.co/RtLb7TcgIJ
Sep 10
More…