Greetings;

My own twisted logic says I should use an edge module, firing a oneshot to 
develop the stop signal where there is not one from the G33.1 cycle.  My 
current .hal has a reverse sequencer that works fine, but its totally 
dependent on having the M5 in the code to trigger the stop sequence.

It does this directly by resetting the flip-flop that controls the rest of 
the analog chain to the PID when motion.0.on goes false.  At that point, a 
one shot watching phaseA of the encoder functions as a timeout clock, re-
enabling the spindle_switch by clocking the state of motion.0.spindle-on 
into the flip-flop,  If it was a real stop, its ok, but if its true again 
when the timeout runs out, the analog chain to the spindle is re-enabled.  
The stop in any event must be long enough to reset the controllers safety 
start logic by cutting off the pwmgen long enough to do this, so the actual 
stop condition will probably be long enough to actually see that it has 
stopped for a good fraction of a second.

So if I use an edge to detect the rise of the motion.0-spindle-reverse, 
which will trigger another timeout, a .010 second or so, during which time 
the motion.0.spindle-on is gated off, that will fall thru and do the stop 
until the encoder is silent for enough milliseconds to indicate the stop 
had been done.

But I'll have to duplicate that, sensing the falling edge, triggering the 
one shot again to initiate the stop from the reverse state to turn it 
around and run fwd again.

Then finish it off with yet another flip-flop beside the one that gates the 
control signals, so that when that controlling one shot times out, the 
status of motion.0.spindle-reverse is clocked out to parport.0.pin_16 to 
complete the chain & actually tell it to reverse, or not.

That is two edge modules watching motion.0.spindle-reverse, 2 more 
oneshots, an AND or OR as the case may be to bring the oneshots together, 
and another flipflop to steer the parport "reverse" pin.

I'm going to need some excedrin before rockhopper prints me another hal map 
that works.  Sure thing :(

Can anyone short circuit and simplify this?

Thanks.

Cheers, Gene
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
My web page: <http://coyoteden.dyndns-free.com:85/gene> is up!
My views 
<http://www.armchairpatriot.com/What%20Has%20America%20Become.shtml>
To find out a girl's faults, praise her to her girl friends.
                -- Benjamin Franklin
A pen in the hand of this president is far more
dangerous than 200 million guns in the hands of
         law-abiding citizens.

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to