Getting RPM out of a HSC

Allan Barnes

Member
Join Date
May 2004
Location
Woodstock ON
Posts
122
Hello All.

I am looking to use a HSC on a AB ML1500 to give me feedback up to 1800 RPM.

The part I am not sure about is using the HSC functions file with the
Interrupts to do this.

I have done totalized flow in the past but I did not need to worry about the High speed stuff.

I am also concerned with errors because of cycle time of the program.

Is it feasible to do this with the PLC or should I be looking at an after market device to give me an analogue input to the PLC?
 
The ML1500 supports up, down and quadrature at 20khz, 1800rpm equals .03khz so it should be very accurate. High speed counters work independent of cycle time so not about the concern of errors or using interrupts.

May want to offer more details about what you are going to use and what you plan to do then more specific help can be offered.
 
Last edited:
Ron is correct.
However, some applications have more than one pulse per revolution. (Gives you a better resolution)
That is one of the details you will need to know, when converting pulses to RPM's. I have a couple of applications where a 60 tooth gear and a prox switch are used, so each revolution generates 60 pulses. That's only 1.8k Hz, still well within the range of the ML1500.

Go ahead and give it a try, if you have problems, post your code and I'm sure someone can give you a couple of pointers.


Ken
 
Hi
1. Have a free-running millisecond timer.
2. Set up one of the HSCs to count to 60 (or whatever pulses per rev) and interrupt.
3. In the interrupt, store the timer ACC and reset the timer.
4. (1000/Timer.ACC)*60 is your rpm
5. I'd have a rolling FIFO of about 5 of these values and average them out.
Don't know what precision you need.

HSC setup...(HSC1 connects to I:0.0/4)

hsc.jpg


pp
 
Does the AB have a 1 second clock?

Clock on, store current count in user memory A
Clock off, store current count in user memory B

Subtract A from B = C
(C/Encoder PPR)*60 = RPM
 
Well I wrote some code to calculate the RPM.
It appears to work, but craps out around 50Hz or 1050 RPM.

I put a scope on the sensor, and it is clean and generates pulses up to 100 Hz or 2200 RPM.

So what I am wondering is if input I:0.0/0 is the right input, or if I have missed some thing.
 
Hi Allan
Firstly, I:0.0/0 is the correct input.

What does the timer acc get to at 2000rpm. It should be getting to 33ms or so. Does this look right?

What do you mean by 'craps out' Does the accuracy go, or is the result just nonsense?

The scan time is down at 0.6ms so the timer should be accurate enough.

One more thing, I'm not sure, but check the input filter time is at its lowest. Don't know if the HSC 'overrides' this setting.

Let us know how you get on.

pp
 
Last edited:
Well to answer your questions, the results were all over the place, then around 1100 RPM it stopped reading.

I checked the input filters, and this was in fact the problem.

Once I set the filters to the lowest setting, it worked great.

At this point in time I going to see if I even need the high speed counter since I am only operating at 100 Hz.

Thanks for the help
 

Similar Topics

The application was working in Twincat 4022.16 Used VM for offline. recently changed the laptop and the getting the error with Message as below...
Replies
0
Views
56
We are using wincc scada WinCC system software V7.5 SP2 , connected to few plc . Past 3 weeks we getting this alarm continously when we checked...
Replies
0
Views
81
I am very, very new to PLCs. I only have experience with Picos, but I knew enough to save this from the dumpster. Apparently, everything on it is...
Replies
13
Views
616
Hi, I tried today to get RD3A and WR3A instructions to work on the PLC and it didn't work, but it worked in simulation. I followed the clone...
Replies
18
Views
1,410
Good morning guys; Im new at AB plc, and i just need help about a table or a list called something like "exchange data table" in French it is...
Replies
4
Views
778
Back
Top Bottom