Eric H. Johnson wrote: > Here is the code, plus some debug I added (sorry about the formatting for > email): > > steps_per_sec_cmd = *s->hal.pin.velocity_cmd * > s->hal.param.position_scale; > > temp = steps_per_sec_cmd * (4294967296.0 / > (float)hm2->stepgen.clock_frequency); > if (temp != 0) > ERR("step_rate_reg = %d, steps_per_sec_cmd = %f, clock_frequency = %d", > temp, steps_per_sec_cmd, hm2->stepgen.clock_frequency); > > hm2->stepgen.step_rate_reg[i] = steps_per_sec_cmd * (4294967296.0 / > (float)hm2->stepgen.clock_frequency); > > This code gets run when I do a machine on (enable). My debug shows > Hm2->stepgen.clock_frequency at 0 at this point, hence should result in a > divide by zero.
Strange, clock_frequency should never be 0. It comes straight out of the IDROM. Hold on, there's one place where I'm missing a clock-related sanity check, I'll add it now... Ok done. The %f may be confusing things, IIRC rtapi_print_msg(), which is what ERR() calls, doesnt support printing floats. If you dump-state ("setp hm2_5i20.0.raw.dump-state 1") it prints the clock frequency it's using properly. Would you see if you can trigger this problem without running emc, by loading the driver and setting up the HAL stuff "manually"? That's how I do my testing here and I've never seen a runaway. -- Sebastian Kuzminsky Theo: "Julian? I haven't seen you in twenty years. You look good. The picture the police have of you doesn't do you justice." Julian: "What do the police know about justice?" ------------------------------------------------------------------------- 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-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers