Oscillate and flip over after switching FC

@xfacta: I am not sure I see how your example is related to this Loiter issue.

@Leonardthall: My logs are posted here if you were asking me for it

No I didnt have that issue, but the point was it was a fairly standard firmware install and setup following normal process (with exceptions I pointed out).

Hi @plasmatorus,

Sorry I thought Shawn had a similar problem.

We let the position controller have slightly more direct control over the attitude. This reduces the latency but may have pushed you over the edge slightly. Could you try:
PSC_VELXY_D 0.25

Could you also turn on PID logging for the test too.

Please use Loiter not PosHold for the test.

I should do this on the Cube Orange build with 4.2.3?

Which parameter is that?

Yes, just the 4.2.3

Got it, thanks. I’ll do this in a few hours and report back.

Here is the log from the PSC_VELXY_D,0.25 test:
CubeOrange 4.2.3 PSC hover test2

I also performed another test with the Pixhawk drone running 4.0.5 and it seems to work really good. @Leonardthall can you please have a look and confirm? Log:
Pixhawk hover test

All PID settings are at default. I was hoping to use the system model verification technique to check just how stable it is but turns out you need the entire controller in Simulink for that. How else can you verify this?

Initially I thought that this was the same aircraft with just an update of firmware. But we are talking about two aircraft with two different tunes running different firmware and different flight controllers right?

The higher rate logging suggests that this may be an attitude control problem:

You can see the roll attitude error is growing. You can see a 1.5 Hz oscillation growing where the attitude error is getting larger over time.

You might be able to deal with the poor attitude control tune by reducing the PSC gains like this:
PSC_POSXY_P 0.5
PSC_VELXY_D 0.25
PSC_VELXY_I 0.5
PSC_VELXY_P 1.0

The other thing is this thread is very long and it looks like the current problems have nothing to do with the original thread. I would suggest starting a new thread so when people want to try to help you it is just the information related to this problem that is in the thread. For example, I don’t have the time to look up through the thread to see what tuning you have done or what flight controller setups we are dealing with given this spans 6 months.

Thanks, Leonard. You’re right. This thread has become pretty long. Here is a summary of the current state of things:

What is not fully clear from that is that yes, I now have two drones. One has the Pixhawk running v4.0.5 which is nice and stable with initial params + default PIDs. The other has the Cube Orange v4.2.3 which is completely unstable. I have done some minor manual tuning on this. Apart from that both drones are completely identical. Do you still think I should start another thread?