Hi Alex,
thanks for your comment.
I have to repeat myself from our mailing.
My basic idea was to calculate an accurate vario, which doesn't depends on the cycle time at all.
So in my code I made an accurate calculation, where the total throttle stick range is divided for a defined vario range.
Within this range, the target vario is proportional to throttle stick position. The idea of modifying the PIDs was coming from my tests. The behaviour of the copter was not smooth enough in vario mode, so I started to think on the problem. Since I learnt some about regulations, I thought the problem is there. Maybe I'm right.
I don't know MAHOVIK's solution deeply, but If I remember right, vario was depending on cycle time mainly...
The complexity is because different target varios (independent if in manual or automated mode) needs different PID modifications for smooth working. I can't handle on other way.
Well, I feel like I'm on my own. The main reason why I started to post my code, to let others check/modify/think on it.
But, there was not even a small line suggestion what to modify, or input/remove from my code. I mean exact solution, code part, not only some "basic" ideas.
But, any input would still welcome.
I'm sure there are more simple solutions, I wanted only show a possible way of solving vario problem. But it was so good I started to use (and maybe some others), and still using during my FPV flights. And I'm really happy to have at least something like this.
About space problems, the RTH code and FAILSAFE RTH code was made for further nav purposes.
My oppininon is that 328p can't handle any navigation which is more complex than position hold, maybe RTH. For a MEGA 10k is not a problem.
And, there are many great panels on market equipped with MEGA and under 50 USD. This is only my private oppinion...
So, to be honest, the current state is the maximum I could get out of the "problem" on my own right now...
:(:(:(
Please understand my position.
BR
Adrian