Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question about Encoder/Counter

Status
Not open for further replies.

originator

Industrial
Dec 12, 2004
71
0
0
US
Hello all I have a pretty simple question (I think) for guys that are familiar with steppers and encoders.

I am getting a nema 23 stepper from US digital with an E2 encoder, that will go into either a LS7183 or LS7184 "Encoder to a Counter Interface IC", then output a clock and direction to an up down counter. The counters they refer to on their site are 4 bit up down counters, so I assume you have to stack them to get the right size count you need, in my case I will need 3200 pulses total (half stepping = 400 per rev, 8 revs need for the application). Ok if this idea is correct, what is the best method to serially get the count back into a processor? Again my assumption is to have a 12 or 16 bit shift register looking at the four 4 bit counters, then at the controllers request, read the count in.

With very limited knowledge on the subject, here is the plan that hopefully someone can coroborate or destroy:

1. send a pulse and direction to the driver (code to tell how many pusles to move using for next)
2. output from the encoder a BIT into an sr latch that essentially says "we moved 1 pulse"
3. read the latch into EncoderCheck input, if "1" then start NEXT

most likely use something like:

FOR StepCounter = 1 to 3200
Pulsout StepPin, 5 'send a pulse, pause for time to allow latch to set
If EncoderCheck = 0 then Problem ' missed pulse = exit and solve it
LatchClear = 1 'Reset latch to 0
LatchClear = 0
Next

Problem: ' deal with what happened with missing pulse
ReadCounter 'read the counter in serially to see where it is and adjust accordingly, re-home, reset counter to 0 etc

I hope this isn't too vague, but how do you read a large value in serially from individual 4 bit counters? Ideally, I'd like to find a 16 bit serial output up down counter, but I haven't seen such a thing.

Thanks for any tips on whether this is close to a good concept

Todd Chapman


 
Replies continue below

Recommended for you

The simple way is to use a micro with a 2 phase up/down counter periferal, not the most common feature but there are plenty if you look around. Alternatively you could built 1 in a PIC using software and transmit it over a serial link to your main processor.
 
Thanks for the info. I am currently programming on the Parallax Stamp BS2P40 as it is easy enough to program with no lower level skills. After I get the project totally coded I am going to have someone transfer that Pbasic to the SX chip for which there will will only be minor syntax changes. The Stamp is currently recieveing inputs from several Qprox sensors hooked up to touch pads for control. am either going to use my own Hbridge driver board with a product called an IR2184 mosfet driver, with current limiting PWM on the low side using a chopper circuit. The Stamp is sending direction and Steps to an EDE1204 bipolar driver. So in short, the processor is managing all keypad inputs, sending outputs to tell the stepper where to go, counting pulses to maintain absolute control of where it is.

The product is a high end laminated galss door built in pocket door system, the quantities will be low(10-20 per month) for the first year, and has not been released yet as we are prototyping still.

The prototypes I have now are using off the shelf servos with 10:1 Gear boxes and their own controller that I simply send Start, Stop, and 4 daddta bits to access 1 positions that are programmed with a PC into their controller. I want ot reduce the cost of that system which is $800+ down to the 250 range using a stepper and driver running off my own processor.

The processor will either by itself or with an addtional processor connect via ethernet and X10 to a central station that can be remote controlled or monitored.

I love DIY, and since I have the Stamp running the system flawlessly, I wanted to next tackle running the stepper.

I know there are PICs that would be better suited, but that means a big learngin curve for C, or a vriant, and I don't ave time for that load, so I am sticking with Parallax basic for use with their chips, maybe even use the Propeller chip in the final product which is 8 32bit processors in one package that can program with a basic style language as well.


I think cbarn is right to try to let the processor count and forget shifting it in.

Thanks
 
This is not the best are to have posted the question, I am rephrasing and moving to Electric motors and motor controls, as that seems more appropriate for the content.

Thanks
 
Status
Not open for further replies.
Back
Top