Hello Guest it is March 28, 2024, 12:09:15 PM

Author Topic: How can I control ac servo motors using mach3? help!!  (Read 15959 times)

0 Members and 2 Guests are viewing this topic.

How can I control ac servo motors using mach3? help!!
« on: September 22, 2017, 05:06:19 AM »
Hello my friends
I want to control the delta ac servo motors on my cnc using mach3.
Is it possible too have closed loop control?I mean I wanna have position feedback....
What should I do?
help me please :-[
Re: How can I control ac servo motors using mach3? help!!
« Reply #1 on: September 22, 2017, 05:34:10 AM »
Hi,
yes servos can be controlled with Mach. Mach and its motion controller produce step/dir signals which are hooked to the Delta servo drive.
The drive and the servo form a feedback loop. Excepting fault conditions the servo will match Machs programmed position within fractions of
a degree over a wide range of speed/acceleration profiles.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: How can I control ac servo motors using mach3? help!!
« Reply #2 on: September 22, 2017, 05:40:40 AM »
Hi Craig
what is the motion controller of mach3 that you pointed??This is my problem!!
Re: How can I control ac servo motors using mach3? help!!
« Reply #3 on: September 22, 2017, 06:08:03 AM »
Hi,
Mach is a program that interprets Gcode and plans a trajectory. The trajectory is a sequence of numbers that describe a position and velocity over time,
called PVT for short.

A motion controller has a table of all the PVT data and its job is to calculate the pulses necessary to make the motors follow the PVT data.

In the early days this task was done right on the PC by its own CPU. X86 CPUs are not especially good at generating pulse streams, they don't have
sophisticated hardware timers like industrial controllers and FPGAs. Also the CPU has to make these really accurately timed pulses AND run Windows,
Mach and all of the other stuff. Machs Pulse Engine or Port Driver almost had to shoulder Windows out of the way to do it. It was a very clever piece of
code and is still used by lots of people and called the 'parallel port'. It does use the old style printer port that's true but the real smart stuff is the code that
generates the pulse streams. The parallel port is an example of a motion controller, ie 'a device that can generate accurate pulse streams'.

The original parallel port is not without its problems, its fairly slow, its timing is subject to some jitter, it can stop altogether if some other software is running
that competes with it and it can ONLY be run on 32bit operating systems. For this reason a number of companies have made external motion controllers
which use an FPGA or DSP ICs to generate pulse streams. They tend to be faster and more accurate. They are now pretty well known and work really well
on 32 and 64 bit systems but of course you have to buy one, the cheapest are about $100 and the dearest can be up to $2000. Plenty of good ones for
around $200.

The combination of Mach and a motion controller, whether the controller is part of the PC or a separate board hooked up by USB or Ethernet, produce
step and direction pulses to the motor drivers. The motors can be steppers or if you can afford them AC servos, as far as Mach goes it doesn't care which.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: How can I control ac servo motors using mach3? help!!
« Reply #4 on: September 22, 2017, 09:21:46 AM »
Thank you very much Craig...
you described it so nice from A to Z and I realy appreciate it!
Re: How can I control ac servo motors using mach3? help!!
« Reply #5 on: December 14, 2017, 01:42:40 AM »
Hi,
Mach is a program that interprets Gcode and plans a trajectory. The trajectory is a sequence of numbers that describe a position and velocity over time,
called PVT for short.

hello Craig
I have one more question..
using my pc as the motion controller,can I have closed loop control on my servo motors?
Re: How can I control ac servo motors using mach3? help!!
« Reply #6 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
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: How can I control ac servo motors using mach3? help!!
« Reply #7 on: December 14, 2017, 03:14:12 AM »
You know Craig,your the best teacher in these cases....thank you very very very much my friend!!!
thanks god that we have you!!!