THC Component

More
13 Mar 2012 14:37 - 13 Mar 2012 14:38 #18581 by BigJohnT
THC Component was created by BigJohnT
Hi Guys,

A long time ago I cobbled up a THC component to use with my Mesa THC-AD card. It works for the most part, but I know it can work much better if I can incorporate PID into it. I'm kinda stuck and need some help or a push to get this to work with PID. I think it would be simpler from a user stand point to have the PID a part of the component instead of having to use an external PID...

File Attachment:

File Name: thc.comp
File Size:4 KB


Thanks
John
Attachments:
Last edit: 13 Mar 2012 14:38 by BigJohnT.

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

More
13 Mar 2012 15:35 #18582 by PCW
Replied by PCW on topic Re:THC Component
Maybe a first step to try would be just a simple P loop where you replace
the constant "correction_vel" with the actual voltage error (scaled by PGain)
so the correction is Proportional to the error.

that is, replace this:

if(torch_on && arc_ok && vel_status){ // allow correction
if((volts + voltage_tol) > volts_requested){
offset -= correction_vel;
}
if((volts - voltage_tol) < volts_requested){
offset += correction_vel;
}

with this:

if(torch_on && arc_ok && vel_status){ // allow correction
if abs(volts_requested - volts) > voltage_tol {
offset += (volts_requested - volts)*PGain;
}
}

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

More
13 Mar 2012 15:44 #18583 by BigJohnT
Replied by BigJohnT on topic Re:THC Component
Thanks Peter,

I'll give that a try here in a bit.

John

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

More
13 Mar 2012 16:54 #18586 by PCW
Replied by PCW on topic Re:THC Component
I _think_ I got the drive direction right so be careful...

Also the next step would be a bound on the velocity,
that is bound the output of the "P" loop = (volts_requested - volts)*PGain;
so large voltage errors dont request greater than some maximum velocity

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

More
13 Mar 2012 17:18 #18587 by BigJohnT
Replied by BigJohnT on topic Re:THC Component
It has a floating head so I can't damage it...

Thanks
John

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

More
22 Mar 2012 00:45 #18693 by tensaiteki
Replied by tensaiteki on topic Re:THC Component
I hope this is an acceptable thread to put this in...

I'm having trouble getting my HAL file setup correctly with the THC component. I have the touch probe, arc-ok, and THC encoder set up and working, but I'm lost as to how to get the THC to take control of the Z-axis. I'm kind of a HAL n00b as all the other machines I've built only required minor tweaks to the ini files.

Here's the part of the HAL that deals with the Z-axis (obviously I have no idea what I'm doing):
#*******************
#  AXIS Z
#*******************

# Step Gen signals/setup

setp   hm2_5i25.0.stepgen.02.dirsetup        [AXIS_2]DIRSETUP
setp   hm2_5i25.0.stepgen.02.dirhold         [AXIS_2]DIRHOLD
setp   hm2_5i25.0.stepgen.02.steplen         [AXIS_2]STEPLEN
setp   hm2_5i25.0.stepgen.02.stepspace       [AXIS_2]STEPSPACE
setp   hm2_5i25.0.stepgen.02.position-scale  [AXIS_2]STEP_SCALE
setp   hm2_5i25.0.stepgen.02.step_type        0
setp   hm2_5i25.0.stepgen.02.control-type     0
setp   hm2_5i25.0.stepgen.02.maxaccel        [AXIS_2]MAX_ACCELERATION
setp   hm2_5i25.0.stepgen.02.maxvel          [AXIS_2]MAX_VELOCITY

net z-enable     axis.2.amp-enable-out =>  hm2_5i25.0.stepgen.02.enable


# position command and feedback
# hijack position command and feed through thc
net z-pos-cmd thc.z-pos-in <= axis.2.motor-pos-cmd
net thc-pos-cmd thc.z-pos-out => hm2_5i25.0.stepgen.02.position-cmd
net z-pos-fb axis.2.motor-pos-fb <= thc.z-fb-out
#net z-pos-fb     axis.2.motor-pos-fb   <=  hm2_5i25.0.stepgen.02.position-fb
#net z-pos-cmd    axis.2.motor-pos-cmd  =>  hm2_5i25.0.stepgen.02.position-cmd
net z-enable     axis.2.amp-enable-out =>  hm2_5i25.0.stepgen.02.enable

With what I have now, I can start LinuxCNC, jog, home, and run g-code normally but the Z-axis never moves with the voltage (THC is enabled, machine is at velocity, and arc has transferred).

I'll also attach the full INI file. Also, in case it is relevant, I'm running gantrykins (dunno, if it conflicts or something with the THC control).

File Attachment:

File Name: cncplasma.ini
File Size:4 KB
Attachments:

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

More
22 Mar 2012 03:10 #18696 by PCW
Replied by PCW on topic Re:THC Component
theres no any indication of the THCs connections here

(man THC shows the basic connections)

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

More
22 Mar 2012 04:19 #18701 by tensaiteki
Replied by tensaiteki on topic Re:THC Component
In this comment in another thread -> www.linuxcnc.org/index.php/english/compo...atid=27&id=3980#4002 <- BigJohnT attached a plasma.zip file that includes the HAL file he uses on his plasma (plasma.hal). The Z-axis section in his HAL contains lines that according to the coments "hijack position command and feed through thc":
# position command and feedback
# hijack position command and feed through thc
net emcmot.02.pos-cmd thc.z-pos-in <= axis.2.motor-pos-cmd
net thc-pos-cmd thc.z-pos-out => hm2_[HOSTMOT2](BOARD).0.stepgen.02.position-cmd
net motor.02.pos-fb axis.2.motor-pos-fb <= thc.z-fb-out

Whereas, the corresponding Z-axis section from my HAL looked like this (before I started futzing around with it):
net z-pos-fb     axis.2.motor-pos-fb   <=  hm2_5i25.0.stepgen.02.position-fb
net z-pos-cmd    axis.2.motor-pos-cmd  =>  hm2_5i25.0.stepgen.02.position-cmd
net z-enable     axis.2.amp-enable-out =>  hm2_5i25.0.stepgen.02.enable

I just don't know the HAL code to know what I need to modify from that section to work with my setup, I'm pretty sure "emcmot.02.pos-cmd" is going to have to change since it doesn't appear anywhere else in my HAL file. Beyond that I don't even know where to begin modifying it.

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

More
22 Mar 2012 21:21 #18717 by BigJohnT
Replied by BigJohnT on topic Re:THC Component
Normally it is not good etiquette to hijack a thread but rather better to start your own so threads don't run on forever.

Are you enabling the thc component when your ready to use it? I have a pyvcp checkbox that is connected to thc.enable in my hal file. If you don't enable the thc component it simply passes the Z commanded position through to the stepgen.

All my config files are on my web site for my plasma.

Your hal connections seem to be correct.

John

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

Time to create page: 0.092 seconds
Powered by Kunena Forum