Skip to content

Commit 7ef7086

Browse files
committed
Merge remote-tracking branch 'origin/2.9'
* origin/2.9: document the `homed` field of the `linuxcnc` python module Remove feral debug print Fix for #2410 mesa_modbus: Only wait between packets that cause a write
2 parents 71d5081 + 582a144 commit 7ef7086

4 files changed

Lines changed: 20 additions & 12 deletions

File tree

src/emc/rs274ngc/interp_convert.cc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5290,11 +5290,10 @@ The approach to operating in incremental distance mode (g91) is to
52905290
put the the absolute position values into the block before using the
52915291
block to generate a move.
52925292
5293-
In inverse time feed mode, a lower bound of 0.1 is placed on the feed
5294-
rate so that the feed rate is never set to zero. If the destination
5295-
point is the same as the current point, the feed rate would be
5296-
calculated as zero otherwise.
5297-
5293+
If the destination point is the same as the current point, the feed rate
5294+
will be calculated as zero, so a default of 0.1 is applied in this case
5295+
(It doesn't matter how wrong the feed rate is on a zero-length move)
5296+
52985297
If cutter compensation is in use, the path's length may increase or
52995298
decrease. Also an arc may be added, to go around a corner, before the
53005299
straight move. For the purpose of calculating the feed rate when in

src/emc/rs274ngc/interp_inverse.cc

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,13 @@ int Interp::inverse_time_rate_arc(double x1, //!< x coord of start point of
6262
if (settings->feed_mode != INVERSE_TIME) return -1;
6363

6464
length = find_arc_length(x1, y1, z1, cx, cy, turn, x2, y2, z2);
65-
rate = std::max(0.1, (length * block->f_number));
65+
if (length == 0){
66+
rate = 0.1; // See https://github.com/LinuxCNC/linuxcnc/issues/2410
67+
} else {
68+
rate = length * block->f_number;
69+
}
6670
enqueue_SET_FEED_RATE(rate);
6771
settings->feed_rate = rate;
68-
6972
return INTERP_OK;
7073
}
7174

@@ -120,8 +123,12 @@ int Interp::inverse_time_rate_straight(double end_x, //!< x coordinate of en
120123
cx, cy, cz,
121124
settings->AA_current, settings->BB_current, settings->CC_current,
122125
settings->u_current, settings->v_current, settings->w_current);
123-
124-
rate = std::max(0.1, (length * block->f_number));
126+
if (length == 0){
127+
rate = 0.1; // See https://github.com/LinuxCNC/linuxcnc/issues/2410
128+
} else {
129+
rate = length * block->f_number;
130+
}
131+
125132
enqueue_SET_FEED_RATE(rate);
126133
settings->feed_rate = rate;
127134

src/emc/usr_intf/axis/extensions/emcmodule.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,9 @@ static PyGetSetDef Stat_getsetlist[] = {
805805
{(char*)"din", (getter)Stat_din},
806806
{(char*)"dout", (getter)Stat_dout},
807807
{(char*)"gcodes", (getter)Stat_activegcodes},
808-
{(char*)"homed", (getter)Stat_homed},
808+
{(char*)"homed", (getter)Stat_homed, (setter)NULL,
809+
(char*)"An array of integers indicating the 'homed' status of each joint (0 or 1)."
810+
},
809811
{(char*)"limit", (getter)Stat_limit},
810812
{(char*)"mcodes", (getter)Stat_activemcodes},
811813
{(char*)"misc_error", (getter)Stat_misc_error},

src/hal/drivers/mesa-hostmot2/modbus/mesa_modbus.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ int send_modbus_pkt(hm2_modbus_inst_t *inst){
472472
rtapi_u16 checksum;
473473
rtapi_u16 fsizes[1];
474474
rtapi_u8 frames;
475-
int i;
475+
int i;
476476

477477
checksum = RTU_CRC(ch->data, ch->ptr + 1);
478478
ch->data[++(ch->ptr)] = checksum & 0xFF;
@@ -517,7 +517,6 @@ void process(void *arg, long period) {
517517
case START:
518518

519519
if (inst->hal->rate > 0 && (timer -= period) > 0) break;
520-
timer = 1e9 / inst->hal->rate;
521520

522521
rtapi_print_msg(RTAPI_MSG_INFO, "START txstatus = %08X rxstatus = %08X\n", txstatus, rxstatus);
523522

@@ -538,6 +537,7 @@ void process(void *arg, long period) {
538537
if (build_data_frame(inst)){ // if data has changed
539538
r = send_modbus_pkt(inst);
540539
inst->state = WAIT_FOR_SEND_BEGIN;
540+
timer = 1e9 / inst->hal->rate;
541541
}
542542

543543
break;

0 commit comments

Comments
 (0)