News:

  • June 09, 2026, 01:53:16 PM

Login with username, password and session length

Author Topic: RPM  (Read 22241 times)

ChrisB

  • Full Member
  • ***
  • Posts: 21
RPM
« on: May 11, 2010, 02:05:27 PM »
Hi guys/gals this is my first post on this forum. Using a d260 cpu in a 205 9 base system. What i am trying to do is measure rpm via a outdoor proximity sensor mounted to a windmill. This will provide no control just rpm. Problem is everytime I make a program for it its not right. I tried setting up a base time of 6 seconds and then multiplying the # of revolutions times 10. Problem with that thinking is that if it rotates only once (very possible) it shows 10 revolutions. There has to be a better way of doing this. The other way I was doing it was by setting up a time base of 60 seconds and counting incoming pulses. Problem with that is I dont want to stand in front of my touchscreen for 60 seconds to see how many times it spun. Any help would be much appreciated.     Chris

b_carlton

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 606
    • thePLCguy
Re: RPM
« Reply #1 on: May 11, 2010, 02:26:16 PM »
I'll assume the input from the windmill is coming into a standard input.

The following are in rung order. Read all three then come back and read them again. The rungs have to be in this order.

Create a one shot of the input, the Differential contact going to a 'C' bit would work fine (let's say you use C20).

Create a rung which is triggered by C20. LD the accumulator of the timer set up below (CTA10). Convert to a real by BIN then BTOR. Store the result in a double location (OUTD V2000 - which uses V2001 also). Now LDR R6000.0, DIVR by V2000. OUTD to V2002. This should be your RPM as a Real.

Set up a timer (TMRF - let's say T10) which is enabled by the NOT of that 'C' (C20) bit

Here's a post of what I just described.

PLC 260

// Rung 1
// Address 0
STRPD X10
OUT C20

// Rung 2
// Address 2
STR C20
LD CTA10
BIN
BTOR
OUTD V2000
LDR R6000
DIVR V2000
OUTD V2002

// Rung 3
// Address 12
STRN C20
TMRF T10 K9999

// Rung 4
// Address 16
END

// Rung 5
// Address 17
NOP


#BEGIN ELEMENT_DOC
"X10","Windmill Pulse","",""
"C20","Pulse Edge","",""
"T10","Pulse Timer","",""
"CTA10","Pulse Time","","(BCD)"
"V2000","Time BTW Pulses","","Time between pulses (Real)"
"V2002","Windmill RPM","","(Real)"

#END
« Last Edit: May 11, 2010, 03:07:55 PM by b_carlton »
An output is a PLC's way of getting its inputs to change.

ChrisB

  • Full Member
  • ***
  • Posts: 21
Re: RPM
« Reply #2 on: May 11, 2010, 03:37:29 PM »
Mr Carlton thank you very much. Unfortunately where would i see the actual rpm? i am testing this as of right now and I only see the timer re-setting when i make break the prox switch. One other thing should i use a negative differential in the second line so it catches the pulse in either direction? Is there a specific V- location I can write this to and read from? Thanks      Chris

b_carlton

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 606
    • thePLCguy
Re: RPM
« Reply #3 on: May 11, 2010, 03:40:10 PM »
In my example register V2002, read as a Real, shows the RPM. No, don't bother with a negative differential.

I just spotted something, change the CTA10 to TA10 (leave off the 'C'). I don't know what I was thinking.
An output is a PLC's way of getting its inputs to change.

ChrisB

  • Full Member
  • ***
  • Posts: 21
Re: RPM
« Reply #4 on: May 11, 2010, 03:54:15 PM »
Once again thank you MR Carlton..... but one more question.... I added a compare line at v2002 to see the actual numbers as i make/break the switch... I am getting numbers/letters instead of numbers example...5d17...... Is there a way to convert it to a regular number? Thanks again! Chris

b_carlton

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 606
    • thePLCguy
Re: RPM
« Reply #5 on: May 11, 2010, 03:59:10 PM »
Quote
In my example register V2002, read as a Real

Do you know what the 'Real' number format is? If not read Appendix H of the 205 manual. You won't be able to use the standard inline compare instructions on Real numbers. Check out the CMPR (Compare Real) command instead.
An output is a PLC's way of getting its inputs to change.

ChrisB

  • Full Member
  • ***
  • Posts: 21
Re: RPM
« Reply #6 on: May 12, 2010, 06:52:43 AM »
Sorry - still don't understand what i am doing wrong. I cannot get a regular whole number to a V-memory location to be read at the HMI. I played with this for 2 hours last night. Or maybe I have the HMI set wrong? Maybe i can change something in the hmi to read BCD?  Chris

b_carlton

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 606
    • thePLCguy
Re: RPM
« Reply #7 on: May 12, 2010, 07:19:46 AM »
This is the first time you mentioned an HMI.

First, does the code work to produce a reasonable Real number in the PLC? Did you use V2002/3 as the location?
An output is a PLC's way of getting its inputs to change.

ChrisB

  • Full Member
  • ***
  • Posts: 21
Re: RPM
« Reply #8 on: May 12, 2010, 09:02:31 AM »
Sorry, I called it a touchscreen in my first post. And no I still cant get a real number at v2002/3. I tried the CMPR function but couldnt make that work either. Actually I have never used that function and I may not be using it correctly. Thanks again for the help. Chris

b_carlton

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 606
    • thePLCguy
Re: RPM
« Reply #9 on: May 12, 2010, 09:21:47 AM »
Quote
Sorry, I called it a touchscreen in my first post

Absolutely right - sorry

Quote
And no I still cant get a real number at v2002/3

Does anything at all show up in V2002/3? Anything changing as pulses come in?
An output is a PLC's way of getting its inputs to change.

ChrisB

  • Full Member
  • ***
  • Posts: 21
Re: RPM
« Reply #10 on: May 12, 2010, 09:41:24 AM »
Yes I believe it to be hex numbers. Same as yesterday. Now i need it to read normal numbers or be able to send it to the hmi so i can see a normal number.    Chris

b_carlton

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 606
    • thePLCguy
Re: RPM
« Reply #11 on: May 12, 2010, 09:54:19 AM »
While online press 'New Dataview' on the second line of buttons.

In the resultant table under 'Element' enter 'V2002'. Above select 'Signed Dec' and 'DWORD'. Make sure 'Status' is turned on. Read the floating point number.

Then please read the Appendix H of the CPU manual. If you don't understand numbers you won't get very far.

On the HMI, the setup of the tag for a display object must be defined such that it knows it is reading a floating point (Real) number.
An output is a PLC's way of getting its inputs to change.

ChrisB

  • Full Member
  • ***
  • Posts: 21
Re: RPM
« Reply #12 on: May 14, 2010, 01:57:49 PM »
Okay after some fooling around I got this to work.... but... and hopefully the final problem is.... when the windmill stops spinning v2002 retains the last known value. So in other words if it were spinning 50 rpm and then came to a halt or slowed down to a halt the last value remains. Is there a way to zero that until it actually is spinning? thanks again    Chris

b_carlton

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 606
    • thePLCguy
Re: RPM
« Reply #13 on: May 14, 2010, 02:20:40 PM »
Make the preset of the timer (T10 in my example) to over the longest time between pulses reasonable. For example, if you wanted to go as low as 1 RPM then set the preset to a bit over 6000. Then if T10 ever times out (the contact T10 is true) then just set the final reading to 0.0
An output is a PLC's way of getting its inputs to change.