Recent Posts

Pages: [1] 2 3 ... 10
1
Deutsch / Re: Conroler ccd3 mit Spektrum DX9
« Last post by Christoph24 on May 17, 2021, 04:55:31 pm »
Perfect answer .. :)
i think i have a solution
2
Deutsch / Re: Conroler ccd3 mit Spektrum DX9
« Last post by TheOtherCliff on May 17, 2021, 10:02:51 am »
I would guess that is true, but it would be best to ask that on a Betaflight forum.

It's possible that someone here knows, and they can answer if so, but you are asking Toyota questions on a Ford technical forum.  :)
3
Vehicles - Other / Re: Bimode aircraft code changes
« Last post by TheOtherCliff on May 17, 2021, 09:59:45 am »
Looking over the code & trying to understand the flow, I'm thinking of using the following code to deactivate the current activeController, then check the wing status and set activeController based on the current state & flight mode when the wing mode changes - thoughts?

// deactivate activeController & set update activeController
static void pathFollowerReactiveController(__attribute__((unused)) UAVObjEvent *ev)
{
 
    if (activeController) {
        activeController->Deactivate();
        activeController = 0;
    }

    pathFollowerSetActiveController();

    if (activeController) {
        activeController->ObjectiveUpdated();
    }
}

Sounds reasonable, but I haven't been deep in this area for years, and have not researched the active controller stuff.
4
Vehicles - Other / Re: Bimode aircraft code changes
« Last post by TheOtherCliff on May 17, 2021, 09:57:47 am »
In the just performed test, I set the flag to 1. So when system initialized, it saw it was in VTOL mode so initialized to VTL mode. That part worked fine.
But after it transitioned to hrz mode, switching to VR mode - it didn't fly the pattern described above. Just kept going, as if it didn't know where to go, or wasn't in VR mode.

I guess the thing to test next would be if it works correctly in FW mode if started in FW mode.  If that is the case, then it is "just" a matter of completely changing the mode after startup.
5
Deutsch / Re: Conroler ccd3 mit Spektrum DX9
« Last post by Christoph24 on May 16, 2021, 09:28:20 pm »
now I am busy with new Qopters but the programming is in Betaflight, can you use Betaflight and Spektrum receivers?
6
Vehicles - Other / Re: Bimode aircraft code changes
« Last post by trust on May 16, 2021, 07:55:05 pm »
Looking over the code & trying to understand the flow, I'm thinking of using the following code to deactivate the current activeController, then check the wing status and set activeController based on the current state & flight mode when the wing mode changes - thoughts?

// deactivate activeController & set update activeController
static void pathFollowerReactiveController(__attribute__((unused)) UAVObjEvent *ev)
{
 
    if (activeController) {
        activeController->Deactivate();
        activeController = 0;
    }

    pathFollowerSetActiveController();

    if (activeController) {
        activeController->ObjectiveUpdated();
    }
}
7
Vehicles - Other / Re: Bimode aircraft code changes
« Last post by trust on May 16, 2021, 02:46:59 am »
Thanks for the debugging suggestions - I'd been using some of the vars as you say to check internal states.
VR on fixed wing has the plane do circles or figure 8s back to the start point.
If I startup with my bimodefundata.TypeSwitchEnable flag set to 0, it doesn't use my version of GetCurrentFrameType and uses the default set airframeType. I currently have it set to FixedWing. Then when I switch to VR mode it does the above movements - which is what I want.
In the just performed test, I set the flag to 1. So when system initialized, it saw it was in VTOL mode so initialized to VTL mode. That part worked fine.
But after it transitioned to hrz mode, switching to VR mode - it didn't fly the pattern described above. Just kept going, as if it didn't know where to go, or wasn't in VR mode.
8
Vehicles - Other / Re: Bimode aircraft code changes
« Last post by TheOtherCliff on May 15, 2021, 11:30:16 pm »
What does stock VR mode do when configured in a fixed wing configuration?

I don't recall whether or not VR is appropriate for that.  I think there are other modes more suited to fixed wing?  Autocruise comes to mind.  I confess that I only know to use Attitude and RTB in my fixed wing GPS aircraft.  Is simple Attitude not good enough?  I know it doesn't fight a crosswind, but fighting the wind can cause confusion if you thing it should be pointing in one direction but it is pointing in another.  Look here for some autocruise info.
https://forum.librepilot.org/index.php?topic=4644.msg31459;topicseen#msg31459

I had hoped that running all the code that runs when you do a normal FMS change would do all you need.  I know that there are different controller sections for the different aircraft configurations.  You will just need to make sure that that gets updated.  Hopefully there aren't any "inits that shouldn't be done while armed/flying", or that they can be made airworthy.
9
Vehicles - Other / Re: Bimode aircraft code changes
« Last post by TheOtherCliff on May 15, 2021, 11:06:04 pm »
I assume that the code was not written with changing airframe type in mind, so you will need to enhance it for that, whatever is required.

The good things are that you didn't crash, :) and that you have a reproducible problem.  Debug it on the bench.  You can try a cheap hardware debugger connected to the SWD port, or use the printf method.  :)

Print a small amount of debugging to come out an FC serial port, and watch this on your computer through an FTDI and a terminal program.

Another way I use (probably the easiest) is to use an unused UAVO (just pick one) as a scratch pad and poke some numbers there (1=it got to here, 2=it got to there) into several different UAVO variables (even the actual value of variables of interest) to correspond to different places you are debugging.  Don't forget to init that UAVO on startup if it is not already inited elsewhere.  You will also need to change that UAVO metadata via GCS System page so that e.g. every time the FC changes it, it gets sent to the GCS.
10
Vehicles - Other / Re: Bimode aircraft code changes
« Last post by trust on May 15, 2021, 10:47:16 pm »
I'm wondering if the problem is that although it initializes controllers, it doesn't actually assign them as the activecontroller.

I see there is another function pathFollowerSetActiveController that sets these - but if I try to call it and activeContoller (the pointer) is already set, it will skip all the setting. It seems this was only meant to initialize once.
Does this make sense or is there more that needs to be done?
Pages: [1] 2 3 ... 10