S7-1200 High Speed Counter w/ Shaft Encoder

Jason Ozolins

Member
Join Date
Mar 2012
Location
Fife Lake, MI
Posts
59
Greetings,
I am trying to get a Incremental Shaft Encoder (white pages attached) to count on my HSC in my 1200 project. I have assigned the first 2 inputs and enabled the high speed counter and set up as: "Count", "A/B Counter Fourfold", and "count up". I could not get any type of pulse until I spoke with the manufacturer of the encoder, and they had me install a 2.2k ohm resister between my signal and 24v+. I assigned my counter to %ID900 and It somewhat works now but it appears to count approximately the same number of pulses regardless of how many revolutions the shaft makes and only counts at the very beginning of the on cycle and the very end of the off cycle... (as if the encoder is pulsing too fast). It is a 200 pulse per cycle (I assume revolution), and revolves at a rate of about 1 per sec. Can anyone off the top of their head think of why its not accurately counting. I can only get about 60-70 pulses on it no matter time it is rotating and mainly at the last milliseconds of the motor being on. It is a 24v "open collector". This is the first time I have worked with an encoder.

::edit::
Apologize for other post, didnt realize this one posted with attachments
 
Last edited:
Greetings,
I am trying to get a Incremental Shaft Encoder to count on my HSC in my 1200 project. I have assigned the first 2 inputs and enabled the high speed counter and set up as: "Count", "A/B Counter Fourfold", and "count up". I could not get any type of pulse until I spoke with the manufacturer of the encoder, and they had me install a 2.2k ohm resister between my signal and 24v+. I assigned my counter to %ID900 and It somewhat works now but it appears to count approximately the same number of pulses regardless of how many revolutions the shaft makes and only counts at the very beginning of the on cycle and the very end of the off cycle... (as if the encoder is pulsing too fast). It is a 200 pulse per cycle (I assume revolution), and revolves at a rate of about 1 per sec. Can anyone off the top of their head think of why its not accurately counting. I can only get about 60-70 pulses on it no matter time it is rotating and mainly at the last milliseconds of the motor being on. It is a 24v "open collector". This is the first time I have worked with an encoder.

Here is the encoder:
http://encoder.com/core/files/encoder/products/6a42f3fd9d38e0f070dc82bc1dcbb222.pdf
 
Do you have separat pull-up resistors for both A an B channel?
It would have been easier for you with a push-pull output instead of an open collector type.
Introducing extra components like external resistors also means additional source of potential errors. Is it possible for you to get a replacemant deal with your vendor?
 
I've got the encoder and HSC working however, when the shaft is spinning at normal speed, it is pulsing too fast for the HSC to count it. Is there a faster pulse input module for the S7-1200 or am I limited to the onboard DI points? I took the encoder off the shaft and moved it by hand slowly and it accounted for all pulses. Is there possibly something I can do by changing resistance on pull up current for the onboard DIs to keep up with the faster frequency? The encoder pulse speed is 200 per revolution and shaft speed rotates about 1 revolution per second.
 
200 Hz should not be a problem. Have you measured the actual voltage at the HSC inputs? Best way is to study it with an oscilloscope. But again, I really would consider replacing the encoder with a push-pull output type instead of the open collector type. Then you can connect directly to the PLC inputs without pull-up (or -down) resistors.
 
Last edited:
When shaft is idle, I'm at 24v, and when rotating, it varies around 16v and as low as 8v

Look at it with an oscilloscope, not a multimeter.
How do the pulse trains for channel A and channel B look?
They should range from very close to zero up to the supply of the pullup resistor (which might have to be 5 or 12 V, I don't know what the Siemens HSC takes for an input).

Are the A and B channels 90 degrees out of phase with each other?
 
I have used pull up resisters with Open collector encoders lots of times. OK, Push-Pull outputs are a bit more convenient but what you have there should work fine.

Have you thought this could be interference?. Running the cable next to power and especially motor cables (worse when Inverter driven) can give you similar problems. Also, how long is the cable run? and what have you done with the screening on the encoder cable? I have even stuck the encoder shaft in a hand drill before to check similar problems).
 
Using the same wires, I attached the encoder to a Direct Logic 6 with a H0-CTRIO2 pulse input card and it works fine. However, the resisters are not used when using the direct logic 6.

When I use the same wires with no resisters on the S7-1200, I get nothing. When I add the 1.5k or 2.2k ohm resisters, I get counts, but only when encoder is rotating very slow. So, I know my encoder and wires are ok, but something different with the HSC and the 1200.
 
Using the same wires, I attached the encoder to a Direct Logic 6 with a H0-CTRIO2 pulse input card and it works fine. However, the resisters are not used when using the direct logic 6.

When I use the same wires with no resisters on the S7-1200, I get nothing. When I add the 1.5k or 2.2k ohm resisters, I get counts, but only when encoder is rotating very slow. So, I know my encoder and wires are ok, but something different with the HSC and the 1200.

Well, since you can't actually look at the signals, could you at least confirm what the S7 inputs are looking for level wise?
There should be a datasheet for the module.
 
8 Volts isn't low enough. You should be able to get close to zero volts. Do you have a TTL or Line Driver output? I looked at the datasheets you provided, but I can't tell without the part number.

You should always be at 24 Volts when idle. It should be a 50/50 chance at 24V or 0V. It's not going to work correctly until you fix this.
 
8 Volts isn't low enough. You should be able to get close to zero volts. Do you have a TTL or Line Driver output? I looked at the datasheets you provided, but I can't tell without the part number.

You should always be at 24 Volts when idle. It should be a 50/50 chance at 24V or 0V. It's not going to work correctly until you fix this.

He says as low as 8 v "When it is rotating", which is a completely invalid measurement. And does that HSC module default to 24V for a high signal? I don't know.
 
I agree that the voltage readings while turning fast don't mean much, but I would expect an average of 12 volts on either the AC or DC scale.
He doesn't have access to a 'scope. An encoder isn't rocket science. It has two outputs that switch from low to high. Digital. Turn it slow, and it will switch states. In this case, 0 to 24 Volts. If the output is TTL, then it should work correctly with the pullup resistor. If it's line driver, then the pullup resistor is the cause of the problem.

The PLC needs to see 0 or 24 Volts. It's not going to work unless it does. When working properly, he should be able to turn the encoder slowly and watch the lights flash 90 degrees out of phase.
That's all he has is a meter and the PLC LED's. It can be done with that.
 

Similar Topics

I have a current project replacing S7-200 PLC with S7-1200 PLC (6ES7 215-1AG40-0XB0). The program conversions are manually created. I just want...
Replies
3
Views
1,735
Looking for example of the use of the HSC in a CPU 1212C PLC. Not sure of how to establish Hardware ID, and which input to use the ID1000 is it...
Replies
1
Views
1,814
Hello everyone, I got a question about the High speed counter It needs to move out a slide when the count reaches 100pules, and it needs to move...
Replies
9
Views
4,106
I have a 1762-L24BWA microligix 1200 that gets an input from a proximity switch that is mounted near sprocket the prox picks up once per...
Replies
3
Views
5,035
I am having an issue with either the Encoder – an Encoder Products 25T-40SG-0500NV1RPP-SMJ-S3 or the High Speed Counter on a ML 1200. The encoder...
Replies
8
Views
4,541
Back
Top Bottom