Matthew Glenn Shaver wrote:
> On Mon, 2007-03-19 at 08:04 -0500, Stuart Stevenson wrote:
>> I would end up with a control display for every operator. How fun
>> would that be? 
> 
> A lot of fun! ;)
> 
> ************************
> ;Jog wheel algorithm
> 
> ;Initial state
> accumulated_clicks = jog_wheel_position
> direction = 0
> 
> while (jog_wheel_enabled) {
> 
>  if (jog_wheel_position != accumulated_clicks) {
> 
> ;start moving
>   if (jog_wheel_position > accumulated_clicks) {
>    commanded_position++
>    direction = 1
>   } else {
>    commanded_position--
>    direction = -1
>   }
> 
> ;ignore further clicking in the same direction
> ;while axis is not in deceleration
>   while (!selected_jog_axis_decelerating) {
>    if (
>     (jog_wheel_position > accumulated_clicks && direction = -1)
>     ||
>     (jog_wheel_position < accumulated_clicks && direction = 1)
>        ) {
>     next
>    }
>    accumulated_clicks = jog_wheel_position
>   };while not in decel
> 
>  };if jwp != ac
> 
> };while(1)
> ************************
> 
> I thought this was going to be more complex, but I guess this is how I
> think it should work. It kind of mimics how we accelerate & brake a car;
> a bangbang velocity controller with human reaction time hysteresis.
> 
> Your thoughts?
> 
> Matt

The more I think about this, the more I like the "timeout" approach.
Think in terms of the "either wind up a spring, or slip" choice that I 
mentioned elsewhere in this thread.  The timeout method waits until the 
last possible instant before it "slips".  When you are turning, even if 
you turn too fast, it never discards a click.  It always "winds up the 
spring".  Only after you have stopped turning the wheel does it say "its 
taking too long to unwind the spring, stop (slip) now (and lose position)".

Regards,

John Kasunich

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to