Schematic

MicroBasic Language Reference
Advanced Digital Motor Controller User Manual 195
Script Examples
Several sample scripts are available from the download page on Roboteq’s web site.
Below is an example of a script that continuously checks the heat sink temperature at
both sides of the controller enclosure and lowers the amps limit to 50A when the average
temperature exceeds 50oC. Amps limit is set at 100A when temperature is below 50o.
Notice that as temperature is changing slowly, the loop update rate has been set at a rela-
tively slow 100ms rate.
This script regularity reads the current temperature at both sides
‘ of the heat sink and changes the Amps limit for both motors to 50A
‘ when the average temperature is above 50oC. Amps limit is set to
‘ 100A when temperature is below or equal to 50oC.
‘ Since temperature changes slowly, the script is repeated every 100ms
This script is distributed AS IS”; there is no maintenance
‘ and no warranty is made pertaining to its performance or applicability
top: ‘ Label marking the beginning of the script.
‘ Read the actual command value
Temperature1 = getvalue(_TEMP,1)
Temperature2 = getvalue(_TEMP,2)
TempAvg = (Temperature1 + Temperature2) / 2
‘ If command value is higher than 500 then configure
‘ acceleration and deceleration values for channel 1 to 200
if TempAvg > 50 then
setconfig(_ALIM, 1, 500)
setconfig(_ALIM, 2, 500)
else
‘ If command value is lower than or equal to 500 then configure
‘ acceleration and deceleration values for channel 1 to 5000
setconfig(_ALIM, 1, 1000)
setconfig(_ALIM, 2, 1000)
end if
‘ Pause the script for 100ms
wait(100)
‘ Repeat the script from the start
goto top
MicroBasic Language Reference
Introduction
The Roboteq Micro Basic is high level language that is used to generate programs that
runs on Roboteq motor controllers. It uses syntax nearly like Basic syntax with some ad-
justments to speed program execution in the controller and make it easier to use.