Need help with machine circuit design

Thread Starter

Machine Doctor 13

Joined Jul 13, 2019
11
I'm attempting to replace an old stepper relay with a digital circuit. The stepper relay was being used to provide feedback to a machine tool CNC control as to which number tool was currently being used. There are 8 tools on this machine and the tools are mounted on an 8- sided turret. If Tool # 3 is finished with it's operation and the part program calls for Tool # 6 to be used next the turret will rotate three stations from #3 to # 6 and the CNC control will send three + 24 V pulses to the stepper relay to advance three steps. The output of the stepper relay provides feedback to the CNC that # 6 Tool is now ready for use.

The circuit I have attached is pretty basic and I'm asking for advise as to how to make it work. The tool turret is unidirectional, only goes in ascending order. The output of the UDN2981 has to remember what tool number was high when power to the CNC control is removed and then restored. The outputs from the UDN2981 have to be + 24 V. I plan to use the + 24 V pulse that is used to advance the stepper relay coil as the clock signal to the 4022. Also, I will tie the Clock Inhibit and Reset signals on the 4022 low.

I will greatly appreciate any helpful advice. Please see the attachment for the circuit. Thanks
 

Attachments

dendad

Joined Feb 20, 2016
4,481
How does the machine know what tool is selected? is there any sensing on the turret? Some sort of encoder on the turret, even black and white paint marks that can be read optically may help.
Have you thought of using a micro, even an Arduino to monitor it?
Your counter system will be very prone to noise pulses giving errors. And it will not remember the position with no power. That is why you need to actually be able to read the position.
 

Thread Starter

Machine Doctor 13

Joined Jul 13, 2019
11
How does the machine know what tool is selected? is there any sensing on the turret? Some sort of encoder on the turret, even black and white paint marks that can be read optically may help.
Have you thought of using a micro, even an Arduino to monitor it?
Your counter system will be very prone to noise pulses giving errors. And it will not remember the position with no power. That is why you need to actually be able to read the position.
There is no good place for an encoder on the turret unfortunately. I've heard of an Arduino but am not familiar with it. Will look into it.
Thanks for the advice.
 

dendad

Joined Feb 20, 2016
4,481
Google "ASKmanual.pdf" for a good introduction. It is a bit old but not a bad book.
There are many Arduino CNC posts on the net. You may be able to get some info there.
A sensor to detect a bolt head for home, and each position may work. It all depends on your machine.
 

BobaMosfet

Joined Jul 1, 2009
2,113
I think it would be useful to know more about the tool part, etc. Surely it has or can have some kind of encoding added- there are very creative ways to do this. So that when you turn the machine on, it will automatically rotated the tool holder to find zero, find the missing tool (if any) and know that is the one 'in' the machine, or simply rotate to position 1 and await further instructions.

The UDN2981A is a negative logic transistor array. Meaning that it's output is an inversion of your input. You also need resistor between the 4022 and the UDN2981A in order to limit input current into the transistor array, probably 2-5mA would be sufficient to deal with any noise. I would definitely breadboard a test circuit with this beforehand to be sure the outputs are at the appropriate current and voltages you're wanting. The UDN2981A references output as up to -500mA....

A ULN2803A might be an alternative, although it is also negative logic.
 
You could use FRAM memory, e.g. https://learn.adafruit.com/adafruit-i2c-fram-breakout to memorize the position. It would keep the present position when power is removed.

Arduino might not be a bad platform.

Siemens LOGO PLC https://w3.siemens.com/mcms/program...ogo/modular-basic-variants/pages/default.aspx has variables that can be made nonvolatile.

I know you don't want to go this route, but mechanically, I built:

1) A 24 position filter wheel using a bi-directional rotary solenoid. Position feed back was a rotary switch used as a voltage divider. Kinda klutzy.

2) A 4 position filter wheel using a synchronous motor. Notches along the edge of the wheel that used a microswitch as the stop. I monitored "Moving" and I had a way of bypassing the microswitch in software so it would go to the next position.

I did position monitoring with two hall effect sensors and screw in magnets. Pos 00, 01, 10, 11
 

Thread Starter

Machine Doctor 13

Joined Jul 13, 2019
11
I think it would be useful to know more about the tool part, etc. Surely it has or can have some kind of encoding added- there are very creative ways to do this. So that when you turn the machine on, it will automatically rotated the tool holder to find zero, find the missing tool (if any) and know that is the one 'in' the machine, or simply rotate to position 1 and await further instructions.

The UDN2981A is a negative logic transistor array. Meaning that it's output is an inversion of your input. You also need resistor between the 4022 and the UDN2981A in order to limit input current into the transistor array, probably 2-5mA would be sufficient to deal with any noise. I would definitely breadboard a test circuit with this beforehand to be sure the outputs are at the appropriate current and voltages you're wanting. The UDN2981A references output as up to -500mA....

Actually The output from the 4022 that is connected to the input of the 2981A is + 15 VDC, and the output from the 2981A is also + 15VDC. So there is no inversion.
A ULN2803A might be an alternative, although it is also negative logic.
I constructed the attached circuit on a breadboard. Actually the output from the 4022 that is then input to the 2981A is + 15 VDC, and the corresponding output from the 2981A is also + 15 VDC. So there is no inversion.
However, I need to convert the + 15 VDC from the 2981A to + 24 VDC for the CNC control board. Any ideas would be appreciated.
 

Attachments

Last edited by a moderator:

Thread Starter

Machine Doctor 13

Joined Jul 13, 2019
11
I installed the attached circuit on the old Mazak turret lathe and it works 80% of the time. Here is the sequence:

1. The machine has a relay shown on page 1 bottom left labeled INDF which sends a +24 V signal to a voltage divider to produce a 12V clock pulse every time a tool change is called for. There are 8 tools on a turret.

2. Every time there is a clock pulse the 4022 outputs sequentially go high to + 5V from 0 to 7 for the tool being selected.

3. The corresponding outputs from the 2981 go high to + 24V and turn on the relay for that particular tool.

4. The output from the relay that is energized goes to the machine CNC control and is displayed on the operator monitor as the tool number that is currently active. That is the sole purpose of this circuit. To provide feedback to the operator as to what tool is currently

The circuit works fine 80% of the time, but occasionally when the clock signal goes from + 24V to 0V it acts like another clock pulse. So if you are using tool 2 and wish to go to tool 3 instead the relay for tool 4 turns on and the operator display shows tool 4 is active even though on the machine tool 3 is active. The ascending slope of the clock pulse is working good but sometimes the descending pulse is triggering the 4022 again.

To verify that this is what is occurring I installed a push button to simulate a clock pulse (shown lower right pg. 1). If I hold the push button in for 10 seconds or so the next relay led turns on as expected, but occasionally when I release the push button the next relay led lights up. So I know it is activated by the descending slope of the clock pulse.

What I am wondering about is the fact that the 4022 is using a + 5VDC power supply with VSS (pin 8) connected to the negative terminal of the power supply, not ground, whereas the 2981 is connected to GND for pin 10. Is this a problem? If not, any ideas on why there is an occasional extra clock pulse?
 

Attachments

LesJones

Joined Jan 8, 2017
4,191
Probably the best solution would be to use the positive going edge of the attenuated 24 volts pulse to trigger a monostable such as a CD4047 and set it to produce a pulse just a bit longer than the pulse from the machine. That way it's output would still be high when the pulse from the machine went low. Even if there was contact bounce on that edge it would be ignored by the monostable. The output from the monostable would be used to clock the CD4022. You may be able to get a quick fix by connecting a capacitor in parallel with the bottom 100K resistor of the potential divider. I have no idea how long the pulses are from the machine so selecting the capacitor value would be trial and error. I would suggest starting with 10 nF (0.01 uF) If that doesn't work try about double for each increment. (So 22 nF, 47nF, 100nF and so on.)

Les.
 

Thread Starter

Machine Doctor 13

Joined Jul 13, 2019
11
Probably the best solution would be to use the positive going edge of the attenuated 24 volts pulse to trigger a monostable such as a CD4047 and set it to produce a pulse just a bit longer than the pulse from the machine. That way it's output would still be high when the pulse from the machine went low. Even if there was contact bounce on that edge it would be ignored by the monostable. The output from the monostable would be used to clock the CD4022. You may be able to get a quick fix by connecting a capacitor in parallel with the bottom 100K resistor of the potential divider. I have no idea how long the pulses are from the machine so selecting the capacitor value would be trial and error. I would suggest starting with 10 nF (0.01 uF) If that doesn't work try about double for each increment. (So 22 nF, 47nF, 100nF and so on.)

Les.
Thanks very much for these tips. Very much appreciated.
 

Thread Starter

Machine Doctor 13

Joined Jul 13, 2019
11
I put a .01uf capacitor from the junction of the two resistors to ground. Also, I replaced the 100k resistor connected to ground with a 67k resistor reducing the clock pulse from 12V to 6V. And finally, I connected the 5V power supply neg. terminal to ground.

The end result is that the machine ran an entire 8 hour shift without fail. I want to thank you for your help. Couldn't have done it without you.
 

jayanthd

Joined Jul 4, 2015
945
Why is there a relay board? To drive the stepper motor(s)?

What is the current rating of the stepper motor(s)?

What microcontroller is driving the CD4022?

Which is your Mazak control board here?

https://www.mazakusa.com/machines/technology/cnc-controls/

If you are using the relay board to drive the stepper motor windings then does that mean your stepper motor winding (each) need more than 500mA?

If not then why not drive the stepper motor windings from the UDN chip?

Relay switching time will be near 10ms.

How do you overcome this relay switching delay?
 

Attachments

Last edited:
Top