9/18/2014 2:11 PM | |
Posts: 23 Rating: (0) |
Hello, I need some help with an encoder. I want to calculate the speed of a conveyor so with an encoder I want to count the rpm of the axis. I got a S7-1214c and a hengstler incremental encoder; RI58-O/5000EK.42KB. In my program I configured HSC_1: · Type of counting: Count · Operating phase: A/B counter(I also tried A/B counter fourfold) · Counting direction: Count Up I als0 double checked how I connected the encoder (A on I0.0 and B on I0.1) In OB1 I want to check what the count of the encoder is (5000pulses every rotation) so I can calculate how many rotation the axis rotated. So in OB 1 I programed with a compare %ID1000 == 500 “then” Q0.2.(just to debug the value) But when I rotate the encoder wheel it doesn’t really count, but the value changes between 0, -1 and -2. I’m sure I’m doing something wrong but I can’t figure it out, so I checked: Probably I’m missing something… is there anybody who can help me? |
Last edited by: Min_Moderator at: 9/25/2014 1:25 PMImprove link to permanent link Last edited by: lerra at: 9/18/2014 2:12 PM |
|
9/18/2014 3:01 PM | |
Joined: 7/7/2010 Last visit: 9/12/2024 Posts: 15180 Rating: (2417)
|
Have you considered changing your HSC input to give you frequency directly without you having to do the work in the program logic? Change it from count to frequency. Check your pulses into A & B with an o'scope to make sure they are correct, not noisy and of the proper voltage levels. Then select the proper time base. Look in the documentation for motion control axis configuration as it may be the answer you want without much program logic on your part to get the answers you need. |
science guy |
|
Follow us on