Skip to main content
U.S. flag

An official website of the United States government

Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

Motor

Motors have three different position nodes: rawPosition, hardPosition, and softPosition

  • rawPosition is the positional value as read directly from the hardware. This will often be in steps, but in the case of VIPER motors, will already be in meaningful units (such as degrees). NICE always considers this node dimensionless.
  • hardPosition is the rawPosition value converted into a unit that is meaningful for the user such as degrees or cm: hardPosition = rawPosition * conversion.
  • softPosition provides flexibility in defining a motor's position and in most cases is the only node you need to use. softPosition = parity * (hardPosition - zero).
  • conversion, partiy, and zero are all nodes as well.
  • Motor's are good illustrations of how nodes interact on the system:
    • A move of the hardPosition is propagated to the rawPosition node, which causes the motor to move. A move of the softPosition node is propagated to the hardPosition node, which in turn is propagated to the  rawPosition node.
    • Moving a motor will change its position over time. During this process, the rawPosition node advertises changes to is status (the "value" of the node). These status changes can be seen in the client AND are propagated to the hardPosition node, which advertises its status and propagates to the softPosition node.
    • Moving nodes like zero, conversion, or parity cause their status values to instantly change (they are just stored in the NICE program). When the zero node's status changes, it advertised the change to client and propagates the status change to the softPosition node.
    • Warning: If rawPosition changes, outside of NICE (for example moving a motor on VIPER directly), NICE will not know! This can lead to inconsistency/confusion and we do not recommend doing it.

      • You can force NICE to update by using the read command.

      • NICE will automatically poll the position, in the background, at a configurable rate, so if you wait long enough it will know you did this.

  • Limit nodes are used to place constraints on motor's movement through NICE. There are two different types of limit nodes: soft, and raw; for each type there is an upper and lower node.
  • A motor’s rawLowerLimit and rawUpperLimit nodes hold the minimum and maximum values, to which, the rawPosition node can be moved.
  • As a convenience a motor also has a softLowerLimit and softUpperLimit nodes.
    • These are derived from the raw limits and show the range, through which, the softPosition can moved.
    • Moving soft limits indirectly moves raw limits, based on the current value of the zero, parity and conversion nodes. This works identically, to how moving softPosition, indirectly moves rawPosition.
    • The consequence of this scheme is that once limits are set, changes to zero, parity and conversion, WILL NOT change the physical range of motion of a motor, however they will change the status values for softLowerLimit and softUpperLimit.
  • A motor's posLimitState and negLimitState are boolean (true/false) values representing whether a motor has hit a physical limit on the track. Confusingly, these are referred to as "hard limits". They have nothing to do with hardPosition!

 

Created March 21, 2019, Updated December 19, 2019