Velocity Settings in Motion Studio

Velocity Settings in Motion Studio

The most recent version of this article can be found at this link.


Introduction


The Velocity Settings window within Motion Studio is used for several purposes. Inside this window motors and encoder combination can be tested with velocity control and motor and encoder combinations can be manually and automatically tuned. This Application Note covers all of the details and functionality available inside the velocity settings window.


Figure 1
The Velocity Settings window.


Sections


Graphing



Figure 2
The graphing pane.

The graphing section of the Velocity Settings window is used to graph various values of the motor and controller's operation against each other over time. The usage of this tool will be covered in another article.


Velocity Settings


The velocity settings pane is where the tuning parameters for velocity control are displayed and also edited if manually tuning a motor and encoder combination.

Figure 3
The velocity setting pane.

Velocity P
This setting is the proportional term used in the PID loop of the motor controller. The proportional terms accounts for the current error between the setpoint and actual value. This box displays the value set by auotuning or can be edited for manual tuning of a motor and encoder combination.

Velocity I
This setting is the integral term used in the PID loop of the motor controller. The integral term accounts for error over time and correct for this. This box displays the value set by auotuning or can be edited for manual tuning of a motor and encoder combination.

Velocity D
This setting is the derivative term used in the PID loop of the motor controller. The derivative term looks at errors that will occur in the future as a result of the current parameters and corrects for errors before they happen. This box displays the value set by auotuning or can be edited for manual tuning of a motor and encoder combination.

QPSS
This setting is the value of quadrate pulses per second of the encoder in use. This value must be set manually before performing autotuning. The value can be found by going to the PWM Settings window and running a motor and encoder combination at full speed and then reading the speed value at the top of the application.

L
This box is set with the inductance value of a motor when using an MCP motor controller in current control mode.

R
This box is set with the resistance value of a motor when using an MCP motor controller in current control mode.

Error limit
This setting allows for a user settable value that will stop the motor if there is a difference between the desired velocity and the encoder reading. There are several things that may cause this to occur. Bad tuning is the most likely circumstance to trip this protection. Sudden changes in load on a motor is another thing that may cause this to trigger. Finally, encoders that are wired improperly are guaranteed to cause this protection to kick in. The value is measured in quadrature pulses per second. If the value is set to zero the protection is disabled and any non-zero value turns it on. If too small a value is assigned the protection will kick in too often. A large value relative to the qpss of the motor and encoder combination is recommended.


Control



Figure 4
The control pane.

Sliders
The two available sliders are used to control one or both motors for testing purposes. Moving the slider up turns the motor in the forward direction and sliding it down turns the motor in the reverse direction. This feature in conjunction with the status bar at the top of the application can also be used to test the operation of attached encoders.

Sync Motors
This setting ties the two sliders together so that when they are moved they move together. This can be used to operate both motors together at the exact same velocity settings.

On release
If this option is checked the sliders will only move after the mouse button is released after moving the control sliders.

Accel
This setting is used to adjust the rate a which a motor changes from one speed to another. A higher value increases the amount of time between speed changes and a lower values less time.

Velocity
This value cannot be changed and is a read-only value. It indicates the motor's velocity in quadrature counts per second.

Autotune
When clicked this button starts the autotuning routine for a given motor channel. Before starting the autotuning process the "QPSS" value must be set in the Velocity Setting pane. While running, the autotune routine will run the motor in both directions several times. Once finished the calculated P, I and D value will be populated in the Velocity Settings pane. Running the motors with the sliders after autotuning is recommended to test the quality of the tuning results.

Level
This setting allows for quick adjustment of the autotuned PID parameters. Moving the slider in the positive directions increases the aggressiveness of the tuning. Moving the slider in the negative direction softens the tuning parameters. Testing the motors with the control sliders after making changes with the level slider is recommended.