Flash Mesa board for 2 thcads

Linux CNC - Plasmac related questions, tips and topics can be posted here
Post Reply
kn612
2.5 Star Member
2.5 Star Member
Posts: 112
Joined: Sat Oct 31, 2020 4:44 pm

Flash Mesa board for 2 thcads

Post by kn612 »

What's the process for flashing a 7i96s for 2 thcads. One thcad for ohmic, one for THC. I'm either stupid or making it harder than what it is.

https://forum.linuxcnc.org/27-driver-bo ... le?start=0 -is this the magic command?
User avatar
acourtjester
6 Star Elite Contributing Member
6 Star Elite Contributing Member
Posts: 7824
Joined: Sat Jun 02, 2012 6:04 pm
Location: Pensacola, Fla

Re: Flash Mesa board for 2 thcads

Post by acourtjester »

I used a the 7I78E card on my controller, did you download the files from Mesa that has all the card files. Its been a while but after that there is another step that needs to be done. I'm sure other LinuxCNC member here will give you the steps needed. Look up mesaflash instructions
DIY 4X4 Plasma/Router Table
Hypertherm PM65 Machine Torch
Drag Knife and Scribe
Miller Mig welder
13" metal lathe
Small Mill
Everlast PowerTig 255 EXT
kn612
2.5 Star Member
2.5 Star Member
Posts: 112
Joined: Sat Oct 31, 2020 4:44 pm

Re: Flash Mesa board for 2 thcads

Post by kn612 »

Yeah I have the board files downloaded from mesa website. Don't know what to do with that firmware file next.
Rodw
4 Star Member
4 Star Member
Posts: 780
Joined: Sun Aug 21, 2016 1:49 am
Location: Brisbane, Australia
Contact:

Re: Flash Mesa board for 2 thcads

Post by Rodw »

You are on the right track
download and unzip the firmware file from Mesa. there will be one that ends in pl.bit
Then as you found

Code: Select all

mesaflash --device 7i76e --addr 10.10.10.10 --write ./7i76e_7i76x1_Dpl.bit
In your hal file change the number of encoders in this line

Code: Select all

loadrt hm2_eth board_ip="10.10.10.10" config=" num_encoders=3 num_pwmgens=0 num_stepgens=5 sserial_port_0=2xxxx" 
Then configure the encoder in hal

Code: Select all

# --- 7i76e ENCODER SETUP FOR OHMIC SENSING---
setp hm2_7i76e.0.encoder.01.counter-mode  1
setp hm2_7i76e.0.encoder.01.filter        1
setp hm2_7i76e.0.encoder.01.scale        -1

kn612
2.5 Star Member
2.5 Star Member
Posts: 112
Joined: Sat Oct 31, 2020 4:44 pm

Re: Flash Mesa board for 2 thcads

Post by kn612 »

Is there a specific place I need to put the dpl file after downloading?
Rodw
4 Star Member
4 Star Member
Posts: 780
Joined: Sun Aug 21, 2016 1:49 am
Location: Brisbane, Australia
Contact:

Re: Flash Mesa board for 2 thcads

Post by Rodw »

no. Just run mesaflash from the same directory.
If you are old enough to remmeber DOS ./ means this folder and ../ means parent folder :)

NOte I used ./ in my example
kn612
2.5 Star Member
2.5 Star Member
Posts: 112
Joined: Sat Oct 31, 2020 4:44 pm

Re: Flash Mesa board for 2 thcads

Post by kn612 »

:)
Screenshot_2023-05-28_18-41-30.png
Rodw
4 Star Member
4 Star Member
Posts: 780
Joined: Sun Aug 21, 2016 1:49 am
Location: Brisbane, Australia
Contact:

Re: Flash Mesa board for 2 thcads

Post by Rodw »

Yeh, just reboot.
kn612
2.5 Star Member
2.5 Star Member
Posts: 112
Joined: Sat Oct 31, 2020 4:44 pm

Re: Flash Mesa board for 2 thcads

Post by kn612 »

To configure ohmic is that something we do in Hal? With the component you wrote? I see no options in pncconf
caretech
1.5 Star Elite Contributing Member
1.5 Star Elite Contributing Member
Posts: 66
Joined: Thu Jun 04, 2020 2:29 pm
Location: SW Ontario

Re: Flash Mesa board for 2 thcads

Post by caretech »

kn612,

You are correct, pncconf does THCAD-based torch height control setup now but not ohmic sensing yet. (at least, not when I set up my machine a few months ago) You need to do that part of setup manually.

I found the ohmic3.comp file on the LinuxCNC forums, with corresponding HAL code. I put the HAL in my custom.hal file so pncconf won't over-write it, and that works great. (no additional hal file references needed in your INI file this way) As I recall, you'll want to give the code a look to ensure (1) that it is using the correct encoder input on your mesa, and (2) you'll want to replace the encoder reading high / low numbers in the code with the actual numbers from the sticker on your THCAD board.

Ensure you have linuxcnc dev installed (package is called linuxcnc-uspace-dev in my case) so that you have the halcompile utility. Then, from the directory where you have saved the ohmic3.comp file, run the following:

Code: Select all

sudo halcompile --install ohmic3.comp
You'll find this linuxcnc thread helpful. I think all you need should either be there, or linked from there.
Shop-built 5x10 table powered by QtPlasmaC
Hypertherm PM 85 machine torch
Lincoln PowerMig 255C
Lincoln Square Wave Tig 255
Ermak SpeedBend Pro
kn612
2.5 Star Member
2.5 Star Member
Posts: 112
Joined: Sat Oct 31, 2020 4:44 pm

Re: Flash Mesa board for 2 thcads

Post by kn612 »

Awesome. Thank you guys. Lots of good info, that's why I really like this place.
kn612
2.5 Star Member
2.5 Star Member
Posts: 112
Joined: Sat Oct 31, 2020 4:44 pm

Re: Flash Mesa board for 2 thcads

Post by kn612 »

Aright guys, still playing around with configuring ohmic sensing with a thcad. Im stuck at configuring the settings for ohmic. Do I need to actually copy and paste ohmic3.comp into one of the hal files? I attached both hal files and ini in word format along with a prtscreen of the last terminal I used halcompile to install ohmic3.comp. My configs are only set up far enough to jog all the axis and fire the torch at the moment. If anyone has any examples of their thcad ohmic configs I would love to have a look.
plasma_tableini.docx
(5.77 KiB) Downloaded 151 times
plasma_table.docx
(6.82 KiB) Downloaded 140 times
customhal.docx
(4.98 KiB) Downloaded 128 times
Screenshot_2023-09-12_21-32-25.png
User avatar
acourtjester
6 Star Elite Contributing Member
6 Star Elite Contributing Member
Posts: 7824
Joined: Sat Jun 02, 2012 6:04 pm
Location: Pensacola, Fla

Re: Flash Mesa board for 2 thcads

Post by acourtjester »

I cannot help with your ohmic sensing with a thcad setup as I use a different module. I could not get it to work (my problem not the setup) but am successful with what I use. I use it with both Plasma and router touch offs with LinuxCNC on my table. Very simple to hook up and use, I select it in Pncconf for ohmic sensor using an input pin and done. You can get the module in 5, 12, and 24 volt units for easy powering on the table controller.
https://www.ebay.com/itm/401188750996?var=670761872997
Ohmic Sensor Module.JPG
Ohmic Sensor Module.JPG (51.19 KiB) Viewed 10679 times
DIY 4X4 Plasma/Router Table
Hypertherm PM65 Machine Torch
Drag Knife and Scribe
Miller Mig welder
13" metal lathe
Small Mill
Everlast PowerTig 255 EXT
caretech
1.5 Star Elite Contributing Member
1.5 Star Elite Contributing Member
Posts: 66
Joined: Thu Jun 04, 2020 2:29 pm
Location: SW Ontario

Re: Flash Mesa board for 2 thcads

Post by caretech »

Per your screenshot, you have successfully installed the Ohmic3 component. Good job! Now it just needs to be referenced in your custom HAL file. I'll see if I can get you some relevant content from my file soon. My custom.hal file has a bunch more stuff in it -- logic that controls my five-zone downdraft damper system based on gantry X position, logic that turns on my downdraft fan when I cycle start, and keeps it running for 45 seconds after the cycle completes. Fun stuff.
Shop-built 5x10 table powered by QtPlasmaC
Hypertherm PM 85 machine torch
Lincoln PowerMig 255C
Lincoln Square Wave Tig 255
Ermak SpeedBend Pro
kn612
2.5 Star Member
2.5 Star Member
Posts: 112
Joined: Sat Oct 31, 2020 4:44 pm

Re: Flash Mesa board for 2 thcads

Post by kn612 »

Tom, I will go to the optoisolated relays and diode ohmic setup if I struggle with hypersensing. Bought all the mesa hardware, need to give it a go first. I'm close, think it's just a couple things in the HAL file for everything to talk to each other. It's my limitations with Linux and coding at the moment. Pncconf makes it easy with the graphical interface but anything to do with the terminal window is an uphill battle but it's getting easier as I get more familiar with it.

Caretech, I would really appreciate being able to compare HAL files. We need a topic in the Linux part of this forum for plasma HAL examples. That would really help guys like me with limited code/Linux experience but are skilled on the hardware/fabrication side of a diy table.
User avatar
acourtjester
6 Star Elite Contributing Member
6 Star Elite Contributing Member
Posts: 7824
Joined: Sat Jun 02, 2012 6:04 pm
Location: Pensacola, Fla

Re: Flash Mesa board for 2 thcads

Post by acourtjester »

I am in a similar place with LinuxCNC, it is well worth the effort getting it functional, QTPlasmaC has nice features. I to bought the Mesa board for the Ohmic circuit but could not get the software to go. I had used the module on other tables and software so lazy way out when with it. Works so well I may not change it out.
have fun
Tom
DIY 4X4 Plasma/Router Table
Hypertherm PM65 Machine Torch
Drag Knife and Scribe
Miller Mig welder
13" metal lathe
Small Mill
Everlast PowerTig 255 EXT
caretech
1.5 Star Elite Contributing Member
1.5 Star Elite Contributing Member
Posts: 66
Joined: Thu Jun 04, 2020 2:29 pm
Location: SW Ontario

Re: Flash Mesa board for 2 thcads

Post by caretech »

Hey kn612, sorry about the wait. Here are snips from my HAL file. First, the section relevant to ohmic sensing. Note how the component is loaded with "loadrt ohmic3" and then named "ohmicsense" which is the name used in the code following. The next line adds the loaded component to the servo thread. You'll want to adjust your thcad-0-volt-freq and thcad-max-volt-freq numbers to match your THCAD-5 board.

Code: Select all

# ---OHMIC SENSE CONTACT DEBOUNCE---
setp plasmac.ohmic-sense-off-delay  3
setp plasmac.ohmic-sense-on-delay   3

# ---OHMIC SENSING HAL FROM ROD WEBSTER ---
loadrt ohmic3 names=ohmicsense
addf ohmicsense servo-thread

# --- 7i76e SETUP FOR OHMIC SENSING---
setp hm2_7i76e.0.encoder.01.scale -1
setp hm2_7i76e.0.encoder.01.counter-mode 1
 
setp ohmicsense.thcad-0-volt-freq    140100
setp ohmicsense.thcad-max-volt-freq  965200
setp ohmicsense.thcad-divide         32
setp ohmicsense.thcad-fullscale      5
setp ohmicsense.volt-divider         4.9
setp ohmicsense.ohmic-threshold      22
setp ohmicsense.ohmic-low            21.5
setp ohmicsense.mode                 1 
setp ohmicsense.num-readings         10
# --- 7i76e ENCODER SETUP FOR OHMIC SENSING---
setp hm2_7i76e.0.encoder.01.scale -1
setp hm2_7i76e.0.encoder.01.counter-mode 1

net ohmic-vel ohmicsense.velocity-in <= hm2_7i76e.0.encoder.01.velocity

net plasmac:ohmic-probe <= ohmicsense.ohmic-on
net plasmac:ohmic-enable => ohmicsense.is-probing
net plasmac:motion-type => ohmicsense.motion-type-in
Here's the section of my custom.hal file that turns on my downdraft fan automatically, and runs it for a prescribed length of time after the cycle ends or is paused. Perhaps the real LinuxCNC gurus will tear this apart. :D If there are better ways to do this, I'm all ears!

Code: Select all

#### turn fan on when machine in run mode

# Add a timer
addf timedelay.5 servo-thread
setp timedelay.5.on-delay 0

# Set off delay to 45 seconds -- keep clearing smoke after cutting
setp timedelay.5.off-delay 45

# Load an "and2"
loadrt and2 count=1
addf and2.0 servo-thread

# Input pins of interest... (this is just a note to self)
# halui.program.is-running
# halui.program.is-paused
# qtplasmac.torch_enable

# use and2 to turn on hm2_7i76e.0.7i76.0.0.output-05 when:
# halui.program.is-running AND qtplasmac.torch_enable
# that way, demo runs around the sheet (with torch disabled) will not start exhaust fan
net plasmac:program-is-running => and2.0.in0
net plasmac:torch-enable       => and2.0.in1
net fan_timer <= and2.0.out
net fan_timer => timedelay.5.in
net fan_running timedelay.5.out => hm2_7i76e.0.7i76.0.0.output-05
Shop-built 5x10 table powered by QtPlasmaC
Hypertherm PM 85 machine torch
Lincoln PowerMig 255C
Lincoln Square Wave Tig 255
Ermak SpeedBend Pro
caretech
1.5 Star Elite Contributing Member
1.5 Star Elite Contributing Member
Posts: 66
Joined: Thu Jun 04, 2020 2:29 pm
Location: SW Ontario

Re: Flash Mesa board for 2 thcads

Post by caretech »

And in case you wanted to see it, here is the logic that runs my 5 downdraft zone doors. As my gantry moves up and down the table, air cylinders open and close dampers off the one side so that my downdraft fan is pulling air from a smaller section of the table close to the torch. This works quite well, allowing you to clear more smoke with less suction -- although my downdraft fan still needs an upgrade to something that moves more air.

Code: Select all

######### DOWNDRAFT ZONE CONTROL #########
loadrt wcomp names=zone1,zone2,zone3,zone4,zone5
loadrt timedelay count=6

# add comparator functions to servo thread
addf zone1 servo-thread
addf zone2 servo-thread
addf zone3 servo-thread
addf zone4 servo-thread
addf zone5 servo-thread
addf timedelay.0 servo-thread
addf timedelay.1 servo-thread
addf timedelay.2 servo-thread
addf timedelay.3 servo-thread
addf timedelay.4 servo-thread

# set overlapping zone min / max points (adjust as needed)
setp zone1.min -2
setp zone1.max 31
setp zone2.min 27
setp zone2.max 53
setp zone3.min 49
setp zone3.max 76
setp zone4.min 72
setp zone4.max 98
setp zone5.min 94
setp zone5.max 126

# set time delays
setp timedelay.0.on-delay 0
setp timedelay.1.on-delay 0
setp timedelay.2.on-delay 0
setp timedelay.3.on-delay 0
setp timedelay.4.on-delay 0

setp timedelay.0.off-delay 3
setp timedelay.1.off-delay 3
setp timedelay.2.off-delay 3
setp timedelay.3.off-delay 3
setp timedelay.4.off-delay 3

# connect axis position to inputs of zone comparators
net within_zone joint.0.pos-cmd zone1.in zone2.in zone3.in zone4.in zone5.in

# create signals for within zones
#net within_zone1 zone1.out
#net within_zone2 zone2.out
#net within_zone3 zone3.out
#net within_zone4 zone4.out
#net within_zone5 zone5.out

# send within_zone signals to timer inputs
net zone_1_timer zone1.out timedelay.0.in
net zone_2_timer zone2.out timedelay.1.in
net zone_3_timer zone3.out timedelay.2.in
net zone_4_timer zone4.out timedelay.3.in
net zone_5_timer zone5.out timedelay.4.in

# connect time delay relay outputs to zone signals
net zone1_relay <= timedelay.0.out
net zone2_relay <= timedelay.1.out
net zone3_relay <= timedelay.2.out
net zone4_relay <= timedelay.3.out
net zone5_relay <= timedelay.4.out

# wire comparator out signals to hal mesa pins
# w/o time delay: just net within_zone1 => hm2_7i76e.0.7i76.0.0.output-00, etc
net zone1_relay => hm2_7i76e.0.7i76.0.0.output-00
net zone2_relay => hm2_7i76e.0.7i76.0.0.output-01
net zone3_relay => hm2_7i76e.0.7i76.0.0.output-02
net zone4_relay => hm2_7i76e.0.7i76.0.0.output-03
net zone5_relay => hm2_7i76e.0.7i76.0.0.output-04
Shop-built 5x10 table powered by QtPlasmaC
Hypertherm PM 85 machine torch
Lincoln PowerMig 255C
Lincoln Square Wave Tig 255
Ermak SpeedBend Pro
caretech
1.5 Star Elite Contributing Member
1.5 Star Elite Contributing Member
Posts: 66
Joined: Thu Jun 04, 2020 2:29 pm
Location: SW Ontario

Re: Flash Mesa board for 2 thcads

Post by caretech »

Just one more note on this. Taking my code in the order posted above won't quite work out -- the downdraft section uses Timer # 6, which actually is loaded in the line shown in the zone door section, "loadrt timedelay count=6." Trying to call a timer (or any other component) before loading it won't work, as far as I know.

My ohmic sensing is first in the file, then the downdraft zone door code, and lastly the downdraft fan control. I suppose I should have a section up top that loads all the components I need, then have all my custom logic code below that. The file just kinda grew organically. :)
Shop-built 5x10 table powered by QtPlasmaC
Hypertherm PM 85 machine torch
Lincoln PowerMig 255C
Lincoln Square Wave Tig 255
Ermak SpeedBend Pro
Rodw
4 Star Member
4 Star Member
Posts: 780
Joined: Sun Aug 21, 2016 1:49 am
Location: Brisbane, Australia
Contact:

Re: Flash Mesa board for 2 thcads

Post by Rodw »

I wrote a custom component for a 8 zone downdraft table ( 4 y and 2 x zones). Download the archive attached to this post. It includes a full sim you can run.
https://forum.linuxcnc.org/plasma-laser ... =10#188738
odd numbers to the left, even numbers to the right. I know txrone added timedealys, not sure if it was in a later version of th ecomp or added in hal.

It tracks the x and y axis positions ands acts accordingly

Code: Select all

component ddraft4x2 "boost component";
pin in float y_boundary-# [3];
pin in float x_boundary = 36.0  " x axis boundary";
pin in float x_pos;
pin in float y_pos "set to axis.y.pos-cmd";
pin out bit trigger-# [8];
pin out unsigned zone;


description
"""
This component triggers a relay based on an 8 zone downdraft table with zone 0 at the front left and zone 7 at the rear right as defined by the boundary pins
.br

.br
""";


function _;
license "GPL";
;;
#include <rtapi_math.h>
int i;
int yzone;
int xzone = (x_pos < x_boundary ? 0:1);
if(y_pos < y_boundary(0))
	yzone = 0;
else if(y_pos < y_boundary(1))
	yzone = 2;
else if(y_pos < y_boundary(2))
	yzone = 4;
else
	yzone = 6;
zone = yzone + xzone;
for(i=0; i < 8; i++)
	trigger(i) = (i == zone)? 1:0;
kn612
2.5 Star Member
2.5 Star Member
Posts: 112
Joined: Sat Oct 31, 2020 4:44 pm

Re: Flash Mesa board for 2 thcads

Post by kn612 »

Thank you caretech, that really helps. You guys are on a much more advanced level than me, one wrong keystroke in a terminal window or HAL is all it takes to chase my tail. After I get a standard plasma machine running on qtplasmac with thc and ohmic then we'll look at adding custom features. :HaHa

Since we are manually adding and editing HAL for ohmic sensing I assume we don't have to worry about configuring the unused encoder pin in Pnnconf? Pnnconf is just a graphical interface that generates the HAL and INI files? After flashing the new firmware there are 3 total encoders on the mesa board now?

Tom, yes I agree, Qtplasmac is very nice. Its interface and features are what won me over to switch from mach3.

Rod, is your spaceship HAL anywhere on the internet we could have a look at? Interested in your fast probing.

Side question, how are you guys uploading and attaching your codes like that?
Rodw
4 Star Member
4 Star Member
Posts: 780
Joined: Sun Aug 21, 2016 1:49 am
Location: Brisbane, Australia
Contact:

Re: Flash Mesa board for 2 thcads

Post by Rodw »

Fast probing is just keeping your probing velocities fast and allowing the float switch soak up overtravel then the standard behaviour of qtplasmac where it probes away from the surface to decide where the surface is. You really do need to do it yourself as there is a tradeoff of too much overtravel and speed.
I sold the spaceship sorry.
kn612
2.5 Star Member
2.5 Star Member
Posts: 112
Joined: Sat Oct 31, 2020 4:44 pm

Re: Flash Mesa board for 2 thcads

Post by kn612 »

Are you planning another plasma build?
Rodw
4 Star Member
4 Star Member
Posts: 780
Joined: Sun Aug 21, 2016 1:49 am
Location: Brisbane, Australia
Contact:

Re: Flash Mesa board for 2 thcads

Post by Rodw »

kn612 wrote: Thu Sep 21, 2023 11:35 pm Are you planning another plasma build?
Nah, not really. The plasma cutter died and I was getting parts lasercut to save the cleanup so I decided it wasn't woth spending $5k on a machine so I got good money for the bare table.

I retofitted a small mill with ethercat drives for fun.
caretech
1.5 Star Elite Contributing Member
1.5 Star Elite Contributing Member
Posts: 66
Joined: Thu Jun 04, 2020 2:29 pm
Location: SW Ontario

Re: Flash Mesa board for 2 thcads

Post by caretech »

kn612 wrote: Thu Sep 21, 2023 11:16 pm Since we are manually adding and editing HAL for ohmic sensing I assume we don't have to worry about configuring the unused encoder pin in Pnnconf? Pnnconf is just a graphical interface that generates the HAL and INI files? After flashing the new firmware there are 3 total encoders on the mesa board now?
Yes, yes, and yes. :) Don't configure that encoder pin in PNC Conf at all. You are correct that it is a graphical wizard that simply writes out INI and HAL. You can tweak from there all you want -- although if you edit the files that pncconf created, then those changes will be over-written should you ever modify your existing config in pncconf again. Hence the need for the custom.hal file, which is safe from over-writes.
Side question, how are you guys uploading and attaching your codes like that?
Put code in code brackets. It's difficult to get the forum to display what you need in text, but if you click the Code button at the top of the post editor, you'll get the hang of it immediately.
Shop-built 5x10 table powered by QtPlasmaC
Hypertherm PM 85 machine torch
Lincoln PowerMig 255C
Lincoln Square Wave Tig 255
Ermak SpeedBend Pro
Post Reply

Return to “Linux CNC - Plasmac”