I have been trying to get this same setup to work. I contacted Russ offline and he sent me a copy of his HAL file that I have tried to incorporate into my own.
The only thing that gives me a problem is the line "net spindle-position encoder.0.position-interpolated => motion.spindle-revs". If I leave out the word "interpolated", then EMC will start and run. If I include the word,
then I get an error message when I try to start EMC "spinle-test.hal:31:pin encoder.0.position-interpolated does not exist"
When I run EMC without the "interpolated" statement, I think EMC is finding the index position, but I don;t think it is registering the speed. I cannot get the speed to register in the Spindle Speed dialoge box in Axis.
(Although this may be because I am not using the right output statement in the spindle_to_pyvcp.hal file)
This is what I currently have "linksp spindle-speed pyvcp.spindle-speed"
If I open up the Show Hal Configuration dialogue box and watch what is happening, this is what I get:
> Spindle-CMD - toggles between 0 and 1 when I toggle F9
> Spindle-index-enable - The icon stays brown all the time
> Spindle-Phase-a - The icon is yellow
> Spindle-Position - The number starts at 1 and then changes as the spindle turns
> Spindle-Velocity - Stays at 0
My spindle motor is not connected to the computer, I manually start it. If I first I issue a spindle speed command (M3 S100), then I issue a command (G33 Z-1 k.0625) the machine will move from Z0 to Z-1 in a series of jerks, (I am guessing a series of .0625" jerks).
So, it would seem to me that maybe EMC is registering the spindle
position, but not the spindle speed.
Thanks for any help you can provide, I think I am close, but close only counts in horseshoes and hand-grenades,,,
I have attached my Hal file,
Rick
Attachment spinle_test.hal not found