5/23/2017 1:31 PM | |
Joined: 3/3/2017 Last visit: 7/22/2024 Posts: 17 Rating:
|
Hi, In a program I've successfully managed to recover the position of an engine using its encoder by counting edges and checking the left/right inputs for direction (in the program). My encoder has channels A, A/, B and B/. My issue is, when I try to know the direction by checking B's state during A's edges, counting is erratic and incoherently slow compared to the first method. I tried switching encoder channels with every possible combination (in case i made an error) and made a special small program to test (attached to this thread). The encoder i use is 1,54kHz max (relative to the engine's max speed) and HTL (with 24v), i'm using a logo 8 24CE. The program is as follow: inputs 11/12 allow to move left/right, encoder inputs are I3 and I4. I3 is for edges and I4 for direction for the counter block B015, counter block B003 uses the original method of checking the direction with I11. My message block shows B015's count and B003's count. When i try the program B015's count is about 2/3 of B003's, so it seems some edges for B015 are counting backward for some reason. I'd like to know if this is a hardware issue, i've seen some threads stating that the logo is bad at handling encoders using two channels for direction, has anyone got specific informations on this? Thanks, Yann AttachmentLogo Encoder.zip (158 Downloads) |
Follow us on