Motion_Control_Examples icon indicating copy to clipboard operation
Motion_Control_Examples copied to clipboard

C++ KCube CC_MoveToPosition Bug and CC_SetHomingParameters wrong Enum in help file

Open BaNavyBlue opened this issue 2 years ago • 0 comments
trafficstars

I've noticed a bug with CC_MoveToPosition where it will stall if moving back to a count position near 0 If I wait for the flags CC_WaitForMessage I will often get the 2 Generic Motor Flag with 2 Generic Motor Stopped, followed by (Generic Motor, Limit Updated), I'm assuming due to overshoot. I try to catch this in my WaitForMessage loop, but sometimes it stalls before returning those messages. At first I tried catching if my position change would yield a negative count and setting the MoveToPosition to 1. This stalls CC_WaitForMessage. My current solution is to just call CC_Home this appears to work fine without stalling anything.

Another semi random bug from the basic example is upon initialization CC_Home usually reverses to it's lowest count, but occasionally it decides home is at full forward.

To fix this issue one needs to use CC_SetHomingParamsBlock and set the direction flags. The help file that comes with kenisis says the direction parameter is a MOT_TravelDirection enum, but its actually the MOT_DirectionSense enum.

BaNavyBlue avatar Jul 28 '23 05:07 BaNavyBlue