ROBOFORTH IIThe most extensive and powerful robot control system on the planet
ROBOFORTH is a 4GL robot control language designed to cover every eventuality in programming your robot, whether it be coating, assembly, laboratory handling, testing, or whatever. There are various means of acquiring spatial data and using it such as matrices, continuous path, object tracking, collision avoidance, plus numerous input-output features making it easy to interface with and control peripheral equipment at the same time as control the robot arm. Above all Roboforth is a real language i.e. has an extensive vocabulary of words, which, like a natural language, help you express your ideas to the system. As a language Roboforth is a means of communication between the human user and the robot arm: for the user to tell the robot what to do and how to do it; for the robot to tell the user what it is doing and what it knows.
While Roboforth runs in the robot controller its counterpart, RobWin runs in the computer. RobWin is only used for programming and may be dropped once the robot is programmed.
Moving the robot and teaching the robot are two separate operations.
Moving the robot
Teaching the robot
Finally all these learned and named entities are used in the procedure file to create new definitions or 'words' which determine how the positions are used, i.e. in what order, in what circumstances etc. For example a word might be defined using a PLACE named JIG and a matrix route named TRAY:
: GETPART TRAY INTO GRIP UP JIG UNGRIP WITHDRAW ;
Because Forth and Roboforth are stack oriented the position within the TRAY is given on the stack just before the command, for example
5 GETPARTwill get a part from position 5 of the TRAY and put into the JIG
This may be typed as a command into the communications window, or sent from a supervisor, which computes the position number, or further compiled into an even higher level definition for example a loop that works through the whole tray.
: PUMP PA 5 ;
You can then control the pump with simple PUMP ON and PUMP OFF. This could then be included in your higher level definition.
: SENSOR PB 7 ; : GETPART SENSOR 1 WAIT TRAY INTO GRIP UP JIG UNGRIP WITHDRAW PUMP ON 5000 MSECS PUMP OFF ;
Include the ability to re-program errors such as what happens when you press the stop button. The robot always stops with controlled deceleration when the 'soft' stop is pressed, and normally the system aborts. However it is possible to program alternative action using 'vectored execution', for example turn on a light and wait for the green button to be pressed, then perform some recovery procedure and continue with the main task. The result is rather like an interrupt, which is also programmable as are positional errors. For example if there is a jam in the machine with which the robot is working the robot may crash into it, causing a positional error, which normally aborts the system. This could be reprogrammed to pull back, flash a light then wait for an operator to clear the condition and press the continue button. Suppose the robot is carrying a rotary cutter. When the stop button is pressed the cutter must stop also. When the continue button is pressed the robot can continue; the cutter is turned back on but only if it was on when the stop was pressed.
Object database to track what objects are in what positions.
Machine/instrument interface: Robot motions maybe synchronized to or interlocked with inputs from/ outputs to other equipment.
Constant speed: program a path in equal length segments and set a fixed time for each segment.
Curves/circles at constant angular speed.
Repeat a route from the beginning without stopping, for example to keep going round a circular path.
Turnkey operation, program restart, programmable stop circuit
Interrupts: Real processor interrupts can also be programmed if required without any effect on robot motion. These are all programmed in Roboforth with the same ease as programming the rest of the system. An interrupt can be generated from an input or from an internal timer. For example you might want to take measurements through the analog interface every n milliseconds while the robot program is running and the robot is in motion to build a force/displacement profile for later upload to the PC. You can also embed machine code, that has a dictionary entry and can be included in other definitions.
Sensors: The dual processor arrangement permits one processor to control the robot while the other monitors a sensor or takes continuous measurements or to search for an event or value using the robot.
Heuristics: The robot can be programmed to learn it's own coordinates (self teaching), for example to modify a path you taught it so that it changes as a target position changes. A single path or route can have the same starting position but a variable ending position or vice versa, for example from different tray positions to the same instrument.
Relative motion: - Teaching a single motion path that can be repeated anywhere in the workspace. If you have the same motion required in a number of different places, for example to pull out sliding shelves from a shelf unit, START-HERE and END-THERE commands allow you to teach the robot one route that can be run from or to different starting or ending positions without having to teach a new path or route for each shelf. The robot writing in our home page uses this feature.
Accurate real time motions (for example like playing a piano). Stopwatch function.
Read back position continuously or on demand from external program while robot is in motion.
Straight lines with pre-specified maximum deviation from straight.
Recursion: Because Roboforth is based on a real computer language your robot program can include calculations, branching, looping, recursion text, data and memory manipulation.
Machine to machine instructions for supervisors, Python, C++ etc.
ROS interface and code.
The above is just a glimpse of the immense power of this compact memory efficient system, containing hundreds of commands and unique extensions. It's a building block approach, which encourages programming interactively with the robot system, a true man-machine interface.
RobWin7RobWin is a visual project management system for Windows.
RobWin brings everything together in one screen - the robot controller and your files, the positional information and the procedures that use that information. Once programmed RobWin can be terminated and the new commands sent by other software or equipment or the controller can be set to auto-run with no computer. One window provides the user with direct communication with the robot controller, for entering commands, trying out small robot procedures before including them in the main program.
RobWin generates Roboforth commands, which it sends down to the controller and they appear in the communications window along with your own.
It's simple - just create the matrix with how many rows and columns you want. Then teach the system 3 corners of the matrix and press "interpolate". RobWin does the rest.
Using the curve generator you can piece together paths comprising straight lines and curves of specified angle and radius.
Typical RobWin7 screen:
Functions availablePull-down menus from left to right:
File: open ed2 text file, download text file to controller, upload/download binary, print.
Edit: usual cut and paste etc. for the text files.
Settings: Load/save a settings file joint names, Cartesian axes, configure system.
Comm: Change baud rates also change fonts.
Robot: display or change position of robot in joint or Cartesian coordinates, relative or absolute moves. Choose modes, for example smooth mode, continuous path mode.
Project: open/save project files.
Macro: you can write/edit macro commands, which are strings sent to the controller. Ten wide buttons are available for this. In the example above you can see three buttons programmed with the commands ROBOFORTH DE-ENERGIZE and ALIGN.
View: changes which tool bars show.
Window: usual Windows feature.
Buttons, left to right
Open file, save file, cut, copy, paste, START, CALIBRATE, HOME, TEACH mode - invokes the teach pad, JOG mode - invokes the teach pad in Cartesian mode, GRIP/UNGRIP (toggles), SMOOTH mode, JOINT mode, CARTESIAN mode, upload data from controller, download text to controller.
A typical open route dialog boxshowing creation of a new matrix TRAY1 in Cartesian mode, 10 columns by 5 rows.
A typical route editingHere a Cartesian matrix, "route" 3SHELF is being edited using add-to-all, which can shift the entire matrix in any direction. This matrix has 10 positions (could just as easily be several hundred) comprising a 4 by 2 matrix plus two extra positions plus a relative position (marked R). The system adds the relative position to the other 10 to provide another 10 displaced from the first (in this case by 30mm in the Z direction), for example as approach or via positions. This economizes on memory space. Only three corners of a matrix need be taught (marked with asterisks) then the interpolate button is pressed and all the in-between positions are computed. RobWin and Roboforth are designed to permit creation and editing of very large matrices with ease and can manage a great number of them to suit the most complex workspace.
Programming techniques:Routes and places may be created using RobWin. These are entered in the dictionary in the robot controller and the positional data goes into a data area that holds all the coordinates. The data area is maintained simultaneously in the computer. The system creates a hidden text file for route and place names (header file). The procedure continues in a second text file that is edited in its own window and downloaded to the controller after each edit. The data in routes and places may be edited as the program is developed. Sometimes waypoints need to be added.
SupervisorsA supervisor is software that supervises the process running in the controller, perhaps collecting data and usually controls other equipment besides the robot, supervising the entire process. Once RobWin has been used to create spatial data, define procedures, device handling strategies etc. these procedures, known as words, may be sent to the controller via serial link, for example using PRINT commands in BASIC or via RobX ST's ActiveX interface. Proprietary supervisors may be used for example Overlord from Process Analysis Automation (PAA) which has been used successfully to manage and schedule large systems comprising diverse instruments serviced by ST robots. Using RobX you can also write your own supervisor in VB or C. A protocol is given for any other language e.g. Java or Python. Another good approach is to use LabVIEW from National Instruments using RobX. We also support Matlab and ROS.
ActiveXIf you are writing your own supervisor you can set up your own RS232 handler (or USB/RS232 converter) or can use ST's ActiveX interface. Commands or 'methods' are of the form:
short OpenComm(short Port, long BaudRate);Opens the communications port. The return value is 1 if successful, 0 for failure. Use the method GetCommErrorString() to get a description of the problem.
short SendString(LPCTSTR String);Sends the string to the controller. The string should end with a "Carriage Return" character (ASCII 0D hex). Typical strings will be definitions you have programmed into the controller using Roboforth for example GETPLATE. The return value is 1 if the string was successfully sent, 0 if a communication error occurred. Use the method GetCommErrorString() to get a description of the problem.
The controller must be in the "ready" state (as reported by GetStatus) before invoking this method. After sending the string invoke GetStatus() until the "ready" state is received.
short GetStatus();Gets the controller status as follows:
-1: Communication error
0: Waiting (still working on the last command)
1: Ready, but not OK (some robot error)
2: Ready, received (and completed) OK
After receiving status 1 or 2, GetResponse gets the last line sent by the controller. If status is -1, use GetCommErrorString() to get a description of the problem.
CString GetResponse();This gets the controller response. If status was 2 the response string indicates what went wrong, for example you told the robot to go to a position it could not reach, or to put an object in a place already occupied.
Other methods include about box, closing the comms port, getting error codes etc.
LabVIEWControlling an ST robot from LabVIEW also involves using ActiveX. The ActiveX 'server' is easily accessed from LabVIEW. - see How Can I Access an ActiveX Server in LabVIEW?.
In addition a whole set of LabVIEW VIs written for us by National Instruments is included with the ST software disk.
See this example from another ST user.
LabView based dashboard
MatlabMatlab examples and starter .m files are provided.
Linux for R12https://github.com/adamheins/r12
ROS ...for R12 ...for R17
A simple communications protocol from any language
ManualsSoftware manuals are provided on disk only; hard copy is no longer used. Manuals are also online at http://strobotics.com/manuals/manuals.htm
Forth, RoboForth and syntactic computer languagesFourth Generation Languages (4GLs) tend to be list oriented where as third generation languages (3GLs) are syntax oriented. Examples of 4GLs are: Logo, Lisp (as used by Autodesk ACAD) and Prolog. Postscript is another example that uses postfix notation like Forth. Such languages are known as concatenative
Examples of 3GLs are: BASIC, COBOL, C, Java, Python
C was created around the same time as Forth but has developed considerably more and is the preferred language for most computer applications whereas Forth is ideal for embedded systems. It puts you in direct contact with the hardware without working through an operating system.
C programmers often dislike Forth but soon appreciate the simplicity. In the words of Yoda: "You must unlearn what you have learned"
Sun Microsystems uses Forth for their OpenBoot implementation
The Rosetta probe and Phliae lander are programmed in Forth as are many spacecraft..
* For more information visit www.forth.com/forth/index.html though ST's Forth was written and compiled by David Sands, and is not a Forth Inc. product.
This Forth and RoboForth II are copyright David N Sands, 1981 to present
* The Tower of Hanoi problem solved in Forth and with a robot
* A simulated analog computer in Forth generating a sinewave without a sin function