I've changed the subject line to more reflect the information I'm after. So far I've been working through hal_parport.c, encoder.c, motion.c, stepgen.c control.c and command.c.
I believe this function is called at the SERVO_PERIOD rate. void emcmotCommandHandler(void *arg, long period) The switch statement on emcmotCommand->command has case EMCMOT_SPINDLE_ON : and this fragment emcmotStatus->spindle_status[spindle_num].speed = emcmotCommand->vel; emcmotStatus->spindle_status[spindle_num].css_factor = emcmotCommand->ini_maxvel; emcmotStatus->spindle_status[spindle_num].xoffset = emcmotCommand->acc; if (emcmotCommand->vel >= 0) { emcmotStatus->spindle_status[spindle_num].direction = 1; } else { emcmotStatus->spindle_status[spindle_num].direction = -1; } emcmotStatus->spindle_status[spindle_num].brake = 0; //disengage brake emcmotStatus->atspeed_next_feed = emcmotCommand->wait_for_spindle_at_speed; But I don't see where emcmotCommand->command is changed. Need to take a break from this. John > > Thanks Andy, > Just more and more complicated. Need to take a step back and just figure out > how encoder edges seen as 1's and 0's in > hal_parport.c turn into spindle velocity. > And in the other direction how a S600 ends up as the PWM 1's and 0's in > hal_parport.c. > John Dammeyer > > > > -----Original Message----- > > From: andy pugh [mailto:bodge...@gmail.com] > > Sent: May-08-20 4:08 AM > > To: Enhanced Machine Controller (EMC) > > Subject: Re: [Emc-users] Sourced from: Re: Fluctuating RPM using CUI ATM 10 > > encoder > > > > On Fri, 8 May 2020 at 03:42, John Dammeyer <jo...@autoartisans.com> wrote: > > > > > Do you know which source code file has the G33.1 control? I'd like to > > > look at how it's done. > > > > It's one of the more deeply-embedded ones as it needs to do a lot of > > work in the realtime context. > > > > interp: > > https://github.com/LinuxCNC/linuxcnc/blob/master/src/emc/rs274ngc/interp_convert.cc#L4764 > > > > TP: https://github.com/LinuxCNC/linuxcnc/blob/master/src/emc/tp/tp.c#L1460 > > > > TC: It is scattered all through tc.c, search for "rigid" in the file: > > https://github.com/LinuxCNC/linuxcnc/blob/master/src/emc/tp/tc.c#L826 > > > > -- > > 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 > > Emc-users@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/emc-users > > > > _______________________________________________ > Emc-users mailing list > Emc-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/emc-users _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users