Acceleration setpoints

Hello! I have been trying to control a PX4 Autopilot Quadcopter model by providing the desired acceleration setpoints using “mavros/setpoint_raw/local”. I also tried providing the desired yaw angle along with the acceleration setpoints. However, I am not getting the desired output. I am providing the acceleration set points in Inertial frame. If the desired_a_z = 0; the drone falls down, whereas, if the desired_a_z = CONSTANTS_ONE_G, drone keeps on going up. I tried to look into the Math in _accelerationControl() function, but I could not understand it properly. Can somebody help me understand what the Math in the _accelerationControl() function and what should be done to control the drone using acceleration set points?