How To Hookup Spindle Encoder to EMC via Mesa?
The only thing I need to hook up is the spindle encoder. It is a absolute type encoder with A, B, and Index channels. It has 5V+ and common. Somehow I need to get this terminated to get the feedback so EMC can know spindle location for threading.
How do I go about doing this? Do I need another encoder board to decipher this signal and convey it to EMC?
I have to imagine this is a standard item to connect, as all CNC lathes have to connect to a spindle encoder!
I am thinking I may need anohter input board to terminate the spindle encoder too, but what kind? I can't find any boards specfically for encoders only, and all of them seem to be geared for axis control, by that I mean they have a servo power feed, and an encoder feed together. I only need to get the encoder signal back to EMC.
And yes, there is a difference in the encoder on the spindle (absolute type) to the encoders I have on the axis control (differential type). I had to research it a little to understand, but the absolute encoder knows which angle the spindle is at no matter what point in the rotation or at what time it starts. This is what is needed to turn threads, that way EMC knows how to sync up the axis feed with the spindle angle to continue cuts at the same points. It also has a reference signal for every revolution, which will feedback the spindle speed to EMC.
The differential types (on the x and z axis) only count up or down from a specfied '0' point which is set when you zero or reference the axis.
So, what I am asking is how do I get the absolute encoder terminated back to EMC via the Mesa Anything I/O board? Someone must have done this in using Mesa boards on their lathe!
I believe I need a board in between the encoder and Anythign I/O that will power the 5V encoder, and decipher the channel signals to feedback to EMC.
I think you are mixing up encoder terminology here, the term "differential" is used to describe the electrical interface of an encoder (often the two possible electrical interface types are referred to as differential or RS-422 as opposed to TTL or single ended)
I think you mean an incremental (or quadrature) encoder type when you say differential
It is possible but I doubt that you have an absolute encoder on the spindle (listing the encoder interface pins will clear this up) Normally EMC keeps track of spindle position by using a incremental encoder with an index signal (A,B,Z signals with A,B being the quadrature signals and Z being the once-per-turn index signal)
If you have a TTL encoder (non-differential) this can be connected to s simple breakout like a 7I42TA or the encoder wires can connect directly to the FPGA pins (though a mistake here can e expensive)
From your question on pinout - the spindle encoder has PA, PB and SC (in addtion to GND and +5V) in modern terminology, I beleive that is the A,B and Index.
So, maybe you are right then, your description seems to fit the 3 legs I have on this encoder. With this being the case, can you rehash what you meant below, I am not sure if you are saying the7I42TA is my answer or not? I have 7I37TA, will that work or not?
encoder signals can be connected just fine to the mesa io cards , using A,B,Z as PCW explained . using the preconfigured pins A,B,I as shown in pncconf or dmesg txt listing
either addon board will work , although i personaly use the 7I42TA types
adding extra encoders to a mesa configuration , would involve adding another encoder to the firmware which can be done , either by recompiling the hostmot2 firmware , or possibly picking a larger configuration that you need any unused pins revert to gpio
I don't know of any Mesa firmwares with fewer than 4 encoders (other than those with none). So adding an extra is just a case of changing a number in the config string (which is probably in the INI file).
I have just wired my encoders direct to FPGA card pins, and that appears to work fine for 5V TTL signals.
However, there is no reason that you can't use the 7i37TA, it makes wiring easier, and protects the FPGA.
Edit the INI file (look for a num_encoders parameter) then start and stop EMC2. Then type 'dmesg' at the command prompt and somewhere in all that text will be the pin-out of your FPGA card. Just hook up the encoder wires via the 7i37 and see what happens. (Look in machine-halmeter at the encoder.N.rawcounts pin, you should see it change as you rotate the spindle).
sorry of course the 7i29 has only 2 encoder inputs - I was thinking the more common 7i33. Mesa makes so many cards!
Peter reminded me the other day that the 7i29 requires PWM (not PDM) at a base frequency of 20 khz.
please make sure the config sets that up. ( if thats a little too Greek to you set us know)