On Fri, 24 Jul 2020 at 22:26, Matthew Herd <[email protected]> wrote:

> In your second video you mention that the step generator for the rotary axis 
> is tied to the spindle motion.  What HAL pins need to be connected?  Do you 
> have an interface with a selectable ratio or do you just change the ratio in 
> the HAL file?

There is some info here: http://wiki.linuxcnc.org/cgi-bin/wiki.pl?Hobbing

But currently I use a custom HAL component too. This allows me to also
jog the A axis (useful for re-cutting a gear)

component hobbing "synchronise a rotary axis to the spindle";

pin in float teeth;
pin in float starts = 1;
pin in float spindle-pos;
pin in float spindle-vel;
pin in float A-pos-cmd;
pin in float gear-pos-fb;

pin out float gear-pos;
pin out float gear-vel;
pin out float A-pos-fb;

author "andypugh";
license "GPL v2+";

function _;

;;

FUNCTION(_){
    static double pos_ref;
    static double spindle_ref;
    static int old_teeth;

    if (old_teeth != teeth){
        pos_ref = gear_pos_fb;
        spindle_ref = spindle_pos;
        old_teeth = teeth;
    }
    if (teeth != 0) {
        gear_pos = pos_ref + 360*starts*(spindle_pos -
spindle_ref)/teeth + A_pos_cmd;
        gear_vel = spindle_vel / teeth;
        A_pos_fb = gear_pos_fb - pos_ref - 360*starts*(spindle_pos -
spindle_ref)/teeth;
    } else {
        gear_pos = pos_ref + A_pos_cmd;
        gear_vel = 0;
        A_pos_fb = gear_pos_fb - pos_ref;
    }
}


-- 
atp
"A motorcycle is a bicycle with a pandemonium attachment and is
designed for the especial use of mechanical geniuses, daredevils and
lunatics."
— George Fitch, Atlanta Constitution Newspaper, 1912


_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to