THC control

More
09 Nov 2010 17:27 #5179 by brianm
THC control was created by brianm
I am slowing learning EMC2 and have a few questions on THC.

I have a plasma machine that works good. I have successfully connected the ARKOK signal and it works. I have made a few parts. I am now trying to move the Z-Axis up and down with a THC unit. (It is a THC 300 from Cambell designs).

I have tried to follow the wiki and the examples but seem to be missing something.

From what i understand i have to decouple the axis.2.motor-pos-cmd from the stepgen.2.position-cmd

Which i have done with the following lines:

net zpos-cmd <= axis.2.motor-pos-cmd
net zpos-cmd-final => stepgen.2.position-cmd

I then create a move up bit and move down bit. Currently I have them connected to 2 switches I hold in my hand, when it works I will connect it to the correct pins on the THC unit.

newsig TorchMoveUp bit
linksp TorchMoveUp classicladder.0.out-13
newsig TorchMoveDown bit

linksp TorchMoveDown classicladder.0.out-12

I also create the max and minmum distance to move

newsig ZMinCord float
sets ZMinCord -0.15

newsig ZMaxCord float

sets ZMaxCord 1.0

I then set the maximum and minimum distances to move
linksp ZMaxCord sum2.0.in0
linksp zpos-cmd sum2.0.in1
linksp Absolute_Max sum2.0.out

linksp ZMinCord sum2.0.in0
linksp zpos-cmd sum2.0.in1
linksp Absolute_Min sum2.0.out


I then use a mux4 to select. If TorchMoveUp is selected I go to the absolute_Max, if TorchMoveDown is high, I go toward the absolute min.
linksp zposcommand => mux4.0.in0

linksp Absolute_Min => mux4.0.in2

linksp Absolute_Max => mux4.0.in1

linksp TorchMoveUp mux4.0.sel0

linksp TorchMoveDown mux4.0.sel1
linksp zpos-cmd-final mux4.0.out

From following the dallar example, I thought this was basically how it worked... However, I run a program everything is fine, then I press the switch to move up, it moves up a tiny amount and then gives me a joint following error.

A couple of things I am confused on, what is the feedrate it will be moving? The feedrate given in the program?
If I find my min and max from a sum command of the zpos command, will this change as the z pos command changes.

I do not have a float switch, so I set the zero of my torch to the top of the material. Command it to go to a certain height, it pierces through and then i want to invoke the Torch height control.

Any help would be appreciated. Thanks
Brian

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

More
09 Nov 2010 20:01 #5186 by andypugh
Replied by andypugh on topic Re:THC control
Have you considered using the THC HAL component?
www.linuxcnc.org/docview/html//man/man9/thc.9.html

Your following error is because the stepgen feedback signal no longer needs matches the command signal. Ideally you need to subtract the THC offset from the stepgen feedback before passing it to the axis-fb pin. The THC HAL component does this, but might not suit your inputs.

I get very confused by the old-school newsig / linksp / linkps format, but let me have a look.
newsig TorchMoveUp bit
linksp TorchMoveUp classicladder.0.out-13
newsig TorchMoveDown bit
linksp TorchMoveDown classicladder.0.out-12
inksp TorchMoveUp mux4.0.sel0
linksp TorchMoveDown mux4.0.sel1

These lines could be combined as:
net TorchMoveDown classicladder.0.out-12 => mux4.0.sel1
net TorchMoveUp classicladder.0.out-13 => mux4.0.sel0
sets ZMinCord -0.15
sets ZMaxCord 1.0
linksp ZMaxCord sum2.0.in0
linksp zpos-cmd sum2.0.in1
linksp Absolute_Max sum2.0.out
linksp ZMinCord sum2.0.in0
linksp zpos-cmd sum2.0.in1
linksp Absolute_Min sum2.0.out

You are setting sum2.0.in0 to both Zmin and Zmax there, and linking zpos-cmd twice. That is probably an error.

Also, You can set the sum2 pins directly if you want, ie
newsig ZminCord
sets ZMinCord -0.15
linksp ZMinCord sum2.0.in0
can just be
setp sum2.0.in0 -0.15

From following the dallar example, I thought this was basically how it worked... However, I run a program everything is fine, then I press the switch to move up, it moves up a tiny amount and then gives me a joint following error.


The quick and dirty solution would be to loop the axis feedback to itself, ie
net zpos-cmd axis.2.motor-pos-cmd axis.2.motor-pos-fb

But ideally you want to arrange to feedback the stepgen feedback with the THC offset subtracted, which will give you proper f-error detection of the commanded step rate exceeds what the stepgen can follow. (this is set only by the base thread period, and the axis limits are probably much, much, lower)

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

More
09 Nov 2010 22:18 #5188 by brianm
Replied by brianm on topic Re:THC control
I was looking at the THC component and that looks exactly like what I need. However, it looks like I need to bring a scaled down voltage from the tip into this component. It does not look like it has a bit for just move up or down if you have an external box that sends those signals.

Would it be reasonable to just use some hal components and "fake" the voltage going into the THC component. Where if my external box says move up I could put a 6 into the THC component voltage and if it says move down I could put a 4 and have 5 when it is the correct height. Not sure if this makes sense, but I would rather use the component if possible.

Thanks for the help.

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

More
09 Nov 2010 22:26 #5190 by andypugh
Replied by andypugh on topic Re:THC control
It might be simpler to edit the thc component and re-compile it.

You will find the current version at:
git.linuxcnc.org/gitweb?p=emc2.git;a=blo...02fa7bb54473;hb=HEAD

You can edit that, then recompile with
comp --install thc.comp

You might need to sudo that, and you might need to sudo apt-get install emc2-dev to get comp to work, but other than that it should be straightforward.

There are bit-type input pin declarations to copy, and the C-code function is quite short.

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

More
10 Nov 2010 00:44 #5193 by BigJohnT
Replied by BigJohnT on topic Re:THC control
Brian,

At one point in time I did play with an up/down THC component for "smart" THC boxes but never did finish it . The current THC uses a velocity from the Mesa THC card that converts the voltage to pulses and it is what I use on my plasma table. An up/down one would be fairly easy to mod from the current THC comp. Andy is correct and you have to hijack the position and sub your own and lie about the feedback and say it is where EMC wants it to be.

John

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

More
05 Dec 2010 13:05 #5867 by hominux
Replied by hominux on topic Re:THC control
Hello

I am a new user interested to use EMC with a plasma table THC .
I am tecnichian in electronics more than software developer , so is a liitle bit difficult for me change configuration .
I was reading about the HAL THC component and I am very intersted to use it .
Now my question is ...
It is necessary to use mesa board or can we use a small hardware ( voltage controlled oscillator )
to give the signal on the parallel port for THC control ?
Can we use ( as an example ) spindles inputs to "read" the torch volts ?
If some electronics is needed I will be happy to develop an open source schematic for that :-)

Best regards to all
Roberto

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

Time to create page: 0.129 seconds
Powered by Kunena Forum