Script examples

All the scripts included on this section are given as examples. They have not been extensively tested and validated so we can guarantee that they are bug free. The user must evaluate them and run them at his own risk. Scripts of big lengths will require licenses.

Dynamic PID gains change
This script can be used to change the PID gains depending on the speed of the vehicle. The gains will change based on two speed ranges, and the change will ...
Wed, 18 Jan, 2023 at 1:08 PM
Speed - Speed Position mode exchange example
Scenario   There are a lot of cases where we desire that the motors will hold position when our motors are idle. For example, if our vehicle is placed on ...
Tue, 19 Sep, 2023 at 4:54 PM
Limit switch using analog inputs
The below script is an example of how to implement the limit switch action by using an analog sensor. This script can replace the build in analog input func...
Tue, 16 Jan, 2024 at 10:56 AM
Movement duration in Closed Loop Count Position mode & precision
In this article, we are going to use a test script which measures the time required for a motor to reach 2 desired positions(measured in encoder counts), in...
Tue, 16 May, 2023 at 12:40 PM
CANOpen - Transferring data through TPDOs
Introduction CANOpen is a widely used communication protocol for embedded systems. It is based on the Controller Area Network (CAN) protocol which is a ...
Fri, 5 Apr, 2024 at 11:36 AM
Controlling a lift motor
The below simple script can control a lift motor in Speed mode. Digital input 1 will be used for down movement and Digital input 2 will be used for up moven...
Fri, 11 Aug, 2023 at 2:16 PM
Creating MicroBasic Scripts with Generative AI
In this article, we will provide guidelines for creating MicroBasic scripts utilizing a Generative AI engine. The AI engine used will be determinant for the...
Tue, 10 Oct, 2023 at 3:57 PM
Moving Average Filter for Count Reading
Brief Description of the Code: This MicroBasic script for a Roboteq motor controller smooths encoder data for channels 1 and 2 using a moving average fi...
Tue, 24 Sep, 2024 at 4:24 PM
Digital Output on Motor Drive Fault
DISCLAIMER:   This script is provided as a sample and has not been validated for any specific use. It is the customer's responsibility to thoroughly ...
Mon, 12 Aug, 2024 at 4:47 PM
Custom Stall Detection
This script implements a custom stall detection algorithm. The purpose of using this script is to fully customize the stall detection voltage threshold and ...
Fri, 18 Oct, 2024 at 7:02 PM