Click or drag to resize

IWinchControlSetMotor Method

Sets the winch motor to the desired speed.

Namespace:  KASAPIv2
Assembly:  KAS-API-v2 (in KAS-API-v2.dll) Version: KAS API v2
Syntax
C#
void SetMotor(
	float targetSpeed
)
Request Example View Source

Parameters

targetSpeed
Type: SystemSingle
The new speed of the motor. The positive value instructs to extend the cable, and the negative value commands to retract the cable. Zero value turns the motor off. The infinite values can be used to set the target speed to the maximum allowed speed on the part.
Remarks

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.

See Also