In block-based Vexcode, we have defined a drivetrain with an inertial sensor. When running turn to … for degrees/turn to heading commands, it looks like the robot is slowing down towards the end of a turn. Questions: 1) is this the expected behavior? 2) does setting turn velocity to a specific value affect the actual turn velocity of those commands?
I believe the turn blocks are running a P loop internally, so yes, it would be expected for the robot to slow down a bit as it gets closer to the target.
Yes, if you use the “set turn velocity” block to increase the turn velocity (IIRC the default is 50%), the robot will turn faster, although turning faster may come at the cost of some precision.
So is turn velocity more like start turn velocity? Does the actual velocity go down to zero in a linear fashion? or a percentage of the start velocity?
The turn velocity should be constant at the velocity you set for most of the turn, then when it gets close to the target (how close depends on the exact constant(s) used by the p loop internally), the turn velocity will decrease, until eventually the robot stops and the turn velocity is zero.