HAL newbie struggling with debounce set up
03 Dec 2015 22:27 #66328
by cmtunnel
HAL newbie struggling with debounce set up was created by cmtunnel
I am having trouble understanding how to load and use debounce.
I'm entering:
cd linuxcnc
halrun
loadrt debounce
at this point i'm getting an error......could not insert module.......operation not permitted
not good with the terminal yet
I'm entering:
cd linuxcnc
halrun
loadrt debounce
at this point i'm getting an error......could not insert module.......operation not permitted
not good with the terminal yet
Please Log in or Create an account to join the conversation.
03 Dec 2015 23:49 #66334
by andypugh
You don't actually need to cd to linuxcnc, though that is irrelevant.
If you type "man debounce" (in a separate terminal, not the halrun one) then you will see this page which says that the loadrt line is
In man-page format [this is optional] and ... means "as many as you want"
So, to load 3 debounces that will all have the same debounce time:
don't forget also, if you want to see it working
Replied by andypugh on topic HAL newbie struggling with debounce set up
cd linuxcnc
halrun
loadrt debounce
at this point i'm getting an error......could not insert module.......operation not permitted
You don't actually need to cd to linuxcnc, though that is irrelevant.
If you type "man debounce" (in a separate terminal, not the halrun one) then you will see this page which says that the loadrt line is
loadrt debounce cfg=size[,size,...]
In man-page format [this is optional] and ... means "as many as you want"
So, to load 3 debounces that will all have the same debounce time:
loadrt debounce cfg=3
show pin
show param
don't forget also, if you want to see it working
loadrt threads
addf debounce.0 thread1
start
Please Log in or Create an account to join the conversation.
04 Dec 2015 02:15 #66346
by cmtunnel
Replied by cmtunnel on topic HAL newbie struggling with debounce set up
I can't see it doing anything but I don't know what to look for. I will need this to run all the time for my limit switches. How do I set it up so that it runs inside linuxcnc? Or does it do that automatically?
Please Log in or Create an account to join the conversation.
04 Dec 2015 11:44 #66367
by andypugh
If you want to have this running in LinuxCNC , then you add the commands to the HAL file (except for the loadrt threads and start commands, those are handled by LinuxCNC)
You will need to change signal and pin names to suit your actual HAL file, of course.
Replied by andypugh on topic HAL newbie struggling with debounce set up
I can't see it doing anything but I don't know what to look for. I will need this to run all the time for my limit switches. How do I set it up so that it runs inside linuxcnc? Or does it do that automatically?
If you want to have this running in LinuxCNC , then you add the commands to the HAL file (except for the loadrt threads and start commands, those are handled by LinuxCNC)
loadrt debounce cfg=3
...
addf debounce.0 base-thread
setp debounce.0.delay 15
...
net switch-raw parport.0.pin-00-in => debounce.0.in
net switch-debounced debounce.0.out axis.0.pos-lim-sw-in axis.0.neg-lim-sw-in axis.0.home-sw-in
...
You will need to change signal and pin names to suit your actual HAL file, of course.
Please Log in or Create an account to join the conversation.
04 Dec 2015 17:34 #66398
by cmtunnel
Replied by cmtunnel on topic HAL newbie struggling with debounce set up
so:
net switch-raw hm2_5i25.0.0.input-00-not => debounce.0.in
net switch-debounced debounce.0.out axis.0.pos-lim-sw-in axis.0.neg-lim-sw-in axis.0.home-sw-in
and then the same for y and z except 1's and 2's
net switch-raw hm2_5i25.0.0.input-01-not => debounce.1.in .................and so on??
net switch-raw hm2_5i25.0.0.input-00-not => debounce.0.in
net switch-debounced debounce.0.out axis.0.pos-lim-sw-in axis.0.neg-lim-sw-in axis.0.home-sw-in
and then the same for y and z except 1's and 2's
net switch-raw hm2_5i25.0.0.input-01-not => debounce.1.in .................and so on??
Please Log in or Create an account to join the conversation.
04 Dec 2015 17:59 #66399
by andypugh
Replied by andypugh on topic HAL newbie struggling with debounce set up
[quote="cmtunnel" post=66398.and so on??[/quote]
Yes.
You will have to remove/alter any existing HAL lines that conflict. (ie, try to net the same pins)
Yes.
You will have to remove/alter any existing HAL lines that conflict. (ie, try to net the same pins)
Please Log in or Create an account to join the conversation.
04 Dec 2015 18:27 #66400
by cmtunnel
Replied by cmtunnel on topic HAL newbie struggling with debounce set up
won't start yet but here's the .hal
it doesn't like the addf but im looking into it now.
it doesn't like the addf but im looking into it now.
Please Log in or Create an account to join the conversation.
04 Dec 2015 19:16 #66402
by cncbasher
Replied by cncbasher on topic HAL newbie struggling with debounce set up
you have a typo it should be debounce.0.0.in & debounce.0.0.out etc
The following user(s) said Thank You: Alicee
Please Log in or Create an account to join the conversation.
04 Dec 2015 19:49 #66405
by andypugh
Ah yes.
cfg=1,2
would create input pins
debounce.0.0.in
debounce.1.0.in
debounce.1.1.in
All the debounce.0 has its own debounce time and debounce.1.0 and debounce.1.1 share a debounce time.
Replied by andypugh on topic HAL newbie struggling with debounce set up
you have a typo it should be debounce.0.0.in & debounce.0.0.out etc
Ah yes.
cfg=1,2
would create input pins
debounce.0.0.in
debounce.1.0.in
debounce.1.1.in
All the debounce.0 has its own debounce time and debounce.1.0 and debounce.1.1 share a debounce time.
Please Log in or Create an account to join the conversation.
04 Dec 2015 20:10 #66409
by cmtunnel
Replied by cmtunnel on topic HAL newbie struggling with debounce set up
I'm at a loss right now on this. i thought it was cfg=3. Could someone check my halfile please. thanks
Please Log in or Create an account to join the conversation.
Time to create page: 0.082 seconds