Robot Primer 5: Motion Controllers
In this post, I take a quick look at how some common automation controllers handle motion.Â All of the controllers easily control pneumatics using digital I/O.
Traditional Ladder Logic (PLC and many PACs).
Iâ€™m grouping PLCs and PACâ€™s together because they are often quite similar (the definition of a PAC is nebulous; many PACâ€™s are simply PLCâ€™s based on x86 CPUs, but are still running ladder logic).
PLCs can easily handle pneumatics, although handling event sequences in ladder logic isnâ€™t as straightforward as it is in programming languages such as BASIC, C, or C#.
Even many low end PLCs such as the Panasonic FP0R and Siemens S7-1200 support motion control via step and direction outputs, which can control stepper drivers or servo drives that accept step and direction. More capable motion control is available through dedicated modules, such as Panasonicâ€™s FPG-PP11 module.
The PLCOpen TC2 Standard makes PLC motion control much better by adding a large number of standard motion control function blocks.
PLC motion programming varies.Â For example:
- The Panasonic FPG-PP approach requires setting up a block of memory with all the desired values, then copying it to a special memory location to start the operation.
- The PLCOpen approach is simpler: just set the values of the function block.
Simple Serial Controller
Simple serial or USB controllers are quite common; examples include Schneider (IMS) MDrive integrated stepper motors, Moog Animatics SmartMotors,Â AllMotion stepper and servo drives, and many others. These controllers are OK for simple tasks, but are quite limited in their capabilities (the best youâ€™ll find is simple coordinated motion, gearing, and camming). Although the hardware is often cute, they are almost always a pain to program.
Here is an example AllMotion program that homes or steps through a sequence of 4 positions, based on the state of two inputs:
/1s0n2f1J1V150000L10000Z150000A5000V20000Z10000A10000z0J0H12gS12e0S11e1GR /1s1J1V5000000A18000J0H11gS12e0S11e2GR /1s2J1V5000000A36000J0H11gS12e0S11e3GR /1s3J1V5000000A18000J0H11gS12e0S11e4GR /1s4J1V5000000A0J0H11gS12e0S11e1GR
By the way, this protocol is common is certain industries and is used by many companies besides Allmotion.
A fieldbus drive is a servo amplifier or stepper drive integrated with a motion controller and a fieldbus interface.Â Sometimes the fieldbus drive is integrated onto the motor.Â There are way too many vendors to list; a short list would include AMC, Copley Controls, and Elmo Motion Controls.
Standard real time fieldbuses such as CANOpen, EtherCAT, and Ethernet PowerLink support standard motion profiles including torque control, velocity control, homing, profile moves, and PVT (position-velocity-time) moves.
Using the raw motion profile is a bit tedious; moves are set up by writing to the appropriate object’s object dictionary, and you have to deal directly with the protocol (CANOpen, etc).Â Copley Controls provides an easier to use interface for C/C++ (CML) or COM (older versions) or .NET (current version) with their CMO library.Â I’m surprised that very few other vendors provide comparable software.
Just sending commands to drives works fine if you’re doing basic motion.Â For more complex motions, you can either buy a hardware motion controller that uses fieldbus drives (from Parker, ACS, and others), buy a soft controller (from ACS or others) or write your own motion control software.
Here is a sample Python script that performs an absolute move using Copley CMO V2.18:
from win32com.client import Dispatch cmo = Dispatch('CMLCOM.CANOpenObj') cmo.BitRate = 500000 cmo.PortName = 'kvaser0' cmo.Initialize() drive = Dispatch('CMLCOM.AmpObj') drive.Initialize(cmo, 9) profile = drive.ProfileSettings profile.ProfileVel = 20000 profile.ProfileAccel = 100000 profile.ProfileDecel = 100000 drive.ProfileSettings = profile drive.MoveAbs(100000)
Motion controllers can be software only, plug-in cards (ISA, PCI, PCIe, VME, etc), or stand-alone (serial, Ethernet, USB, Firewire, etc).
Typical motion control capabilities include coordinated motion, interpolated motion, camming, gearing, and triggers.Â Motion inputs include dedicated axis inputs such as limit sensors and encoder inputs (one or two per axis; two allows for separate position (e.g. linear encoder) and velocity (e.g. rotary encoder) feedback).Â Motion outputs include servo command (normally +/- 10V analog) and/or stepper command (step and direction) and/or digital fieldbus.Â Most controllers also have some general purpose I/O.
Programming methods vary; the four main approaches are the simple command approach (used by Galil and many others; they call it “simple and intuitive”, which might be true if you’re only doing motion), using a BASIC variant (Aerotech, Baldor, and many others), ladder logic (especially IEC-61131 and PLCOpen) or use a PC programming language (so the controller provides a library; this approach was popularized by MEI).Â Also, many controllers will can use either the PC library approach or their proprietary language.
The boundaries can blur a bit; when is a controller running ladder logic a PLC or a motion controller?Â I’d say when it’s intended for general use (for example a Panasonic FP0R), it’s a PLC, and when it’s intended for motion control with special motion control features (such as a Schneider Lexium Motion Controller), it’s a motion controller.Â If it’s intended for both, maybe it’s a PAC (such as the Omron NJ series).
Here’s some sample Galil code showing setting up and moving 3-axes:
SP 20000,20000,50000 AC 100000,200000,500000 DC 100000,200000,500000 PA 50000,100000,-25000 BG AM
The typical motion controller fails when it comes to dealing with the motion on linked axes.Â I know a company that had a prototype SCARA robot, using a MEI controller, that was never sold because programming it would have been too difficult — if you wanted to move the end effector to point XYZT you had to figure out the correct positions for each of the axes.
What you need for robots and other machines with mechanically linked mechanisms is inverse kinematics, which means determining how to move the mechanically connected mechanisms to get the end of the mechanisms where you want it to go.
In the past, pretty much only the dedicated robot controllers supported kinematics and inverse kinematics.Â Now, I’m happy to say, it’s a lot more common (my Robot Resources page has some links), especially in controllers targeted for packaging automation.
The PLCOpen standard has optional blocks for coordinated motion that includes standard blocks for kinematic transformations.Â These transformations have to be supplied by the vendor, so if a PLCOpen motion controller doesn’t support it, you can’t add it.Â Still, this is a big step forward.
I took a quick glance at the PLCOpen standard and a couple of kinematic controllers; my impression is that they still do not yet replicate the capabilities of a dedicated robot controller.
From what I’ve seen, robot controllers still have the best motion capabilities but they may not be best in terms of communications, integration, or programming power.
Many robot controllers use languages based on either BASIC or VAL; for example, Denso uses a BASIC variant and Adept’s V+ is a VAL variant.Â The robot vendors have been adding more options, too, such as:
- PLC-based control such as Adept’s ePLC and Denso’s b-CAP.
- Higher level overlays and program generators such as Adept’s AIM and ACE.
- PC-based control such as Denso’s ORiN2 and LabView For Industrial Robots (currently supports Denso robots)
Robots almost always use brushless servo motors.Â Often, the controllers can also control a few extra servo motors, but not stepper motors.Â The controllers normally have some built-in digital I/O.
To kind of tie everything together, here’s a summary by motion technology:
- Pneumatics are easily controlled by all controllers.
- Stepper motors can be controlled by some PLCs, all simple serial stepper controllers, all fieldbus stepper drives,Â and most motion controllers.
- Servo motors can be controlled by some PLCs, all simple serial servo controllers, all fieldbus servo drives, most motion controllers, and most robot controllers.
- Robots can be easily controlled by kinematic-capable motion controllers and dedicated robot controllers.