View Full Version : Closed loop control with linear encoders


Xerxes
04-01-2005, 04:23 PM
Hi!

Is it possible to get a real closed loop positioning with EMC using linear encoders? If yes, how?

How well this type of control works if there is any backlash in screws?

Thanks :)

Al_The_Man
04-13-2005, 01:21 PM
Check the video out called Dual Loop Compensation
http://www.galilmc.com/training/webconf.html
Al

mmjpotter
04-13-2005, 05:40 PM
EMC? what is it?
I use Linear Encoders to close the servo loop because they do eliminate backlash, and so do many CNC retrofits. However my system is running under DOS on a PC104 card. Should I be converting to EMC?

Xerxes
04-14-2005, 12:37 PM
Thank you, Al_The_Man :)

The dual loop method is much like I believed it to be. But is it possible with EMC? Anybody seen configuration files?

mmjpotter: EMC is yet another CNC control software.

ESjaavik
04-16-2005, 03:35 AM
EMC? what is it?
I use Linear Encoders to close the servo loop because they do eliminate backlash, and so do many CNC retrofits.

There should not be any backlash between the encoder and the motor.

A linear encoder cannot eliminate backlash, it can compensate for it. But then the encoder used by the servo drive (the servo loop) must be on the motor (backlash free), and the linear encoder is there just to tell the controller how much backlash there is, so it can compensate for it. But what software do you have that can do this? In EMC there is backlash compensation, but it is just in a setup table, not dynamically.

mmjpotter
04-17-2005, 09:29 AM
Hi ESjaavik

If an encoder is being used to control the speed of the motor, then I agree with you, it should be connected to the rear shaft of the motor with zero backlash. I use a tacho for this purpose. I use linear encoders for positional feedback. I will try to explain how my system uses these signals. I have a free running DC motor with a tacho driving a cold rolled ballscrew (40 microns backlash approx) via a timing belt and pulleys. The linear encoder is attached to the slide, thus maintaining accurate positioning of the slide. When the slide is in position, a zero voltage is applied the motor because no rotation is required. If the slide is physically moved out of position by 1 encoder pulse (0.01mm) the system will produce an error signal and a proportional voltage will be sent to the motor to initiate rotation in the direction to correct the error. The initial motor speed will be very slow and with little power, enough power to remove any free backlash but not enough to pull the slide. If the error persists the system will increase motor speed and power until there is sufficient power to correct the error but not to much power to overshoot and cause oscillation. The motors on any axis with backlash are continuously hunting for position but this is under controlled and stable conditions and is not detrimental to the machine’s mechanics or electronics, it is NOT unstable violent motor oscillation.

This system does require a real time operating system and I decided to develop my software for DOS, but I believe that EMC has real time capabilities and I would be very interested to here your comments and reasons for choosing Linux/EMC . My source code is in ‘C’ and the real time interrupt routine is 80x86 assembly code . I don’t know if these will compile for Linux.

ESjaavik
04-17-2005, 06:52 PM
If an encoder is being used to control the speed of the motor, then I agree with you, it should be connected to the rear shaft of the motor with zero backlash. I use a tacho for this purpose.

Usually the encoders are used as feedback both to the speed loop and the position loop. Since it seems you do your own driver software this may not be true. Are you using separate feedbacks?

The motors on any axis with backlash are continuously hunting for position but this is under controlled and stable conditions and is not detrimental to the machine’s mechanics or electronics, it is NOT unstable violent motor oscillation.
Is this because you set the PID parameters to "calm it down"? If so, does it not then gouge your part on pocketing square corners? (Sudden setpoint changes)
Or can you use feedforward to avoid it?

. My source code is in ‘C’ and the real time interrupt routine is 80x86 assembly code . I don’t know if these will compile for Linux.
Not without a lot of rewriting in the RT part. The principles seems quite similar to the old DOS way of "stealing interrupts" though. I don't have any experience in RTAI other than browsing docs and code. My RT experience is with OS9/68K.

But Linux have one big advantage over DOS, it's on the rise and not dying. So I try to forget DOS. And I prefer having my fingernails pulled over doing 80<whatever> assembly!

Anyway I suggest you look at EMC. The source is open if you want to do something odd. And if you made a system that can make parts using your own code, you might find it a nice environment to focus on what you do best and benefit from the work of others with a different background.

mmjpotter
04-18-2005, 05:54 AM
Thanks ESjaavik. Linux/EMC sounds like a good alternative RT system, but I still do not understand why backlash is a problem when using linear encoders.

I still think DOS has a future with the PC104 range of products.

As for my DOS system I don’t try to ‘calm down’ the PID loop but the parameters are set to maintain stability.
Inputs to the loop are two +/- 10 volt analogue signals, 1 from the motor tacho, the speed input ,and 1 from the computer, the position input.

Feedforward is not implemented but the system ‘looks ahead’ (to avoid SUDDEN setpoint changes) and the speed is adjusted depending on the angle of the next move. If the next move angle is 180 deg. then full speed is maintained, a 90 deg move requires the machine to ramp down to zero before implementing the next move thus avoiding any overshoot.

ESjaavik
04-19-2005, 10:26 AM
Thanks ESjaavik. Linux/EMC sounds like a good alternative RT system, but I still do not understand why backlash is a problem when using linear encoders.


It's because the torque requirement is very non-linear and the feedback is delayed. While running out the backlash the torque requirement is almost zero, then suddenly increasing when is has caught up. The feedback is none until the backlash is taken up. You have an unloaded motor in the backlash region. It has nothing to do with linear encoders, but the fact that the encoder "sits at the other side of the backlash".

If you have ever tried to drive a 50 year old bus with worn steering knuckles and spring shackles you can probably relate to what the servo drive has to cope with. I have tried it. Maybe that's why I could relate to it when I found it explained.

mmjpotter
04-20-2005, 05:16 AM
During a machining cycle the torque requirements can vary considerably due to changes in feed rates, depths of cut, material hardness, cutter speed etc. Surely the purpose of a servo system is to control these non-linear torque requirements. Running out a bit of backlash seems like a rather trivial task, and I agree that these torque requirements have nothing to do with encoders, linear or rotary.

Does anybody agree with the following:-

A: That linear encoders return actual slide movements regardless of backlash.

B: A DC servo can maintain a constant speed/torque under varying loads.

C: If the linear encoder is replaced by 2 micro-switches or limit switches, the motor will drive the slide to the limits regardless of backlash.

D: When a slide with backlash is driven by a stepper motor, 2000 pulses in one direction may not equate to the same distance for 2000 pulses in the opposite direction. If a linear encoder is fitted to the slide and the motor is driven by a CONTINUOUS train of pulses, then counting 2000 encoder pulses in any direction will equate to the same distance thus eliminating the backlash.

lerman
04-20-2005, 06:42 AM
During a machining cycle the torque requirements can vary considerably due to changes in feed rates, depths of cut, material hardness, cutter speed etc. Surely the purpose of a servo system is to control these non-linear torque requirements. Running out a bit of backlash seems like a rather trivial task, and I agree that these torque requirements have nothing to do with encoders, linear or rotary.

Does anybody agree with the following:-

A: That linear encoders return actual slide movements regardless of backlash. Assuming they are mounted on the slide -- YES.


B: A DC servo can maintain a constant speed/torque under varying loads. NO. -- They can maintain a more constant speed OR torque under varying loads. That's more constant than a system without feedback. The systems we are referring to do not measure the torque, so we're not really talking about maintaining a constant torque.

C: If the linear encoder is replaced by 2 micro-switches or limit switches, the motor will drive the slide to the limits regardless of backlash. One could design a system to do that.

D: When a slide with backlash is driven by a stepper motor, 2000 pulses in one direction may not equate to the same distance for 2000 pulses in the opposite direction. If a linear encoder is fitted to the slide and the motor is driven by a CONTINUOUS train of pulses, then counting 2000 encoder pulses in any direction will equate to the same distance thus eliminating the backlash. In response to the first sentence, it depends. If you mean that applying 2000 pulses in one direction, followed by 2000 pulses in the opposite direction, then, in general, the slide will not wind up in the same position. If one counts encoder pulses, the slide will wind up in the same position.

But you are using steppers in one case and servos in the other. If you move slowly enough that you have zero overshoot, you are correct. But you might not wind up with a useful system. It depends on your application.

Ken

CNCgr
05-26-2005, 05:37 PM
Can EMC use absolute encloders or only incremental?

ViperTX
05-26-2005, 05:45 PM
Depends on what you're using for drivers.

CNCgr
05-26-2005, 05:58 PM
What are the options? I don't have a clue about EMC

ViperTX
05-26-2005, 10:20 PM
Go to the EMC site....hmmmm...it was with NIST....but I believe it's linuxcnc.org/links.html ....anyway they have a list of drivers and axis cards they support.

pauldkeeton
10-14-2007, 02:04 PM
I would say only incremental...For absolute to work the encoder would have to report its position when the control is started. This is usually done by sending a "request to send" to a serial interface encoder. The encoder usually has a battery backup to read changes in position while the control is powered down. I have'nt seen many "A Quad B" encoders that are absolute. As a matter of fact, I have only seen one. It doesn't take that long to home each axis at the start of work......Absolute scales are really not worth the headaches......

Paul