Sebastian,
As a first look into the hostmot2 driver, it looks to me like something
funny is going at the end of the function
"hm2_stepgen_instance_prepare_tram_write" in the hostmot2 version of
stepgen.c, specifically it looks like you can get a divide by zero.
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.
Steps_per_sec_cmd is also 0.0, however the debug variable temp (u32) ends up
being 1610612.
However something funny is going on with the numbers getting displayed,
because if I trap for clock_frequency = 0 or steps_per_sec_cmd = 0.0 and
assign step_reg_rate to 0 in those cases, I am still getting non zero values
which are not getting trapped, and hence still generating a pulse train, and
the resultant following error.
Regards,
Eric
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers