Drive Analog Control Functions
Drive Analog Position Control
HARDWARE: This feature and its functions do not apply when used with the GI4, the GL4, or the XL4s.
You can use the Drive Analog Position Control feature to generate a position command based on an external analog signal. The drive calculates the position command in user units with the equation that follows:
Where:
Analog Input Voltage is the external signal voltage that is read by the analog input.
$inputOffset specifies the voltage offset for the analog input signal.
$inputScale specifies the gain, in user units/volt, of the external analog signal.
Starting Position is the position of the axis in user units where you turned on the Drive Analog Position Control feature.
Configure Drive Analog Position Control
IMPORTANT: You cannot configure this feature while it is active.
Before you use the Drive Analog Position Control feature, you must issue the DriveAnalogPositionControlConfigureInput() function. You can specify a positive or negative value for the $inputScale argument based on the relation between your external analog sensor signal and the direction of motion that you want.
function DriveAnalogPositionControlConfigureInput($axis as axis, $inputNum as integer, $inputScale as real, $inputOffset as real)
Configures the relationship between the output position and analog input voltage, where Position = (Analog Input Voltage - $inputOffset) x $inputScale + (Starting Position). Starting Position is the position of the axis at the time DriveAnalogPositionControlOn() is called.
Arguments
$axis The axis on which to apply the configuration for the Drive Analog Position Control feature.
$inputNum The analog input signal used in the position computation.
$inputScale The scale value used in the position computation.
$inputOffset The offset value used in the position computation.
You can specify a maximum speed at which the drive commands the axis to move while it operates under Drive Analog Position Control. To do this, use the DriveAnalogPositionControlConfigureSpeedClamp() function.
The drive does not limit the speed of the axis if one of the conditions that follow occurs:
- You do not issue this function.
- You issue this function with a specified value of 0 for the $maxSpeed argument.
function DriveAnalogPositionControlConfigureSpeedClamp($axis as axis, $maxSpeed as real)
Configures the maximum speed at which the controller commands the axis to move using the Drive Analog Position Control feature. If you do not use this function, then the controller does not limit the maximum speed.
Arguments
$axis The axis on which to apply the configuration for the Drive Analog Position Control feature.
$maxSpeed The speed in user units per second. If you specify a value of 0 for this argument, then the controller does not limit the maximum speed.
Enable or Disable Drive Analog Position Control
After you configure the Drive Analog Position Control feature, you can use the DriveAnalogPositionControlOn() function to turn it on. The axis that you specify must be enabled so that you can issue this function. When you turn on this feature, the drive will control the axis position based on the analog input value.
function DriveAnalogPositionControlOn($axis as axis)
Enable the Drive Analog Position Control feature.
Arguments
$axis The axis on which to enable the Drive Analog Position Control feature.
Drive Analog Position Control stays active until you issue the DriveAnalogPositionControlOff() function or until you disable the specified axis. If you turn off this feature, the DriveAnalogPositionControlOff() function does not reset the configuration of Drive Analog Position Control. You can use the DriveAnalogPositionControlOn() function again to enable this feature with the existing configuration.
function DriveAnalogPositionControlOff($axis as axis)
Disable the Drive Analog Position Control feature.
Arguments
$axis The axis on which to disable the Drive Analog Position Control feature.
For an example about how to use the Drive Analog Position Control feature, refer to the section that follows.
Let's say that your stage can travel to a minimum position of -20 μm and a maximum position of 120 μm. If you want 0 V on the analog input to correspond to the minimum position and 10 V to correspond to the maximum position, you can use the following equation to calculate the value of the $inputScale argument for the DriveAnalogPositionControlConfigureInput() function.
If the stage is currently at position 0, you can use the following equation to calculate the value of the $inputOffset argument for this function.
If you want to configure axis X to use analog input 0 and use a speed clamp of 20 μm/s, you must issue the following functions to configure and turn on Drive Analog Position Control:
DriveAnalogPositionControlConfigureInput(X, 0, 14, 1.4286)
DriveAnalogPositionControlConfigureSpeedClamp(X, 20)
DriveAnalogPositionControlOn(X)
If the analog input is not at 1.4286 V when you issue the DriveAnalogPositionControlOn() function, then a step change in position occurs.
Drive Analog Velocity Control
HARDWARE: This feature and its functions do not apply when used with the GI4, GL4, SI4, iXI4, XI4, or XL4s. On the iXR3 and XR3, this feature and its functions apply to only the first axis.
IMPORTANT: This feature cannot be used with gantry mode under the Decoupling Control method.
You can use the Drive Analog Velocity Control feature (also called Velocity Mode) to generate a velocity command based on an external analog signal. The drive calculates the velocity command in user units per second with the equation that follows:
Where:
Analog Input Voltage is the external signal voltage that is read by the analog input.
$inputOffset specifies the voltage offset for the analog input signal in millivolts. This represents the input voltage that will correspond to zero velocity command.
$inputScale specifies the gain in user units/second/volt of the external analog signal.
The drive then integrates this velocity command to produce a position command, which is used as the input to the servo loop. The normal feedforward inputs are ignored. If you want to have velocity and/or acceleration feedforward in your system, use the Analog Feedforward modes that follow.
Configure Drive Analog Velocity Control
IMPORTANT: You cannot configure this feature while it is active.
Before you use the Drive Analog Velocity Control feature, you must issue the DriveAnalogVelocityControlConfigureInput() function. You can specify a positive or negative value for the $inputScale argument based on the relation between your external analog signal and the direction of motion that you want.
function DriveAnalogVelocityControlConfigureInput($axis as axis, $analogInputNum as integer, $digitalInputNum as integer, $inputScale as real, $inputOffset as real)
Configures the relationship between the output velocity and analog input voltage, where Velocity = (Analog Input Voltage - ($inputOffset / 1000)) x $inputScale.
Arguments
$axis The axis on which to apply the configuration for the Drive Analog Velocity Control feature.
$analogInputNum The analog input signal used in the velocity computation.
$digitalInputNum The digital input signal used to enable and disable the axis.
$inputScale The scale value used in the velocity computation to convert from volts to units/second.
$inputOffset The offset value in millivolts used in the velocity computation. This argument has a minimum value of -1000 and a maximum value of 1000.
Enable or Disable Drive Analog Velocity Control
IMPORTANT: You cannot turn on Analog Velocity Control if Analog Position Control or Analog Current Control is already enabled.
After you configure the Drive Analog Velocity Control feature, you can use the DriveAnalogVelocityControlOn() function to turn it on. When you turn on this feature, you will use the specified digital input to enable or disable the axis. When this feature is on and the axis is enabled, the drive controls the axis velocity based on the analog input value.
function DriveAnalogVelocityControlOn($axis as axis)
Enables the Drive Analog Velocity Control feature.
Arguments
$axis The axis on which to enable the Drive Analog Velocity Control feature.
Drive Analog Velocity Control stays active until you issue the DriveAnalogVelocityControlOff() function. If you turn off this feature, the DriveAnalogVelocityControlOff() function does not reset the configuration of Drive Analog Velocity Control. You can use the DriveAnalogVelocityControlOn() function again to enable this feature with the existing configuration.
function DriveAnalogVelocityControlOff($axis as axis)
Disables the Drive Analog Velocity Control feature.
Arguments
$axis The axis on which to disable the Drive Analog Current Control feature.
Drive Analog Current Control
HARDWARE: This feature and its functions do not apply when used with the GI4, GL4, SI4, iXI4, XI4, or XL4s. On the iXR3 and XR3, this feature and its functions apply to only the first axis. Drive Analog Current Control also cannot be used with gantry mode.
IMPORTANT: Drive Analog Current Control requires that the initialization method in the CommutationInitializationSetup Parameter is set to Hall-Effect Switches. It also requires that the BrakeEnableDelay Parameter and the BrakeDisableDelay Parameter are set to zero.
You can use the Drive Analog Current Control feature (also called Torque Mode) to generate a current command based on an external analog signal. The drive calculates the current command in amps with the equation that follows:
Where:
Analog Input Voltage is the external signal voltage that is read by the analog input.
$inputOffset specifies the voltage offset for the analog input signal in millivolts. This represents the input voltage that will correspond to zero current command.
$inputScale specifies the gain in amps/volts of the external analog signal.
This current command overwrites the output of the servo loop before feedforward is added. The normal feedforward inputs are ignored. If you want velocity and/or acceleration feedforward in your system, use the Analog Feedforward modes that follow.
Configure Drive Analog Current Control
IMPORTANT: You cannot configure this feature while it is active.
Before you use the Drive Analog Current Control feature, you must issue the DriveAnalogCurrentControlConfigureInput() function. You can specify a positive or negative value for the $inputScale argument based on the relation between your external analog signal and the direction of motion that you want.
function DriveAnalogCurrentControlConfigureInput($axis as axis, $analogInputNum as integer, $digitalInputNum as integer, $inputScale as real, $inputOffset as real)
Configures the relationship between the output current and analog input voltage, where Current = (Analog Input Voltage - ($inputOffset / 1000)) x $inputScale.
Arguments
$axis The axis on which to apply the configuration for the Drive Analog Current Control feature.
$analogInputNum The analog input signal used in the current computation.
$digitalInputNum The digital input signal used to enable and disable the axis.
$inputScale The scale value used in the current computation to convert from volts to amps.
$inputOffset The offset value in millivolts used in the current computation. This argument has a minimum value of -1000 and a maximum value of 1000.
Enable or Disable Drive Analog Current Control
IMPORTANT: You cannot turn on Analog Current Control if Analog Position Control or Analog Velocity Control is already enabled.
After you configure the Drive Analog Current Control feature, you can use the DriveAnalogCurrentControlOn() function to turn it on. When you turn on this feature, you will use the specified digital input to enable or disable the axis. When this feature is on and the axis is enabled, the drive will control the amplifier current based on the analog input value.
function DriveAnalogCurrentControlOn($axis as axis)
Enables the Drive Analog Current Control feature.
Arguments
$axis The axis on which to enable the Drive Analog Current Control feature.
Drive Analog Current Control stays active until you issue the DriveAnalogCurrentControlOff() function. If you turn off this feature, the DriveAnalogCurrentControlOff() function does not reset the configuration of Drive Analog Current Control. Use the DriveAnalogCurrentControlOn() function again to enable this feature with the existing configuration.
function DriveAnalogCurrentControlOff($axis as axis)
Disables the Drive Analog Current Control feature.
Arguments
$axis The axis on which to disable the Drive Analog Current Control feature.
Drive Analog Velocity Feedforward
HARDWARE: This feature and its functions do not apply when used with the GI4, GL4, SI4, iXI4, XI4, or XL4s. On the iXR3 and XR3, this feature and its functions apply to only the first axis.
You can use the Drive Analog Velocity Feedforward feature with Drive Analog Velocity Control or Drive Analog Current Control to generate a velocity feedforward based on an external analog signal. The drive calculates the velocity feedforward in user units per second with the equation that follows:
Where:
Analog Input Voltage is the external signal voltage that is read by the analog input.
$inputOffset specifies the voltage offset for the analog input signal in millivolts. This represents the input voltage that will correspond to zero velocity feedforward.
$inputScale specifies the gain, in user units/second/volt, of the external analog signal.
This velocity feedforward value is used as the velocity command input in the feedforward section of the servo loop block diagram. Refer to Servo Loop Block Diagram - Full. The FeedforwardGainVff Parameter and the FeedforwardGainNormalizationFactor Parameter must be set to the appropriate non-zero values for this mode to work.
Configure Drive Analog Velocity Feedforward
IMPORTANT: You cannot configure this feature while it is active.
Before you use the Drive Analog Velocity Feedforward feature, you must issue the DriveAnalogVelocityFeedforwardConfigureInput() function. You can specify a positive or negative value for the $inputScale argument based on the relation between your external analog signal and the direction of motion that you want.
function DriveAnalogVelocityFeedforwardConfigureInput($axis as axis, $analogInputNum as integer, $inputScale as real, $inputOffset as real)
Configures the relationship between the velocity feedforward and analog input voltage, where Velocity Feedforward = (Analog Input Voltage - ($inputOffset / 1000)) x $inputScale.
Arguments
$axis The axis on which to apply the configuration for the Drive Analog Velocity Feedforward feature.
$analogInputNum The analog input signal used in the velocity feedforward computation.
$inputScale The scale value used in the velocity feedforward computation to convert from volts to units/second.
$inputOffset The offset value in millivolts used in the velocity feedforward computation. This argument has a minimum value of -1000 and a maximum value of 1000.
Enable or Disable Drive Analog Velocity Feedforward
After you configure the Drive Analog Velocity Feedforward feature, you can use the DriveAnalogVelocityFeedforwardOn() function to turn it on. When you turn on this feature, the drive controls the axis velocity feedforward based on the analog input value. The feedforward has no effect until the DriveAnalogVelocityControlOn() or DriveAnalogCurrentControlOn() function is issued.
function DriveAnalogVelocityFeedforwardOn($axis as axis)
Enables the Drive Analog Velocity Feedforward feature.
Arguments
$axis The axis on which to enable the Drive Analog Velocity Feedforward feature.
Drive Analog Velocity Feedforward stays active until you issue the DriveAnalogVelocityFeedforwardOff() function. If you turn off this feature, the DriveAnalogVelocityFeedforwardOff() function does not reset the configuration of Drive Analog Velocity Feedforward. You can use the DriveAnalogVelocityFeedforwardOn() function again to enable this feature with the existing configuration.
function DriveAnalogVelocityFeedforwardOff($axis as axis)
Disables the Drive Analog Velocity Feedforward feature.
Arguments
$axis The axis on which to disable the Drive Analog Velocity Feedforward feature.
Drive Analog Acceleration Feedforward
HARDWARE: This feature and its functions do not apply when used with the GI4, GL4, SI4, iXI4, XI4, or XL4s. On the iXR3 and XR3, this feature and its functions apply to only the first axis.
You can use the Drive Analog Acceleration Feedforward feature with Drive Analog Velocity Control or Drive Analog Current Control to generate an acceleration feedforward based on an external analog signal. The drive calculates the acceleration feedforward in user units per second2 with the equation that follows:
Where:
Analog Input Voltage is the external signal voltage that is read by the analog input.
$inputOffset specifies the voltage offset for the analog input signal in millivolts. This represents the input voltage that will correspond to zero acceleration feedforward.
$inputScale specifies the gain in user units/second2/volt of the external analog signal.
This acceleration feedforward value is used as the acceleration command input in the feedforward section of the servo loop block diagram. Refer to Servo Loop Block Diagram - Full. The FeedforwardGainAff Parameter and the FeedforwardGainNormalizationFactor Parameter must be set to the appropriate non-zero values for this mode to work.
Configure Drive Analog Acceleration Feedforward
IMPORTANT: You cannot configure this feature while it is active.
Before you use the Drive Analog Acceleration Feedforward feature, you must issue the DriveAnalogAccelerationFeedforwardConfigureInput() function. You can specify a positive or negative value for the $inputScale argument based on the relation between your external analog signal and the direction of motion that you want.
function DriveAnalogAccelerationFeedforwardConfigureInput($axis as axis, $analogInputNum as integer, $inputScale as real, $inputOffset as real)
Configures the relationship between the acceleration feedforward and analog input voltage, where Acceleration Feedforward = (Analog Input Voltage - ($inputOffset / 1000)) x $inputScale.
Arguments
$axis The axis on which to apply the configuration for the Drive Analog Acceleration Feedforward feature.
$analogInputNum The analog input signal used in the acceleration feedforward computation.
$inputScale The scale value used in the acceleration feedforward computation to convert from volts to units/second^2.
$inputOffset The offset value in millivolts used in the acceleration feedforward computation. This argument has a minimum value of -1000 and a maximum value of 1000.
Enable or Disable Drive Analog Acceleration Feedforward
After you configure the Drive Analog Acceleration Feedforward feature, you can use the DriveAnalogAccelerationFeedforwardOn() function to turn it on. When you turn on this feature, the drive controls the axis acceleration feedforward based on the analog input value. The feedforward has no effect until the DriveAnalogVelocityControlOn() or DriveAnalogCurrentControlOn() function is issued.
function DriveAnalogAccelerationFeedforwardOn($axis as axis)
Enables the Drive Analog Acceleration Feedforward feature.
Arguments
$axis The axis on which to enable the Drive Analog Acceleration Feedforward feature.
Drive Analog Acceleration Feedforward stays active until you issue the DriveAnalogAccelerationFeedforwardOff() function. If you turn off this feature, the DriveAnalogAccelerationFeedforwardOff() function does not reset the configuration of Drive Analog Acceleration Feedforward. You can use the DriveAnalogAccelerationFeedforwardOn() function again to enable this feature with the existing configuration.
function DriveAnalogAccelerationFeedforwardOff($axis as axis)
Disables the Drive Analog Acceleration Feedforward feature.
Arguments
$axis The axis on which to disable the Drive Analog Acceleration Feedforward feature.
Analog Velocity and Current Control Setup
The analog control functions control the velocity or current command of an axis using an analog input. Use the steps that follow to configure Analog Velocity Control or Analog Current Control.
-
Use Machine Setup to configure the drive for the connected motor/stage and encoder.
-
Use EasyTune to set the servo loop and feedforward gains.
-
Set the fault mask parameters for the faults that you want to enable.
-
If you are configuring your system for Analog Current Control, do not set any bits in the FaultMaskDecel Parameter.
-
-
If you want to have a fault output, set up the fault output signal in Configure > Axes > Protection > Outputs. Use the FaultSetup Parameter to configure the fault output as Cleared by Fault Acknowledge.
-
Configure velocity and current clamps (optional). You can set these parameters in the Configure workspace, or you can set them with the ParameterSetAxisValue() function in an AeroScript program, which does not require a controller reset.
-
To limit the velocity of the axis, use the MaxSpeedClamp Parameter.
-
To limit the current of the axis, use the MaxCurrentClamp Parameter.
-
-
Write an AeroScript program to configure and turn on the Analog Control mode, Analog Feedforward mode(s), and encoder echoing.
-
Configure and turn on the Analog Control mode that you want to use:
-
To configure and turn on Analog Velocity Control, use DriveAnalogVelocityControlConfigureInput() and DriveAnalogVelocityControlOn(), respectively.
-
To configure and turn on Analog Current Control, use DriveAnalogCurrentControlConfigureInput() and DriveAnalogCurrentControlOn(), respectively.
-
-
Configure and turn on the Analog Feedforward mode(s) that you want to use:
-
To configure and turn on Analog Velocity Feedforward, use DriveAnalogVelocityFeedforwardConfigureInput() and DriveAnalogVelocityFeedforwardOn(), respectively.
-
Analog Velocity Feedforward can use the same or different analog input as the selected Analog Control mode and Analog Acceleration Feedforward.
-
-
To configure and turn on Analog Acceleration Feedforward, use DriveAnalogAccelerationFeedforwardConfigureInput() and DriveAnalogAccelerationFeedforwardOn(), respectively.
-
Analog Acceleration Feedforward can use the same or different analog input as the selected Analog Control mode and Analog Velocity Feedforward.
-
-
-
You can configure the encoder input to be echoed to an output connector. This is optional, but it can be helpful when your external controller also needs position feedback. Use DriveEncoderOutputConfigureInput() and DriveEncoderOutputOn() to configure the output connector to echo the encoder inputs.
-
-
If you want the drive to automatically respond to inputs from a third-party device immediately after controller reset, use the Program Automation Module to configure this AeroScript program to run automatically.
Use the example program that follows as a guide to help you configure and turn on the Analog Control mode that you want to use, the Analog Feedforward mode, and encoder echoing.
IMPORTANT: The drive must be connected to a running controller for Analog Control to work.
// Define the maximum values. #define MAX_INPUT_VOLTAGE 10.0 #define MAX_CURRENT_COMMAND 2.5 #define MAX_VELOCITY_COMMAND 556.5 #define MAX_ACCELERATION_COMMAND 150.7 // Set variables to be used to configure scale factors. var $currentCommandScaleFactor as real = MAX_CURRENT_COMMAND / MAX_INPUT_VOLTAGE var $velocityFeedforwardScaleFactor as real = MAX_VELOCITY_COMMAND / MAX_INPUT_VOLTAGE var $accelerationFeedforwardScaleFactor as real = MAX_ACCELERATION_COMMAND / MAX_INPUT_VOLTAGE // Configure Analog Current Control on axis X to use analog input 0 for the current command and // digital input 1 for the enable signal with an input offset of 10mV. DriveAnalogCurrentControlConfigureInputs(X, 0, 1, $currentCommandScaleFactor, 10.0) // Configure Analog Velocity Feedforward on axis X to use analog input 1 for the velocity // feedforward value with an input offset of -5mV. DriveAnalogVelocityFeedforwardConfigureInputs(X, 1, $velocityFeedforwardScaleFactor, -5.0) // Configure Analog Acceleration Feedforward on axis X to use analog input 2 for the acceleration // feedforward value with an input offset of 0.125mV. DriveAnalogAccelerationFeedforwardConfigureInputs(X, 2, $accelerationFeedforwardScaleFactor, 0.125) // Echo the primary encoder inputs to the auxiliary feedback connector. DriveEncoderOutputConfigureInput(X, EncoderOutputChannel.AuxiliaryEncoder, EncoderInputChannel.PrimaryEncoder) DriveEncoderOutputOn(X, EncoderOutputChannel.AuxiliaryEncoder, EncoderOutputMode.Quadrature) // Enable Analog Current Control. DriveAnalogCurrentControlOn(X) // Enable Analog Velocity Feedforward. DriveAnalogVelocityFeedforwardOn(X) // Enable Analog Acceleration Feedforward. DriveAnalogAccelerationFeedforwardOn(X)