Question about Encoder/Counter
Question about Encoder/Counter
(OP)
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
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





RE: Question about Encoder/Counter
RE: Question about Encoder/Counter
How many do you need? Did you select processor?
What else has the processor to do ?
Plesae read FAQ240-1032
My WEB: <http://geocities.com/nbucska/>
RE: Question about Encoder/Counter
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
RE: Question about Encoder/Counter
Thanks