|
The BASICs of
MotionBASIC®
 On
the software side, ORION® provides the world’s most widely used
programming language—BASIC—now enhanced with features for high
performance real-time motion control.
Motion + BASIC = MotionBASIC®
Initially developed at Dartmouth in 1962, BASIC is the most widely
used programming language in the world. Virtually all engineering students
worldwide, and many high-school students, take courses in BASIC. It has
been under continuous development throughout its history, resulting in
many improvements over the years. Unlike many other programming languages
developed since, BASIC continues to play a vital role in computing.
ORMEC’s MotionBASIC® is a superset of
Microsoft BASIC representing more than 40 man-years of development.
Designed and built from the ground up to integrate motion control and
industrial I/O with a widely used implementation of BASIC, it uses
English-like motion statements and pre-defined variables. MotionBASIC®
builds on BASIC’s strengths—its standardization, its completeness as a
language, as well as the simplicity, user protection and power of an
interpreter, plus English-like keywords and syntax—to create a
comprehensive software solution for industrial motion control.
BASICs of MotionBASIC®
Variables, Operators & Functions
- Standard BASIC offers a full set of
variable types including integers, strings, floating point and double
precision floating point; we added long integers and sets. An array of
operator and function support is also included.
- Long integers provide speed and
compactness for use with wide-range integer parameters (i.e. axis
position).
- "Set variables" are 32-bit
variables for dealing with "groups of items", and their
primary use in MotionBASIC® is to define "groups of axes"
for multi-axis operations.
- MotionBASIC® includes IEEE standard
single and double precision floating point. If required, real-time
floating point math performance rivaling that of integers and longs is
provided by an integral math co-processor.
- A rich set of arithmetic, trigonometric,
relational and logical operators work with multiple variable types.
- More than 50 functions are provided to
support arithmetic, string, conversion, I/O and system operations.
- Many competitive products provide only
fixed point numeric variables and extremely limited capabilities with
respect to functions and operators in their "languages".
Programming
- Block programming structures including
WHILE ... WEND & multi-line IF ... THEN ... ELSEIF ... ELSE ...
ENDIF simplify development and minimize programming errors.
- Symbolic program labels both speed
program execution and enhance the development environment by
eliminating program references to line numbers.
- Hardware interrupt processing using the
ON EVENT GOSUB statement provided for the 16 integral discrete I/O.
- PC Card standard memory cards are
supported by BASIC compatible disk commands and file operations.
Operator I/O
- Device drivers redirect screen-oriented
program I/O to alternate consoles such as a flatpanel touchscreen
Error Handling and Safety Interlocks
- MotionBASIC® offers built-in, run-time
error handling to protect user programs ... always maintaining safe
motion controller operation.
- Extensive error checking fully
integrates built-in hardware features such as "Emergency
Stop", "Drive Fault", "Encoder Wire Open",
"No Fault" and "Watchdog Timers" with the
MotionBASIC® error handling facility.
The Motion in MotionBASIC®
For simplicity, a minimum number of statements are required to specify
and initiate motion in MotionBASIC®. The English-like syntax and a rich
complement of options insure that these statements have sufficient
flexibility to allow you to easily create single or multi-axis motion
which meets your application’s objectives.
User Units
All MotionBASIC® parameters are expressed in the units of your choice
... degrees, inches, millimeters, RPM, msec, etc., making your BASIC
program easy to understand. For example: MOVE FOR 90 (degrees) IN 30
(msec). User units are exact because they are always converted to the
units of the individual position transducers using a ratio of integers.
MOVE statement
The MOVE statement provides a powerful way to command motion for one
or more servomotors. It can be used to MOVE AT a specified speed, MOVE FOR
a desired distance or MOVE TO an absolute position. Acceleration and
deceleration can be specified independently as a function of time,
distance, or directly as rates.
The MOVE statement can be used to
simultaneously MOVE multiple axes AT independent speeds, FOR independent
distances or TO independent positions.
MotionBASIC® supports S-curve acceleration
profiles for MOVE statements. Shape is adjusted by specifying the
percentage of the acceleration and deceleration zones which should use
S-curve.
S-curve is functionally derived &
updated at each position loop update (3,000 to 5,000 times per second). It
automatically maintains the S-curve shape for all motions independent of
the specified distances, speeds & accelerations.
Flexibility of MotionBASIC®
Motion Statements

Conditional Moves
All motion commands can include an input condition for the purpose
of holding off the execution or interrupting the progress of a motion.
Combining an ‘Until’, ‘After’, or ‘Stop’ conditions together
with a high speed ServoWire drive I/O on the end of a MotionBASIC®
statement provides a high degree of flexibility and control over all
motion commands.
Superimposed Moves
Superimposition is the process of combining a motion command to an
axis that is already being driven by another source through the GEAR
command. The command is added to the motion based on time or distance
traveled by the source axis.

Repeat Moves
The REPEAT prefix added to any motion command will allow the
command to stay in the command queue and repeat its execution.
MotionBASIC® allows multiple motion commands to be added to the queue to
form a loop that will repeat for as many times as needed. Execution within
the repeat loop can be controlled with the input conditions.

Blended Moves
Blended moves provide a method
to construct motion profiles that allow both speed changes and/or changes
to final position targets while the motion command is executing. With
blended moves, multiple axes can be time-synchronized to reach multiple
target points forming a complex continuous path in multi-dimensional
space.

Click here to
view/print/download an Acrobat PDF of this document (102k).
|