Manual tool change + tool lengh touch off

More
15 years 11 months ago #5670 by andypugh
debounce needs to be added to the hal file. The process is much the same for any HAL component.

1) load the component:
Code:
loadrt debounce cfg=1
This loads a 1 channel debounce called debounce.0

2) Make the debounce function run in the base thread:
Code:
addf debounce.0 base-thread

3) set the debounce time:
Code:
setp debounce.0.delay 10

4) put the debounce between the parport and the probe input
Code:
net probe-raw parport.0.pin-10-in-not => debounce.0.0.in net probe-filtered debounce.0.0.out => motion.probe-input
The following user(s) said Thank You: Sadmeatball

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

More
15 years 11 months ago - 15 years 11 months ago #5671 by axel88
I had to change the last comands to:

setp debounce.0.delay 10
net probe-raw parport.0.pin-10-in-not => debounce.0.0.in
net probe-in <= debounce.0.0.out

otherwise I got errors. I hope the function is the same?
Last edit: 15 years 11 months ago by axel88.

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

More
15 years 11 months ago #5672 by andypugh
axel88 wrote:

which hal file?
/usr/share/emc/tcl/bin/halconfig.tcl?

EDIT: /home/axel/emc2/configs/Portalfrase/Portalfrase.hal looks good, right?


Yes, I came into the forum at a run to make sure you weren't about to do something silly.

(I had to delete your umlauts as the forum refuses to show any message with odd characters at all, including three full stops in a row, and the UK currency symbol)

You can either edit that file, or if it was created by stepconf you can put your new stuff in the custom.hal file where stepconf won't over-write it.

The drawback with putting it in the custom.hal file is that you might need to unlink some connections to insert your new stuff.
Code:
unlinkp parport.0.pin-10-on-not unlinkp motion.probe-input
Would do that.

HAL is one of the most powerful features of EMC2, it allows you to connect any inputs and any outputs together in a completely free way, optionally processing the signals on the way.

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

More
15 years 11 months ago - 15 years 11 months ago #5677 by axel88
1.) By moving the debounce procedure to the custom.hal I've got some errors:

CUSTOM.HAL (line 4 to 10)
Code:
unlinkp parport.0.pin-10-in-not unlinkp motion.probe-input loadrt debounce cfg=1 addf debounce.0 base-thread setp debounce.0.delay 10 net probe-raw parport.0.pin-10-in-not => debounce.0.0.in net debounce.0.0.out => motion.probe-input
ERROR:
Code:
(...) custom.hal:10: Signal name 'debounce:0.0.out must not be the same as pin. 8635 (...)
Last edit: 15 years 11 months ago by axel88.

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

More
15 years 11 months ago - 15 years 11 months ago #5678 by axel88
2.) I've got problems with the subprograms:

I wrote to files: first-tool.ngc and auto-tool-change.ngc and located them in ../emc/nc-files which is defined as the PROGRAM_PREFIX folder in the Portalfrase.ini .

when I run:
Code:
o<first-tool.ngc> call
or
Code:
o<first-tool> call
the error "File not open" appears.

here is my subprogramm:
Code:
o<first-tool> sub G90 G53 G0 Z0 G53 G0 X0 Y0 G91 G38.3 Z-180 F500 G38.5 Z10 F15 #1000=#5063 G90 G53 G0 Z100 G90 G53 G0 X50 Y50 o<first-tool> endsub M02

But even if I copy the fred.ngc example it doesn't work.
Last edit: 15 years 11 months ago by axel88.

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

More
15 years 11 months ago - 15 years 11 months ago #5681 by andypugh
axel88 wrote:

custom.hal:10: Signal name 'debounce:0.0.out must not be the same as pin.


Sorry, I didn't put the signal name in the net statement, so the interpreter is trying to use the first pin name as a signal name

You need something like

net FreelyChosenSignalName debounce.0.0.out => motion.probe-input

The signal names are conceptually equivalent to the colours of the wires in a physical system, you can choose any you want, but it helps understand the system if they match the function. (Also you can't have more than one signal with the same signal name)
Last edit: 15 years 11 months ago by andypugh.

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

Time to create page: 0.092 seconds
Powered by Kunena Forum