Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Counter is skipping in counting

Status
Not open for further replies.

Vonie

New Member
Hi,

I am designing a control circuit for a process procedure. Everything to date works fine and according to specifications.

The only problem I am facing at the moment is the issue of my counter (which is a pre-purchased from TexmateNZ in New Zealand) is skipping in counting every time a Limit switch is closed. The funny part is that the counter leads are not even connected to the Limit switch (NO/NC connections).

I am feeding a Telemecanique Limit switch with 230V AC 50HZ supply and wanting it to NOT count once it's closed or opened. The counting should be done through another switch which is in this case a pressure switch. When the pressure switch (Sensor) closes (Normally opened) then the counter counts 1 cycle PERFECT!!!. But when the limit switch #2 closes the counter skips in counting (problematic area)

I thank you in advance for taking a look at what I have to say. Any ideas or suggestions would be much appreciated.

Thanks
 
Can you post a schematic of how you have it hooked up. The URLs of the components would help, too.
 
Can you post a schematic of how you have it hooked up. The URLs of the components would help, too.


Thank you Mike for replying.

Okay so I have attached a drawing I did of how I have the test circuit connected. I hope it helps clarify a few things.

Let me try and explain a bit more in detail what I am trying to achieve with the design below.

I was instructed to control the pressure in a cylinder being tested for a pulsating test. At the moment the test rig consists of a electrical AC motor 412V with its own starter which runs a oil pump. The oil pumps pumps oil from the oil tank to a Low pressure cylinder and a high pressure cylinder. The pressure is then sent to a Test cylinder. Once the pressure in the cylinder reaches its desired value a pressure switch (sensor) then changes states and should turn the polarity of the solenoids that pass the oil to the pistons to reverse the direction of the oil back to the oil tank. I am using 2 solenoids that are of interest to me.

Verything WORKS a treat. The only problem is that When I connect the counter to the pressure sensor or the relay contact, so that the contact of the counter close and it reads a cycle (1 count per cycle) it starts skipping in counting when the limit switches are pressed. The counter leads as I drawed below are connected to the Pressure sensor and not the limit switches. I suspect this could be a bouncing issue in affect here but I don't know how to solve this particular issue.

URL of components used to date:

Relay: http://www.components.omron.com/components/web/pdflib.nsf/0/D8107CD58D8B96D185257201007DD580/$file/mk_0607.pdf

Limit switch: https://www.electro-tech-online.com/custompdfs/2010/03/77637.pdf

Counter (programmable): **broken link removed**
 

Attachments

  • Circuit2..doc
    41 KB · Views: 170
what i understand is some interference during other limit switch operation, or may be due to contactor operation connected to that. you can use a filter at the input. all depends on your counter.
 
This sounds like noise getting on to the power supply connection of your counter. Are there long leads somewhere that could be picking up the noise? Can you get to the power supply connections of your counter? A 100uF capacitor across the leads close to the equipment should help reduce the noise. If not, try transient suppressors across your contacts, or putting a metal screen between your contactors and your counter.
 
Thanks

Hi,

Thanks all for replying to my thread

I have attached below how I am connecting the circuit.

As mentioned in my previous post, everything up to the second limit switch works. It's when the second limit switch two is pressed (by the piston) that the counter starts counting upwards. This should not be happening as the limit switch is not connected to the counter leads.

I have a feeling this could be a debouncing problem and that voltage spike from the second limit switch is causing the counter to count upwards? I am not 100% sure though.

Below are a list of components that I am using

Relay: OMRON MK2PN-I
URL: http://www.components.omron.com/components/web/pdflib.nsf/0/D8107CD58D8B96D185257201007DD580/$file/mk_0607.pdf

Limit switch(s) (Both): Telemecanique ZCK J11H29
URL: https://www.electro-tech-online.com/custompdfs/2010/03/77637-1.pdf

Starter: Telemecanique LE1D12N7 (Changed the coil from 415V to 240VAC)
URL: **broken link removed**

Counter: TexmateNZ PRO-CTR100
URL: **broken link removed**

Once again I thank you in advance for your suggestions and help. One minor problem before I can start hooking this circuit to the rig and start testing the cylinders :D

Thanks
 

Attachments

  • Circuit2..pdf
    85 KB · Views: 578
Last edited:
This sounds like noise getting on to the power supply connection of your counter. Are there long leads somewhere that could be picking up the noise? Can you get to the power supply connections of your counter? A 100uF capacitor across the leads close to the equipment should help reduce the noise. If not, try transient suppressors across your contacts, or putting a metal screen between your contactors and your counter.

Hi Bill

The counter is enclosed, there is no way I can insert a capacitor in the power supply of counter. All I am doing to the counter is feeding it AC voltage from the mains (240VAC 50HZ supply).

The actual counter leads are two copper insulated wires connected to a contact of relay/timer/switch which closes and that will count upwards (in increments of 1). At the moment I have the leads connected to the pressure sensor to normally open. So that when the pressure has reached its value (desired pressure value) the pressure switches changes states to normally closed and therefore giving me a count of increments of 1. This bit works. It's the limit switch that is connected to a OMRON general purpose relay (MK2PN-I) that is giving me grief.

I appreciate your input in this matter.

Thanks
 
i see on the circuit you posted, you have connected the pressure switch to the counter input mean time its giving a path to relay too, try to make an auxiliary contact using a 24V relay so that the input of the counter is isolated from 24V supply terminal.(see the attached) i doubt the noise is from this way of connecting it.

Also about the capacitor, its not to the power supply, you have to connect it across the counter inputs(NO) as a filter, and with a parallel resistor.
 

Attachments

  • add relay.JPG
    add relay.JPG
    65.4 KB · Views: 168
Thanks

i see on the circuit you posted, you have connected the pressure switch to the counter input mean time its giving a path to relay too, try to make an auxiliary contact using a 24V relay so that the input of the counter is isolated from 24V supply terminal.(see the attached) i doubt the noise is from this way of connecting it.

Also about the capacitor, its not to the power supply, you have to connect it across the counter inputs(NO) as a filter, and with a parallel resistor.


Hi Mbarazeen

Thanks for your informative reply.

I'll give your idea a try today. Still unclear on the capacitor role in all of this, but I'll try and scratch my head and figure it out. The auxiliary contact makes sense. Not sure how it eluded me.

I'll test this idea and get back to you by the end of the day.

Thanks
 
Your relay coil is pins 2 & 10 for 24 VDC. Your problem is likely caused by as mentioned noise. You may want to think about placing a diode across your relay coil. Like a 1N4002 to snub the inductive kick when that relay coil opens.

Relay pin 10 Anode and Pin 2 Cathode of the diode.

As to the relay contacts you can snub with a 47 Ohm 1/2 watt resistor in series with a .1 uF cap. Note the cap and resistor are in series. This read should explain the snubber. I would start with the diode across the relay as I mentioned earlier.

Ron
 
Last edited:
i see on the circuit you posted, you have connected the pressure switch to the counter input mean time its giving a path to relay too, try to make an auxiliary contact using a 24V relay so that the input of the counter is isolated from 24V supply terminal.(see the attached) i doubt the noise is from this way of connecting it.

Also about the capacitor, its not to the power supply, you have to connect it across the counter inputs(NO) as a filter, and with a parallel resistor.

Hi Mbarazeen,

I just tried the design that you suggested using the Auxiliary relay contact. Unfortunately the counter is still incrementing at random every time the limit switches are pressed.

I was wondering is there way in calculating the capacitor filter size?

Thanks
 
Hi Mbarazeen,

I just tried the design that you suggested using the Auxiliary relay contact. Unfortunately the counter is still incrementing at random every time the limit switches are pressed.

I was wondering is there way in calculating the capacitor filter size?

Thanks

Have you tried clamping the relay coil as I suggested or read the link on how to use a snubbing RC network on relay contacts? If you have a scope at your disposal you may want to look at that relay coil when it opens or across those contacts.

Ron
 
Have you tried clamping the relay coil as I suggested or read the link on how to use a snubbing RC network on relay contacts? If you have a scope at your disposal you may want to look at that relay coil when it opens or across those contacts.

Ron

Hi Ron,

I will be going to purchase the Capacitor, Diode and resistor in bulk to try and do the method that u linked me. In terms of a scope I would have to arrange a visit to university for that. The company that I am doing this with are predominately a mechanical firm.

Thanks Ron, will let you know the outcome in about hour or two. Thanks again for an informative reply, I appreciate your time and effort.

Thanks
 
Have you tried clamping the relay coil as I suggested or read the link on how to use a snubbing RC network on relay contacts? If you have a scope at your disposal you may want to look at that relay coil when it opens or across those contacts.

Ron

Hi Ron,

Well, what can I say!!!

The snubber method didn't work, the Diode clamping method didn't work. Nothing I tried rectified the problem. I can say however it reduces the number of times the counter is actually incrementing randomly, and the number of random increments itself. Example: without the clamping method on the relay coil and the snubber RC circuit, I was getting a random increments every 2nd switch on of the Limit/switch with increments of 5/12/30 random numbers (Just purely random sequence). Now that I tried connected the Clamping and RC circuits on the relay in question as you and Mbarazeen suggested, it started incrementing the counter every 5/6 limit/switch on at a increment value of 1 each time (slight improvement, but still no cigar).

I have given up using the Limit/switches and have taken a different approach using magnetic switches. With those it seems to be working after an hour of On/Off action using a magnet (Tiring).

I don't know what tomorrow holds for me, I hope it still works and I get at least a chance at trying to see it working on the rig. Testing the equipment with the rig would be ideal before I submit the report to the senior management. Wish me luck, I need all the luck I can get at the moment :D.

Once again to all whom shared their thoughts and ideas on this issue. I truly appreciate all your help and effort in trying to solve this problem with an aspiring Electrical Engineer (Hopfully one day I can give advice to those who need it). I thank you

Thanks
 
if it will not work, you can think of other means like triggering the counter by an electronic mean, a photo coupler, or an op-amp filter etc.
 
Your limit switch is clearly causing switch bounce. You need to debounce the switch. Read about switch bounce here
The Ganssle Group
You may be able to get away with using the RC switch debounce without the inverter IC. Give it a try, I am sure your system has too much bounce in it's step :)

In a nut shell, the limit switch is mechanical and produces erratic operation when it is activated causing random pulses to your counter. It takes a certain period of time for the switch to become stable.
The limit switch kinda puts a waveform out like _||||_||__|~~~~ Red portion is stable, not the best picture but hope ya get the idea.


Let us know how it turns out.
 
Last edited:
I built two main boards of my PIC16F876, with same blinking LEDs programs but the delay skips all the. I thought bypassing the supply is a "nerdy" approach for purists, but it turns out that caps always did the job in stabilizing the system's supply fluctuations. I'd advice you to give the capacitor part a bit more attention.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top