I suspect the Joint 2 following error mentioned previously is related to the fact that the system does not receive the signals when the external_offsets mode kicks in. The X axis positions the tool and then stops.
Peter_Cassar wrote: I've spent some more time today trying to get the setup correct. I believe I have a lot more work to do regarding the C axis Joint 2 config in the hal file.
I don't think you want a C axis, and I think that the Tcl files from the sims might be very much complicating the situation.
For what I think you want all you need is the opa component loaded and connected to the spindle position with the output connected to the X axis external offset.
Do you still have the original working 2-axis lathe config? I would start with that, add the opa.hal and opa_panel.hal files and change this line in opa.hal
net E:angle <= axis.c.pos-cmd net E:angle => xo.angle
net spindle-revs => xo.angle
Your current config is an untidy hybrid of a sim config (with simulated spindle) and a real config with closed-loop spindle speed (which you might not want either)
My encoder is a 4000 count device (1000LPR) so the encoder scale is set to this value. The position value is derived from encoder counts divided by scale so this is proportional to angular position . How do I create a signal in HAL to scale the position x 360 (degrees) and limit it in the range of 0 to 360?
I'm wondering if the eoffset-per-angle component does a modulo 360 internally . I think it might and that would solve one problem.
As an experiment I changed the encoder scale to 11.111 which (4000/360) which suggests the correct amount of movement per rev of the spindle but I'm no expert at HAL. I need to preserve the encoder scale at 4000 to ensure my spindle sync moves work.
I realize spindle needs to turn slowly <100 rpm for this to work, back gear would be nice.
Easy thing to try, ask for a 360 * N polygon, it might work.
Alternatively, pass the angle through a scale comp
loadrt scale addf scale.0.servo-thread net spindle-revs scale.0.in net spindle-degs scale.0.out => xo.angle setp scale.0.gain 360
Peter_Cassar wrote: I realize spindle needs to turn slowly <100 rpm for this to work, back gear would be nice.
I have been considering a sub-spindle:
second-from bottom 2 pictures here: www.lathes.co.uk/holbrook/page4.html
And a home-made one: www.practicalmachinist.com/vb/bridgeport...experimental-207139/
An important point from that second link is that you don't need a set of spindle bearings, you can use a live-centre in the driven spindle, and arrange for a drive-dog plate to simply rotate relatively slowly around it while the live-centre body spins at full spindle speed.
addf scale.0 servo-thread
net spindle-revs scale.0.in
net spindle-degs=> scale.0.out
setp scale.0.gain 360
net spindle-degs => xo.angle
About the slow spindles. I was thinking of an auxiliary worm drive off the rear of the headstock spindle that I could engage/disengage and driven by an ac motor or even a servo would provide plenty of torque . The current spindle arrangement on the lathe has not much torque below 100rpm.
I have a 16inch lathe like the one you linked to in your last message. It's got a reduction gearbox before the spindle drive and the lowest backgear speed is 15RPM . The planetary drive is a great idea although I would have to add an encoder to the output shaft which wouldn't be too much of a challenge.
That might be slow enough.
Peter_Cassar wrote: I have a 16inch lathe like the one you linked to in your last message. It's got a reduction gearbox before the spindle drive and the lowest backgear speed is 15RPM .
If it is geared then the ratio is exact, and just scaling the normal spindle encoder differently will do the trick.
The planetary drive is a great idea although I would have to add an encoder to the output shaft which wouldn't be too much of a challenge.
The cutters I'm planning to make are only 3/4 to 7/8" diameter for watch and clock work so not as much torque is needed for machining these.
Another neat thing to try with the eoffsets would be to pump both x and z axis simultaneously to perform Guilloche or Rose Engine turning.
Peter_Cassar wrote: OK that makes sense. I'll put some thought into gearing down the spindle. toothed belt reduction might even be the way to go on this machine, perhaps 2:1 or 3:1 is enough.
What model of lathe is it? There are possible solutions.
See, for example the epicyclic back-gear here: www.lathes.co.uk/latheparts/page4.html
Or this solution: