On 3 March 2011 16:53, Jon Elson <el...@pico-systems.com> wrote: > I STILL don't like it. You need a HAL component that looks at commanded > position > (comes from axis.8.motor-pos-cmd, I think) and compares current to last > position.
Whilst also not liking it, this custom HAL component would do the trick: (It needs to be compiled with comp --install timeout.comp) component timeout """Reduces motor command to a predetermied value after a certain number of seconds of no axis motion"""; pin in float position-command-in "link to motor-pos-cmd"; pin in float current-in "link to the PID output"; pin out float current-out "link to the DAC"; param rw float timeout = 10 "timeout in seconds"; param rw float default-current = 0 "current output after timeout"; variable float old_pos; variable float t = 0; function _; license "GPL"; author "Andy Pugh"; ;; FUNCTION(_){ if (old_pos != position_command_in){ t = timeout; } else { t -= fperiod; } if (t < 0){ current_out = default_current; } else { current_out = current_in; } old_pos = position_command_in; } -- atp "Torque wrenches are for the obedience of fools and the guidance of wise men" ------------------------------------------------------------------------------ Free Software Download: Index, Search & Analyze Logs and other IT data in Real-Time with Splunk. Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. http://p.sf.net/sfu/splunk-dev2dev _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users