On Sun, 10 Jan 2021 at 19:03, Andreas Linnarsson <andreas.linnars...@gmail.com> wrote: > > Well, it all comes from the "sim/axis/vismach/VMC_toolchange" example in > LinuxCNC 2.8. I just implemented it as it was used there,
But that is running a complex cycle of (simulated) pneumatics and sensors. It shouldn't be necessary and doesn't seem to be helping. From what you have shown so far it is sending the pocket number out via an analogue output, and wrongly. > I will try your simplified HAL configuration to if it works but to be > honest I'm having trouble getting my head around how it's supposed to work > if the carousel doesn't ignore the first pocket trigger when changing > pocket. Adding one to the target it will behave physically correct but it > will not *carousel.**N**.ready* not be set high due to some other > discrepancy i suppose. The change that I suggested was meant to make it ignore the high-to-low transition when moving backwards. This in turn should mean that the extra low-to-high is not seen. However I think that there is a flaw in my logic. old_index will hold the previous high value during the reversal, but will reset to low as soon as motor-fwd is set. Try moving the old_index update line: case 'E': // index + position, both edges. p = current_position; if (homed){ if ( old_index != sense(1) ){ if (motor_fwd){ p += 1; if (p > inst_pockets) p -= inst_pockets; } if (motor_rev) { p -= 1; if (p < 1) p += inst_pockets; } // Fix for unidirectional changers with a latch if (inst_dir == 2 || motor_fwd) old_index = sense(1); } } break; -- 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