I came to the .hal section below looking around on the net and
testing, but, while this seems to work from time to time, basically,
I'm not using the index signal which I would need for eg threading.

Especially the line

net spindle-phase-A <= parport.0.pin-11-in => encoder.0.phase-A 
encoder.0.phase-Z

Makes me wonder. This would send 50 indexes per turn. I guess one should
have a single Z index per turn to act as reference point when threading.


John Kasunich wrote:
> Geert De Pecker wrote:
>> Hi,
>>
>> I've mounted a spindle encoder to the mill and was trying to use G33, 
>> but this always seems to move at the same speed.
>>
>> The spindle encoder has 50 ppr (pin 11) and an index signal (pin 10).
>>
>> This is my hal setup:
>>
>> ...
>> loadrt encoder num_chan=1
>> ...
>> addf encoder.update-counters base-thread
>> addf encoder.capture-position servo-thread
>> ...
>> setp encoder.0.counter-mode true
>> setp encoder.0.x4-mode false
>> setp encoder.0.position-scale 1
> 
> ^^^ this is saying that one count = one position unit
> for a spindle, one position unit is one revolution
> 
> If your encoder has 50 PPR, then you should be using 50 for the scale.
> 
>> net spindle-phase-A <= parport.0.pin-11-in => encoder.0.phase-A 
>> encoder.0.phase-Z
>> net spindle-index-enable motion.spindle-index-enable <=> 
>> encoder.0.index-enable
>> net spindle-pos encoder.0.position => motion.spindle-revs
> 
> Confirm that the scale is correct by turning the spindle one revolution
> by hand, while looking at net spindle-pos with halmeter - it should
> increase by 1.00
> 
> Regards,
> 
> John Kasunich
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users
> 

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to