THC control
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.
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
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.
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.
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.
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.
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.
You do not need the mesa board, I use a parallel port. However, I do not read the voltage. I think the easiest thing for you to do is probably develop some hardware that will read the voltage and then decide whether to move up or down and send a signal to the computer on what to do, (since that is your strong point). That is basically what I do. I bought a THC controller from Campbell Designs and then connected that to the parallel port. I then modified the THC component per the suggestion by andypugh. I am by no means a great programmer, but it was fairly simple and it works fine for me. I can post it later if you like - I do not have it at this computer. One thing I am learning about EMC is you can basically do anything you want.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Thanks for your answer . I was looking ( a lot ! ) in the web how to modify the thc component .
Basically I understand that may be changed and recompiled for suit the needs , but when I was trying to find more info i did not find nothing for a beginner .
Reading your reply and the reply from PCW ( many thanks too ) I come with a different appproach .
Would be relatively easy use the component input and "read analog values" like usb joisticks but I do not know the resolution and speed of this converters.
Also using Arduino to make the A/D conversion and why not something else like torch on, comparations etc...
There are also inxpensives USB SOUND CARDS that usually dont have ac coupling letting use them for dc A/D conversion ( but I dont know if HAL can use them.
At the end I think I will follow your idea !
Just will make a small external comparator and drive the voltage comparation from a parallel port pin (PWM) to set the voltage from Axis UI.
I will try also an experimental way to have the ARK_OK signal from the torch volt ( when working with a good ark I never saw voltages less than 80 v and more than 150 v )
Another experimental idea is to read the ARC_OK - UP - DOWN signals with just two pins ( when UP and Down signals are active will mean ARC_NO_OK ).
Now the big problem for me !
I NEED/WANT to learn how modify the thc component to do that.
Any help wil be greatly apreciated .
If everithing goes well I will be proud to post the hardware schematics and send some prototypes
Best regards
Roberto
Please Log in or Create an account to join the conversation.
Now the big problem for me !
I NEED/WANT to learn how modify the thc component to do that.
Any help wil be greatly apreciated .
This page explains how comp works, and how to recompile and install:
linuxcnc.org/docs/html/hal_comp.html
Basically make the changes you want to thc.comp then type comp --install thc.comp
Please Log in or Create an account to join the conversation.