Kkula
Browse Questions » LOGO! - Software: Position sensor

About User

Questions Asked: 37.9K

Answers Given: 32

0
  • Open

LOGO! - Software: Position sensor

Good afternoon, I would like some help... would anyone have an example of a program with the encoder where it identifies whether the position is increasing or decreasing automatically without me needing to pulse an input of the logo to trigger the direction of the counter block ?

0 Likes 0 Favourites 0 Followers 0 Comments
Answers(1)

Encoder Direction Detection with LOGO!

Certainly! Here's how you can determine encoder direction in your LOGO! program without external inputs. The LOGO! can directly interpret the encoder signals (A and B quadrature) to identify increasing or decreasing motion.

Key Principle: The LOGO! utilizes the phase relationship between the A and B signals. If A leads B, the motion is generally increasing; if B leads A, it's decreasing.

Example Program Logic:

  1. Encoder Inputs: Connect your encoder's A and B channels to LOGO! digital inputs (e.g., I1 and I2).
  2. Counter Block (CTU/CTD): Use either a CTU (Count Up) or CTD (Count Down) block.
  3. Direction Logic: Implement logic to dynamically switch between CTU and CTD based on the A/B phase. This is typically done using comparison blocks.
  4. Comparison Blocks: Use comparison blocks to check which encoder signal (A or B) changes state *first*. This determines direction.
  5. Network Output: Use a network output (e.g., Q1) to indicate the direction detected.

Resources:

Note: Exact implementation details vary based on your encoder type and desired counting behavior. Refer to the LOGO! documentation for precise block configurations.

0