Hi,
I am working on a school project and I am having difficulty creating a simulation for controlling a crazyflie in Matlab. I have been looking over the firmware but I am having trouble understanding it. I am pretty sure that the correct body frame orientation is X: forward, Y: left, Z: up. When I look at power_distribution_stock.c (https://github.com/bitcraze/crazyflie-f ... on_stock.c), based off lines 76-91, it looks like the body frame is instead X: forward, Y: right, Z:down. I'm assuming this is because of signs changes in other places of the firmware.
I believe my biggest issue is trying to accurately modeling the attitude/rate controllers used in the firmware. I am using the PID values stated in the firmware, but when I try to track an x or y position, the system becomes unstable. On the other hand I can track a desired altitude and yaw.
Any help would be appreciated,
Thanks!
Problems modeling Crazyflie controller in Matlab
Re: Problems modeling Crazyflie controller in Matlab
Hi,
The Crazyflie roll/pitch/yaw commands are setup the same way as it is defined on a plane (https://en.wikipedia.org/wiki/Aircraft_principal_axes). So you observation is right, the output of the velocity loop is setup to follow this orientation.
What mechanical model are you using to simulate the Crazyflie?
The Crazyflie roll/pitch/yaw commands are setup the same way as it is defined on a plane (https://en.wikipedia.org/wiki/Aircraft_principal_axes). So you observation is right, the output of the velocity loop is setup to follow this orientation.
What mechanical model are you using to simulate the Crazyflie?
Re: Problems modeling Crazyflie controller in Matlab
I am using Newton-Euler model to calculate the dynamics with X pointing forward and Z up. Just to clarify, the correct body frame orientation is the NED frame shown in the link you posted?
Re: Problems modeling Crazyflie controller in Matlab
roll/pitch/yaw angles are defined as in the wikipedia link I sent. The translation frame has X pointing forward and Z pointing up https://www.bitcraze.io/getting-started ... tion-hold/