5681
FAQs / Re: How can I control ac servo motors using mach3? help!!
« on: December 14, 2017, 02:41:20 AM »
Hi,
generally no, Mach is not a closed loop controller. Mach is a Gcode interpreter and a trajectory planner. It passes that trajectory to a motion controller
and the motion controller does the business with servo, steppers, valves, pumps and whatever.
Where a lot of confusion is generated is when you use Machs parallel port because the port and its software driver ARE a motion controller, a fairly modest
motion controller to be sure but it is still a motion controller. With this setup you have two components, Mach the interpreter/planner and the parallel port/driver
operating at the same time on the same PC. Most people get confused and wrongly believe that Mach is a motion controller.
Machs native output is step and direction. This could be applied to a stepper motor driver and the stepper will move in response to it. What most people don't like
is the thought that if the stepper misses a step the PC won't know and carry on if as if everything is OK when its not. In truth if you have decent steppers and
drivers APPROPRIATELY specified and used within their limitations steppers never miss steps unless you're being a dickhead.
Machs step and direction signals could also be applied to a servo and drive. The drive keeps a running tally of the steps in each direction it has been commanded
to go and so at any given time knows where it is supposed to be. The servo is equipped with an encoder and so the drive also knows where the servo is at.
If the servo is not where its supposed to be the drive applies a voltage necessary to drive the servo to where its supposed to be. If it overshoots it will reverse
itself and try to get back to where its supposed to be. This is in short a feedback loop, the command is the running total of the step/direction and the encoder
is the actual position and the error between the two is used to reduce the error. Note that Mach doesn't participate, it just issues commands it doesn't read the
encoder and doesn't act on it, the servo drive does. If the servo gets to far out from where its supposed to be the drive faults 'following error'. If you have a fairly
small error window then you could say the servo keeps perfect position, just like a good stepper, but if you ask it to do something beyond its capacity it will fault
and Mach will stop.
The vast majority of new servos are AC servos and the drive has a microcomputer inside to close the loop and they do a very very VERY good job of it. Old style
brushed DC servos require a controller to close the loop. Some controllers like the Kflop, Gallil and others read the servos encoder and compare that with its
commands given to it by Mach and it produces an analogue voltage which is amplified and applied to the servo. It constitutes a closed loop. The controllers
capable of such feats are rare and expensive, the servo amplifiers as rare a rocking horse s*********t, the servos and encoders expensive and hard to get and unless
your PID programming is really good the result can be pretty average.
Brushed servos are technology of yesteryear.....still capable of good results but are increasingly getting hard to get parts and info. If you have a machine with them
fitted already you may well consider worth the challenge to get them going but if buying new go AC servo.
The final bit is the answer to your question; Mach is not a closed loop controller but it plans trajectories for servos/drives which are closed loop, the net result is
closed loop control.
You may have noticed that in the latest release of the ESS plugin the spindle now has PID control, ie it is closed loop. Note that at this stage it has just one
(index) pulse per rev and is still a long long way behind the control available from an AC servo but still will be a boon to many who can't afford AC servos yet.
Even Mach itself can be induced to close the loop but its refresh rate is so slow that its not really useful for motor control, temperature control on the other hand
is quite a useful application of this programming trickery.
Craig
generally no, Mach is not a closed loop controller. Mach is a Gcode interpreter and a trajectory planner. It passes that trajectory to a motion controller
and the motion controller does the business with servo, steppers, valves, pumps and whatever.
Where a lot of confusion is generated is when you use Machs parallel port because the port and its software driver ARE a motion controller, a fairly modest
motion controller to be sure but it is still a motion controller. With this setup you have two components, Mach the interpreter/planner and the parallel port/driver
operating at the same time on the same PC. Most people get confused and wrongly believe that Mach is a motion controller.
Machs native output is step and direction. This could be applied to a stepper motor driver and the stepper will move in response to it. What most people don't like
is the thought that if the stepper misses a step the PC won't know and carry on if as if everything is OK when its not. In truth if you have decent steppers and
drivers APPROPRIATELY specified and used within their limitations steppers never miss steps unless you're being a dickhead.
Machs step and direction signals could also be applied to a servo and drive. The drive keeps a running tally of the steps in each direction it has been commanded
to go and so at any given time knows where it is supposed to be. The servo is equipped with an encoder and so the drive also knows where the servo is at.
If the servo is not where its supposed to be the drive applies a voltage necessary to drive the servo to where its supposed to be. If it overshoots it will reverse
itself and try to get back to where its supposed to be. This is in short a feedback loop, the command is the running total of the step/direction and the encoder
is the actual position and the error between the two is used to reduce the error. Note that Mach doesn't participate, it just issues commands it doesn't read the
encoder and doesn't act on it, the servo drive does. If the servo gets to far out from where its supposed to be the drive faults 'following error'. If you have a fairly
small error window then you could say the servo keeps perfect position, just like a good stepper, but if you ask it to do something beyond its capacity it will fault
and Mach will stop.
The vast majority of new servos are AC servos and the drive has a microcomputer inside to close the loop and they do a very very VERY good job of it. Old style
brushed DC servos require a controller to close the loop. Some controllers like the Kflop, Gallil and others read the servos encoder and compare that with its
commands given to it by Mach and it produces an analogue voltage which is amplified and applied to the servo. It constitutes a closed loop. The controllers
capable of such feats are rare and expensive, the servo amplifiers as rare a rocking horse s*********t, the servos and encoders expensive and hard to get and unless
your PID programming is really good the result can be pretty average.
Brushed servos are technology of yesteryear.....still capable of good results but are increasingly getting hard to get parts and info. If you have a machine with them
fitted already you may well consider worth the challenge to get them going but if buying new go AC servo.
The final bit is the answer to your question; Mach is not a closed loop controller but it plans trajectories for servos/drives which are closed loop, the net result is
closed loop control.
You may have noticed that in the latest release of the ESS plugin the spindle now has PID control, ie it is closed loop. Note that at this stage it has just one
(index) pulse per rev and is still a long long way behind the control available from an AC servo but still will be a boon to many who can't afford AC servos yet.
Even Mach itself can be induced to close the loop but its refresh rate is so slow that its not really useful for motor control, temperature control on the other hand
is quite a useful application of this programming trickery.
Craig