Hello everybody
I am currently developing a quadrotor MPC, for now just the outer loop (position control) while the inner loop is managed by a PID controller.
I set the constraints like so in the OCP formulation:
# Control constraints
ocp.constraints.lbu = np.array([-1, -1, - Tmax / m])
ocp.constraints.ubu = np.array([1, 1, Tmin / m])
ocp.constraints.idxbu = np.array([0, 1, 2])
They are repeated when I launch the ROS2 node which uses the solver. The control input is the acceleration in the NED frame (I am working with PX4 autopilot).
lbu = np.array([-1, -1, - Tmax / m])
ubu = np.array([1, 1, Tmin / m])
self.solver.constraints_set(0, 'lbu', lbu)
self.solver.constraints_set(0, 'ubu', ubu)
The problem is that, especially the constraints related to X an Y, are not respected by the MPC. I am able to see the output of the solver since I have to convert it to thrust and reference quaternion, and it sometimes keeps giving 20 m/s^2 instead of 1 m/s^2. Instead from the testing, the constraints on a_z seem to be respected.
If anybody can please help me out, thank you
Riccardo