Hello Guest it is March 28, 2024, 07:24:56 PM

Author Topic: Racking Detection with Encoders  (Read 7765 times)

0 Members and 1 Guest are viewing this topic.

Racking Detection with Encoders
« on: April 21, 2009, 02:15:24 PM »
On the CNC I am building I have a two motor y-axis moving a gantry. The motors will be slaved in Mach. I want to keep from racking the gantry if one motor stalls. I would like to install an encoder on each motor. I realize Mach does not support closed loop, but is it possible to have Mach detect when one encoder count is different from the other by more than a predefined number of counts and then have Mach issue an e-stop? If so, how?

Thanks in advance,
Kent

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Racking Detection with Encoders
« Reply #1 on: April 21, 2009, 02:44:37 PM »
You could do that by putting the encoders into Mach and write a macropump to compare, it would probably have to be low count encoders for best results. I am not great with VB so dont ask me how to write the macropump ;)
Hood

BClemens

*
Re: Racking Detection with Encoders
« Reply #2 on: April 21, 2009, 03:53:24 PM »
How about feeding back the slaved servo encoder signal to a missing pulse detector or a phase locked loop. When the slave servo motor stopped or slowed down and the pulses no longer were in phase, the circuit would E-stop the master signal from Mach 3 to the driver servo motor. That would be exclusive of Mach 3 but would ultimately control the estop. That shouldn't be too tough to come up with on a small circuit board or pref board pin to pin. Possibly use the master encoder signal to sync the driver and the PLL, and the slaved encoder signal to initiate an estop through the PLL as the detected sync frequency. The LM 566 is a dedicated phase locked loop chip that can be configured for various pulse frequency spans with discreet components and outputs a fault signal when the phases are out of sync.

Or as Hood is saying - a macropump. There are a couple of guys here that know that stuff!

Bill C.

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Racking Detection with Encoders
« Reply #3 on: April 21, 2009, 03:56:50 PM »
Bill
 would it be possible to set an error value before it sent out a trip signal? If so then that would be a good solution as you could even put the signal into Input 1 in Mach and Mach would fault.
Hood
Re: Racking Detection with Encoders
« Reply #4 on: April 21, 2009, 04:10:25 PM »
How about feeding back the slaved servo encoder signal to a missing pulse detector or a phase locked loop. When the slave servo motor stopped or slowed down and the pulses no longer were in phase, the circuit would E-stop the master signal from Mach 3 to the driver servo motor. That would be exclusive of Mach 3 but would ultimately control the estop. That shouldn't be too tough to come up with on a small circuit board or pref board pin to pin. Possibly use the master encoder signal to sync the driver and the PLL, and the slaved encoder signal to initiate an estop through the PLL as the detected sync frequency. The LM 566 is a dedicated phase locked loop chip that can be configured for various pulse frequency spans with discreet components and outputs a fault signal when the phases are out of sync.

Or as Hood is saying - a macropump. There are a couple of guys here that know that stuff!

Bill C.

I thought of designing a simple counter circuit for each encoder that could be reset at the start of a run and then have a digital comparator generate an e-stop if the counts differ by a given amount. I have not started using Mach yet as I am stilll in the process of building the machine. I do not know what signal would be used to signify the "start of a run", but I assume there is something available. Worst case would be to reset on power up. However, I'd really prefer to do this in Mach and not have to add another circuit to the mix.

BClemens

*
Re: Racking Detection with Encoders
« Reply #5 on: April 21, 2009, 04:16:23 PM »
I would have to brush up on configuring the LM 566 but I believe the best way would be - if not one for one at any speed, the system would fault and output a signal. That-is: if the signals were not identical, the PLL would fault since in this application both servo motors must be totally in phase with each-other.

 But, I'll have a look at the 566 chip data sheet.

Bill C.

BClemens

*
Re: Racking Detection with Encoders
« Reply #6 on: April 21, 2009, 04:23:04 PM »
How about feeding back the slaved servo encoder signal to a missing pulse detector or a phase locked loop. When the slave servo motor stopped or slowed down and the pulses no longer were in phase, the circuit would E-stop the master signal from Mach 3 to the driver servo motor. That would be exclusive of Mach 3 but would ultimately control the estop. That shouldn't be too tough to come up with on a small circuit board or pref board pin to pin. Possibly use the master encoder signal to sync the driver and the PLL, and the slaved encoder signal to initiate an estop through the PLL as the detected sync frequency. The LM 566 is a dedicated phase locked loop chip that can be configured for various pulse frequency spans with discreet components and outputs a fault signal when the phases are out of sync.

Or as Hood is saying - a macropump. There are a couple of guys here that know that stuff!

Bill C.

I thought of designing a simple counter circuit for each encoder that could be reset at the start of a run and then have a digital comparator generate an e-stop if the counts differ by a given amount. I have not started using Mach yet as I am stilll in the process of building the machine. I do not know what signal would be used to signify the "start of a run", but I assume there is something available. Worst case would be to reset on power up. However, I'd really prefer to do this in Mach and not have to add another circuit to the mix.

I agree with you: less circuitry = less problems. I was thinking more toward an analog circuit so that there would be no start or stop signal to contend with but digital is very much do-able as well. But -  the macropump program within Mach 3 is probably the much more sensible way to go....

Bill C.
Re: Racking Detection with Encoders
« Reply #7 on: April 21, 2009, 04:29:54 PM »
I'm not sure that the LM556 is a good choice, it work with resistor and capacitor which will vary with change of temperature and other factor. It will produce a pulse but not always at the desired rate.

If you want precision, you should got with crystal base generator or directly with the output of a parallel output.

BClemens

*
Re: Racking Detection with Encoders
« Reply #8 on: April 21, 2009, 07:10:19 PM »
Wrong chip? Analog will never do today anyhow! Let's program a computer to do the job...makes sense to me. Even PIC chips will soon be old fashioned! But joy is being able to compare analog which I grew up with to digital which I learned as it developed. I enjoy both. Now everything is digital....probably a good thing!

Just placing stumbling blocks of thought in here....

Thanks,
Bill C.
Re: Racking Detection with Encoders
« Reply #9 on: April 21, 2009, 10:11:20 PM »
Where can I learn about a macropump and the macro language? Sorry for asking such a newb question. I would really appreciate it if someone could post a snipit of code that is a starting point for this problem, such as reading an encoder input, and then describe, or point me to documentation, regarding installing it as a macropump. I'd much prefer this route, assuming it is feasible, as opposed to developing a circuit to do this.