Rpm calculation ladder program – Rockwell Automation 1761-HHP-B30 MicroLogix 1000 with Hand-Held Programmer (HHP) User Manual

Page 484

Advertising
background image

Appendix E
Application Example Programs

E–41

To maintain validity, you must ensure that you cannot accumulate more
pulses per rate period than counts per revolution. For example, if you have
selected a 1000 pulse encoder, you cannot have more than 999 counts occur
in any 1 rate measurement period. If you determine that you exceed this rule,
simply lower your Rate Measurement Period T0.PRE.

RPM Calculation Ladder Program

Rung 2:0
Ensures that the measurement value is initialized each RRUN mode entry.

| Shift Last timeout |
| Limit value storage |
| Switch register |
| S:1 +MOV–––––––––––––––+ |
|––––] [–––––––––––––––––––––––––––––––––––––––+–+MOVE +–+–|
| 15 | |Source C5:0.ACC| | |
| | | 0| | |
| | |Dest N7:0| | |
| | | 0| | |
| | +––––––––––––––––––+ | |
| | Frequency | |
| | determination | |
| | counter | |
| | C5:0 | |
| +–––––(RES)––––––––––––+ |
| | | |
| | Counts last rate | |
| | measurement | |
| | period | |
| | +CLR–––––––––––––––+ | |
| +–+CLEAR +–+–|
| | |Dest N7:1| | |
| | | 0| | |
| | +––––––––––––––––––+ | |
| | Frequency in | |
| | Hertz period | |
| | +CLR–––––––––––––––+ | |
| +–+CLEAR +–+–|
| | |Dest N7:4| | |
| | | 0| | |
| | +––––––––––––––––––+ | |
| | RPM based on | |
| | counts per turn | |
| | register N7:2 | |
| | +CLR–––––––––––––––+ | |
| +–+CLEAR +–+–|
| |Dest N7:5| |
| | 0| |
| +––––––––––––––––––+ |

Rung 2:1
Sets the rate measurement period. In this case, we are calculating a new
rate value once every 100ms. Value N7:1 is updated once every 100ms with
the number of counts that have occurred in the last 100ms period. Note
that the preset value must divide evenly into 100 in order to accurately
determine frequency and RPM (determined later in this program).

| Rate Period | Counts last |
| Expiration | rate measurement |
| Bit | period |
| T4:0 +TON–––––––––––––––+ |
|––––]/[––––––––––––––––––––––––––––––––––––––+TIMER ON DELAY +–(EN)–|
| DN |Timer T4:0+–(DN) |
| |Time Base 0.01| |
| |Preset 10| |
| |Accum 0| |
| +––––––––––––––––––+ |

Advertising