Reading width of pulses in pwm signals

eXistenZ

Member
Join Date
Feb 2016
Location
Flensburg
Posts
3
Can anyone give me a hint on how to do this, analog in could be used,
but could I connect the input pwm signal 1 digital input pin on the plc, and then read how long it is high/low?
Frequency should stay the same.
Stepping up the pwm voltage to match plc input range to 24V I guess would be necessary?
 
A PWM carrier frequency can be often be from hundreds to thousands of Hertz. A plc will not have the input response nor the interrupt capability to determine the on time of a signal like that with any accuracy. Your best bet would probably be a properly designed filter feeding an analog input.

If this is more of a time proportioned output, which has control periods from major fractions of a second to seconds, then running the signal into a digital input and determining the on time relative to the time between leading edges would be the best bet.

Keith
 
If the platform eXistenZ is using has a high speed counter that will return a precision on time for an input signal that would work. But that isn't a mode of operation I have come across with the high speed counters I have used. If you just look at the frequency of the signal it will always be the same.

Keith
 
Hello, sorry for the late replay.
I dont know the specific pwm frequency yet, but I am sure it will be low - as in about 1kHz or lower.
I thought about connecting the pwm signal to a high speed counter on my siemens 1200 plc, and then measure the 'high' time, this way I would get the dutycycle, which is what I need as you probably know.
Kamenges what do you mean, when you say you havent seen that mode of operation?
 
I think that a properly designed filter running to an analog input as Keith said in post #2 is the easiest way.
Maybe API or B&B Electronics has a commercially available device, I don't know.
I believe counting pulses in any fashion will be be difficult to get a useable working signal.
 
If you have two high speed counter inputs on your PLC and if you can configure one of them to count on the rising edge while the other counts on the falling edge, you might be able to do something with the average number of scans the accumulated counts of the two counters are different, compared to the number of scans they are the same. As long as the frequency remains constant and low and the scan time fast.
That's just a "back of the ****tail napkin" thought on a possible approach. Proof of concept not yet demonstrated.
 
Last edited:
Originally posted bu eXistenZ:

Kamenges what do you mean, when you say you havent seen that mode of operation?

I have fairly limited experience with variety of platforms but I have yet to come across a PLC based high speed counter that will measure either signal high time or time between pulses.

If your PWM carrier is 1kHz you would need 10 microsecond time resolution to get 1% signal resolution. Your two choices with the Simatic S7-1200 would be, as you said, using the high speed input to measure the on time and carrier period internal to the hardware itself, which I'm not sure it can do, or use the interrupt capability and try to let the plc determine the on time and the carrier period. However, the interrupt latency may be too long to do that.

Keith
 
Last edited:

Similar Topics

Hello I have a s7-1200 and I would like to read the tags present in this controller with my controllogix controller. The two controllers don't use...
Replies
5
Views
126
Hi all, i have 8 CJ2m plc units that show different numbers on the plc display and i am stuck on reading the info. my unit has an ip address of...
Replies
3
Views
94
Hi Everyone, I am not proficient in RSLogix 500 so I have a question regarding the evaluation of N7:0 data as an input. So as I understand in...
Replies
1
Views
84
Trying to setup a message read via Ethernet. I have the path setup as 1, 1, 2, 192.168.66.10 I get an error code 1, ext err 315. I am beating...
Replies
9
Views
231
Dear all, I don't know why setup of password became challenging and weird. After setting up the password and try to upload the ladder from the plc...
Replies
3
Views
172
Back
Top Bottom