- Posts: 83
- Thank you received: 0
Fitting an encoder to non Tormach mill (5i25)
Read the "Fitting an encoder on a Tormach 1100" thread and realise Tormach's modified encoder just takes a pulse per rev input.
Had a play with "num_encoders=" parameter, (setting to 0, 1 , 2) under v1.9.13 and now under v2.1.3, results are the same.
num_encoders=0, as expected no encoder.
num_encoders=1, adds the pulse per rev encoder over the IO Pin 016
num_encoders=2, adds the pulse per rev encoder but also what looks like a 'real' index and 2 phase encoder on P2, the second DB25.
Does anyone know anything about this 2nd encoder? Is it available ?
Please Log in to join the conversation.
net spindle-position hm2_5i25.0.encoder.00.position => motion.spindle-revs
net spindle-velocity hm2_5i25.0.encoder.00.velocity => motion.spindle-speed-in
net spindle-index-enable hm2_5i25.0.encoder.00.index-enable <=> motion.spindle-index-enable
setp hm2_5i25.0.encoder.00.scale -4000
With halmeter you will need to find the names of your (hm2_5125.0.encoder.00.position) it could be )01 etc. and the same for the other pins. You might also have to remove the - sign for the scale if it is counting the wrong way
Please Log in to join the conversation.
Is the code you suggest for that 7i85/5i25 custom bitfile configuration?
I would like to use just the 5i25 with the newly found "real" encoder if possible.
Will do some testing of the newly found encoder with your suggested code.
Please Log in to join the conversation.
You will be able to use the high speed encoder on the second port . if you connect it up you should see the pins change state with the halmeter.
Please Log in to join the conversation.
even if the A,B lines are brought out.
If you dont have a Tormach machine, I would use a non-Tormach bitfile with standard encoders
Please Log in to join the conversation.
PCW wrote: I'm pretty sure Tormach 1 pin encoder (for RapidTurn) does not work as a standard encoder
even if the A,B lines are brought out.
Is it possible encoder 0 is Tormach pulse per rev, and encoder >0 is standard...?
PCW wrote: If you dont have a Tormach machine, I would use a non-Tormach bitfile with standard encoders
It's non Tormach but I'm committed to their DB25 P3 pinout because of the interface hardware I built which looks exactly like a Tormach to the 5i25, down to the watchdog.
Please Log in to join the conversation.
Initially just added 2 encoders to the 100-3 ini file and used ADMIN HALMETER to look at the 2nd encoder's pins while I pulled the A, B and Index pins high and low. This worked.
Connected my DIY optical sensor's A, B and Index outputs to the encoder inputs, added simple encoder initialisation code to postgui file and again used halmeter to look at the signals.
There's a velocity output signal that is at least roughly proportional to spindle RPM from 200 to 3000 RPM and the sign is correct with respect to direction (after I swapped the A and B phases of course). The velocity value jumps about a bit, around +/-10 %, signal looks pretty clean on a CRO.
Is this worth persisting with?
Please Log in to join the conversation.
Please Log in to join the conversation.
Clive s wrote: Watching with interest. Did you try the code above in post #117328
Sorry, no, not today, it might be a bit early to risk that. I was reading up on encoders this afternoon.
I'm not really confident what I'm seeing as velocity is correct. I'll feed it a clean square wave tomorrow and see if that's stable, if yes the +/-10% variation has an external cause.
Your code is for G33 co-ordianted motion I recall.
At one stage I took some bits of the duality ini and hal files and had actual spindle RPM on the DRO, I'll have to dive in to the UI python again, see if I can work out what I did.
Ken
Please Log in to join the conversation.
rafferty wrote: Is this worth persisting with?
It sounds like it. You just need to make that encoder (speed, position) go to the right pins in HAL.
Please Log in to join the conversation.
