i dont understand , what you mean scale value .
But if you want , that my custom controller in position loop * with sliding mode control
I also test in real pihawk2 , and the results look a litter better than pid .
Thanks for answering me, I’ve taken a brief look at your code, so let me understand you have simplify replaced the position and velocity control block but you kept untouched the rate and attitude, so you are simply setting your thrust, not the moments required.
My project is a bit different I’m trying to substitute the whole control architecture so everything before the mixing phase, using an HOSM +Feedback Linearization.
I have some questions for you , how have you handled the update frequency? Your sliding mode which frequency is using?
I’ve tried to reduce the sampling time between calls but I failed in SITL.
in the simulation and real , its almost 50hz (position loop) or dt = 0.02,
in the altitude i dont know but i think at least not bigger than 0,02 , (i see every article say that 200hz or 250hz )
I understand, , you use feed back lineariztion for position control and HOSM for attitude. i do the same in my simulation but i not test in real.
But overall its the same logic , you just dont need to care much to sample , because i dont know to handle that just debug to see this value . Also your algorithm its not heavy to calculate, so 50hz its ok .
I dont quite understand how the controller is implemented into the PX4 firmware. So to understand how your controller works, you model the translational dynamics and implement a SMC based controller that guarantees tracking where the control input to the translational dynamics are these virtual controller inputs. So when these virtual inputs are designed you are able to relate them to the total thrust and desired pitch and roll angles? Where the total thrust is normalized and eventually converted to set points for the angle controller and a yaw set point in the PX4? I am also not sure how these relationships are derived (converting virtual control inputs to thrust etc), probably because I am not overly familiar with the controller. I also could be completely misinterpreting the implementation.
that true what you said. ALL! i have struggled when i start.
they have a different in theory and the way PX4 implement.
They not use Euler angle for the control . they use Quaternion . you can find in internet the formula math
What I did that only the virtual control SMC to improve the tracking trajectory. So the relationship you said, i don’t touched at all.
Yes I see they use quaternions as the setpoint for the angle controller. So you designed the virtual control inputs then those relations calculate the requirements for the PX4 with the non linear decoupling equations.
I seen your question.pdf. Does U1 correspond to Fsp in that controller diagram? Which is then normalized?