![]() | IWinchControlSetMotor Method |
Namespace: KASAPIv2
void SetMotor( float targetSpeed )
The motor is responsible for the deployed cable length changing. It can extend the cable, retract the cable, or do nothing (idle). The winch and its head cannot get separated at a greater distance than the current deployed cable length. That said, the motor is controlling the distance.
The motor speed is not required to change immediately. The motor may need some time to get to the target speed. It depends on the part implementation and configuration. The rule of thumb is to not expect the motorCurrentSpeed to match the targetSpeed right after the method call. There may be some time needed before the values will match. However, the motorTargetSpeed value will change immediately, and will match the parameter.
Setting the motor speed may affect the connector state. E.g. if the connector was locked, and the motor speed is set to a positive value (extending), then the connector is get deployed.
The motor will automatically stop when the cable length reaches zero or the maximum allowed value. In case of the zero length, the connector will be attempted to lock into the winch. This attempt may fail due to the bad align of the connector. To retry the attempt, just call this method again with a negative value.