On Thu, 2007-08-23 at 18:13 -0400, Stephen Wille Padnos wrote: ... snip Just using wsum made a big difference in the shell script. I was consistently just one tool position off with the rotate direct to station routine, and it only gets better from here.
> If the > turret can't move in both directions, then you can do the whole thing > with HAL components - no classicladder needed. You'll have to write a > simple component to compare two s32 numbers (strange but true - there's > an 8-bit pattern match with cascade input component, but no integer > comparison :) ) Look at something like xor2.comp for an example of a > simple .comp component. Like this? ~~~~~ s32equal.comp ~~~~~ component s32equal "Check if two s32's are equal"; pin in s32 in0; pin in s32 in1; pin out bit out; function _ nofp; license "GPL"; ;; FUNCTION(_) { if (in0 == in1) out = 0; else out = 1; } ~~~~~ s32equal.comp ~~~~~ then recompile EMC or just the component? > use debounce / weighted_sum to get a stable position reading (current_tool) > use tool_change AND NOT (requested_tool == current_tool) to enable the > turret to index > (AND and NOT are both HAL components already, and there are other logic > components) > > I think that's about it. Another option is to just write a .comp to do > it all - take in 4 bits, the requested tool number, and the > tool-prep/tool-change signals, output tool_prepped/tool_changed and > turret controls. Then forget the M101 and tie into the pins used by M6, as nature had intended. > The comp preprocessor really helps make this kind of > HAL component easy to write. > > - Steve ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users