What HAL function to use.

More
20 Oct 2010 02:52 #4752 by aike
Hi!
I need to switch on lube one time in 1 hour. I know how to extend impulse - I use "oneshot" function.
But what need I use to call the impulse once in hour?
The lengh of impulse independent, so as "oneshot" can extend it as so as I need.

Please Log in or Create an account to join the conversation.

More
20 Oct 2010 09:18 #4754 by andypugh
aike wrote:

But what need I use to call the impulse once in hour?.


I haven't tried it, but I think you should be able to use "timedelay" if you hook it back in to itself with a "not"

loadrt timedelay count=1
loadrt not count=1

addf timedelay.0 servo-thread
addf not.0 servo-thread

setp timedelay.0 on-delay 3540
setp timedelay.0 off-delay 60

net lube-not timedelay.0.out not.0.in
net lube not.0.out => timedelay.0.in parport.0.pin-X-out

This sets up timedelay to be on for nearly an hour and off for a minute. The output is inverted, and fed back to the input and also to the lube pump pin.
(I use the inverted output for the pump so that when the function starts up "off" it initially turns the pump "on")

I think you could also use a stepgen function in velocity mode, or one pin of a sim_encoder, or a function generator (but that would need type-converting from float to bit)

Please Log in or Create an account to join the conversation.

More
20 Oct 2010 10:27 #4755 by BigJohnT
I use Classicladder to control my oil pump.

www.linuxcnc.org/docview/html//ladder_cl...c_ladder.html#r1_7_2

Just create a 60 minute timer and at some point use a compare to turn on your output.

John

Please Log in or Create an account to join the conversation.

More
21 Oct 2010 15:20 #4779 by aike
Replied by aike on topic Re:What HAL function to use.
andypugh wrote:

aike wrote:

But what need I use to call the impulse once in hour?.


I haven't tried it, but I think you should be able to use "timedelay" if you hook it back in to itself with a "not"

loadrt timedelay count=1
loadrt not count=1

addf timedelay.0 servo-thread
addf not.0 servo-thread

setp timedelay.0 on-delay 3540
setp timedelay.0 off-delay 60

net lube-not timedelay.0.out not.0.in
net lube not.0.out => timedelay.0.in parport.0.pin-X-out

This sets up timedelay to be on for nearly an hour and off for a minute. The output is inverted, and fed back to the input and also to the lube pump pin.
(I use the inverted output for the pump so that when the function starts up "off" it initially turns the pump "on")

I think you could also use a stepgen function in velocity mode, or one pin of a sim_encoder, or a function generator (but that would need type-converting from float to bit)

I have just done it. It'l look like 2 AND-NOT square oscilator :)
But may be there are instant function:)

Please Log in or Create an account to join the conversation.

Time to create page: 0.147 seconds
Powered by Kunena Forum