Shop OBEX P1 Docs P2 Docs Learn Events
Creating Quadrature Pulses to simulate Quadrature Encoder for testing control c — Parallax Forums

Creating Quadrature Pulses to simulate Quadrature Encoder for testing control c

cnc002cnc002 Posts: 2
edited 2004-08-17 02:50 in BASIC Stamp
Hello:

Has anyone here tried creating Quadruature Pulses that would emulate a Rotary/Linear Quadrature Encoder?· I can do this with discrete TTL or CMOS devices but would like the ability to progam different frequencies, and maybe other functions as well.· Right now, I would like to know if anyone has created a circuit using the BS2 or other Basic Stamp to generate Quadrature Pulses.· I need to be able to created a channel A pulse, channel B pulse in quadrature (90 degree shift) format.· Also, I would need to create an inverted pulse, call it NOT B for emulating a reverse direction.

Any help would be appreciated so I don't have to re-invent the wheel if I don't have to.

Randy Abernathy

Comments

  • dlborgmandlborgman Posts: 11
    edited 2004-08-17 02:50
    Randy,

    Write a simple program that does the following:
    Define a pause value (I'll call it pvalue for the example)
    ····· pvalue should be defined as the number of milliseconds between each step.
    Clear both outputs
    start:
    Turn chA on
    pause pvalue
    Turn chB on
    pause pvalue
    Turn chA off
    pause pvalue
    Turn chB off
    pause pvalue
    loop back to start


    If you start with chB, you will go in reverse.

    Dennis
    ·
Sign In or Register to comment.