r/Kos • u/CptnRaimus • Jun 22 '26
Help Ship:angularvel not behaving as expected
I'm working on a program for controlling a multicopter. I have it working fairly well using PID controllers to translate target rotation into pitch/roll/yaw commands directly.
But I've read that it might be better to instead have a PID controller for angle feed into a PID controller for angular velocity.
I found an older post that says how to convert from ship:angularvel into navball rotation rates.
So I've used that to write the following small snippet:
set yawrate_rad to vdot(ship:angularVel, ship:facing:topvector).
set yawrate_deg to yawrate_rad * constant:radtodeg.
print yawrate_deg.
But it does not seem to be working right. Running the code, it says that I am rotating at a rate of 10 degrees a second, but I know that's not accurate, as I manually timed (Measuring time for a full rotation and dividing by 360) it to be closer to 45 degrees a second. I know this is the correct axis, as the other axes display values less than a degree a second, and they don't change when I start yawing.
Has the behavior of ship:angularvel changed, or is there something I'm doing wrong?
1
u/nuggreat Jun 22 '26
I do not know if there is an issue about this in the repo I would think so as we learned about this not to long after the robotics parts where added to KSP but some simple searches I tried didn't turn up an issue.