Blog: Programming IntelLigent Actuators (part1)
System builders look for software that is both easy to use and powerful; a software that can handle both simple tasks quickly while having the “depth” to be used for more complex scenarios. Usually this becomes a tradeoff between “simple to use” and “very powerful” for which a solution is not easily found.
"SmartMotor" Technology from IntelLiDrives offers a powerful, yet easy to use environment with a solid GUI as part of their intelligent motor control technology.
A VB-like language can be used for writing code directly or graphically. We will show here in an iterative process how the IntelLiDrives programming environment can be used efficiently to build a 2 axes, XY stage application incorporating: I/O, an analog joystick, user variables, conditional looping and multithreading. Let's begin by viewing the “SmartMotor” programming and GUI environment.
The main control screen is intuitive and divided into useful sections: viewing axis Status, Controlling each axis, viewing I/O, Variable editing, Setup configuration, and the Program editing sections allow full manipulation, creation and control of the application development. In the Program section is where we will write our application code. A “building block” or modular approach to program code development will be used.
Often, engineers want to test a prototype design quickly and thus only need to make a simple point-topoint move. This validates initial motor sizing, checks integrity of the actuation mechanism and provides a look into how it will affect the overall system design capabilities. Using just a few, intuitive commands from the “SmartMotor” Standalone language, simple moves can be created and executed quickly.
Now we can add I/O, in the form of limit switches for a homing routine and an output when the motion is complete to signal another process. Some conditional commands for flow control will also be introduced. Notice code in green is new/added while the red is code that has been changed.
INC ; Sets relative mode
; PARAMETER SET UP
EO1=1;Enables 1st axis
EO2=1;Enables 2nd axis
LSPDX = 500; low speed in pulses/sec
LSPDY = 500; low speed in pulses/sec
ACCX=300;Sets accel time in mS
ACCY=300;Sets accel time in mS
DECX=300;Sets decel time in mS
DECY=300;Sets decel time in mS
HSPDX=1000;sets speed on X axis
HSPDY=1000;sets speed on Y axis
; HOMING ROUTINE
LHOMEX; Home to the neg limit switch at low speed
WAITX; wait for motion to complete
LHOMEY; Home to the neg limit switch at low speed
WAITY; wait for motion to complete
DELAY=250; wait for 250mS
; MAIN APPLICATION SECTION
ABS ;Sets absolute mode
X2000; Moves X axis 2000 steps
WAITX; wait for move complete
Y2000; Moves Y axis 2000 steps
WAITY; wait for move complete
DO2=1; turns on output #2 DELAY=500; wait 500mS
DO2=0; turns off output #2
END; end of program
In summary, a simple one time absolute move was created with its parameters. From there we've added a homing routine which runs in relative mode and manipulated I/O to be able to “handshake” with other devices.
Rating Bad Good