GRBL + THC???

General software related questions should be posted here.
Post Reply
ernesto
1/2 Star Member
1/2 Star Member
Posts: 9
Joined: Wed Dec 20, 2017 3:23 pm

GRBL + THC???

Post by ernesto »

Have any of you guys experimented with GRBL and a Proma TC?

I've been fighting a friend's Windows/Mach3/Gecko setup for well over a month. At first, it was software/virus issues on the computer and I finally sorted that all out but the system constantly loses setup info and does random stuff. It will work fine for an hour, then go nuts. I've set the whole machine up and checked all connections multiple times so I'm pretty sure I've just been fighting a dying computer, and we may have killed the thing for good today by welding on the table and forgetting to disconnect the plasma work lead first. Rather than buy another junky old tower and go through the hours of setting it back up right, I'm ready to move on to more modern tech.

I picked up a raspberry pi/protoneer setup for a cnc router that I'm building and want to add plasma capabilities to it down the road. Since I also need to get my friend's lightning cnc 5x10 table going, I'm thinking that rather than fight the learning curve of two different setups, it would be best to replace his current setup with the same thing I'll be running on my machine once it's done. I've searched like crazy and the only info I can find regarding GRBL with THC are a couple of really short videos just showing a machine cutting, and they're in German. I'm just wondering if anyone out there has any setup pointers.

This whole thing with getting my friend's machine to run consistently has been a four year ordeal for him and so far, wasted a lot of everyone's time. I just want to make sure that the new hardware/software I recommend for them will actually do the job. Any input would be greatly appreciated, setup info in particular.
ernesto
1/2 Star Member
1/2 Star Member
Posts: 9
Joined: Wed Dec 20, 2017 3:23 pm

Re: GRBL + THC???

Post by ernesto »

It looks like the answer is going to be using a Proma THC-SD that switches into z control using some dpdt solid state relays triggered off of the "ok to move" signal. I'll post up a full build thread when I get it working.
robertspark
4.5 Star Elite Contributing Member
4.5 Star Elite Contributing Member
Posts: 1805
Joined: Mon Jun 12, 2017 6:43 pm

Re: GRBL + THC???

Post by robertspark »

ernesto
1/2 Star Member
1/2 Star Member
Posts: 9
Joined: Wed Dec 20, 2017 3:23 pm

Re: GRBL + THC???

Post by ernesto »

Thanks!

I'll look into them. The Proma SD will work perfectly but alternatives are always good!
ernesto
1/2 Star Member
1/2 Star Member
Posts: 9
Joined: Wed Dec 20, 2017 3:23 pm

Re: GRBL + THC???

Post by ernesto »

Unless those prices in pesos, I think that I'm stuck with the Proma.
tcaudle
4 Star Elite Contributing Member
4 Star Elite Contributing Member
Posts: 1353
Joined: Tue Feb 28, 2012 6:47 pm

Re: GRBL + THC???

Post by tcaudle »

so how does the SD handle IHS (Touch off) ? How can you control turning the THC on or off on critical cuts? How does it keep track of the Z height if it has no comm to the control software? I guess if you are used to not having a THC or one that does not work anything is better.

If you killed the PC from welding on the table that may explain why you have been fighting this for so long. Plasma noise on the frame of the table will cause all kind of problems with a PC. It will cause MACH to lock up, lose settings (because it writes stuff to the XML when it closes) and even cause arrant motion from noise. Stacking on a virus as well along with a flaky PC and the blame seems to be misplaced on the Control Software (MACH). Yes MACH3 is older technology but so is the whole CNC process.

Most of the users here are not experimenters or programmers. They just want to cut metal and get work done.
ernesto
1/2 Star Member
1/2 Star Member
Posts: 9
Joined: Wed Dec 20, 2017 3:23 pm

Re: GRBL + THC???

Post by ernesto »

Regarding controlling the THC with GRBL, the Proma SD unit is specifically designed to work outside of the control software. GRBL supports G28.1 so I'm going to use a floating head design on my torch holder so it will zero the z axis before and after every cut, then move z to pierce height. When M03 fires the torch, the Proma SD takes over z control until M05 cancels the torch, G28.1 runs again to rezero, grbl moves to safe z, then to the next lead in point, and repeat process. If I'm missing something here, please let me know.

The machine I was working on had a string of issues that I had to fight but in the end, shortening and rerouting some wires, cleaning up the virus/wiping everything, and reinstalling/tuning Mach3 got it going. It's using the Proma THC150 compact and working perfectly now. The welding on the table definitely stunned something but after sitting overnight, the machine fired right up the next time we tried it and has ran perfectly since.

I am making progress on my raspberrypi/grbl powered machine though and am very excited to get away from PC's. Mach3 has always been pretty solid but getting a windows machine to reliably cooperate has always been a pain. I switched to ubuntu on my laptop a few years ago and can never go back. I'm hoping that the simplicity, modernity, and community support that made the linux switch so good translates into cnc world too.

I figured I'd post this info so people that are tired of buying expensive software and fighting with outdated PC's will at least have an alternative to try. I just want to cut metal and get work done too but if I can save a few grand at setup and have a NC system where the most expensive component is $35, it's just something I have to try.
jlund
1/2 Star Member
1/2 Star Member
Posts: 1
Joined: Wed Feb 13, 2019 5:39 pm

Re: GRBL + THC???

Post by jlund »

I am very interested in your progress. I would also be willing to assist in anyway that I can.
krymis
2 Star Member
2 Star Member
Posts: 63
Joined: Tue Aug 22, 2017 9:59 am

Re: GRBL + THC???

Post by krymis »

ernesto did you ever get this running? I am working on a grbl plasma also and would love to talk more about the CD/CAM post processor and code editing you did.
UnfinishedBusiness
1/2 Star Member
1/2 Star Member
Posts: 6
Joined: Tue Dec 12, 2017 2:49 pm

Re: GRBL + THC???

Post by UnfinishedBusiness »

I have created a solution for GRBL and plasma cutting. I forked and modified GRBL to include AVTHC directly into the firmware so no external unit (like proma or priceCNC) is required. You simply need to create a voltage divider circuit. Two 1/4 watt 1M ohm resistors and the divided voltage goes to Arduino Uno A0. This is a High-Z circuit and expects the voltage from the plasma cutter to be scale 50:1. Then the ArcOK signal is connected to A1.
THC control is then done via Real-Time commands. So turning it on/off and voltage setting can be done from gcode as well. I've also added Cyclic redundancy check to the gcode stream which is critical for plasma cutting because electrical noise even on properly grounded and shielded machines can occasionally, but rarely, cause a framing error or dropped byte during the USB->Serial conversion which, if not caught, can cause you machine to go someplace you didn't tell it to go...

The firmware repository is at https://github.com/UnfinishedBusiness/XmotionFirmware

The control software is at https://github.com/UnfinishedBusiness/ncPilot
The control software is cross-platform and works great on windows, linux, and MacOS. There's also post-processor for sheetcam in the Firmware Repo already setup for floating head Z touch off probing. It's just a switch connected to A5.


Documentation is pretty thin right now due to my tight schedule but create an issue for questions and I'll solve them when I have time. I've had this up and running for about 6 months now on several machines and it's been a really nice setup. This can seriously lower the cost of building a CNC plasma machine because all the complicated stuff happens on a $10 Arduino UNO (Or in my case, a Custom-designed circuit board that houses a ATMEGA328P)
Bert M
1/2 Star Member
1/2 Star Member
Posts: 5
Joined: Tue Apr 07, 2020 12:24 pm

Re: GRBL + THC???

Post by Bert M »

UnfinishedBusiness wrote: Fri Feb 28, 2020 3:25 pm I have created a solution for GRBL and plasma cutting. I forked and modified GRBL to include AVTHC directly into the firmware so no external unit (like proma or priceCNC) is required. You simply need to create a voltage divider circuit. Two 1/4 watt 1M ohm resistors and the divided voltage goes to Arduino Uno A0. This is a High-Z circuit and expects the voltage from the plasma cutter to be scale 50:1. Then the ArcOK signal is connected to A1.
THC control is then done via Real-Time commands. So turning it on/off and voltage setting can be done from gcode as well. I've also added Cyclic redundancy check to the gcode stream which is critical for plasma cutting because electrical noise even on properly grounded and shielded machines can occasionally, but rarely, cause a framing error or dropped byte during the USB->Serial conversion which, if not caught, can cause you machine to go someplace you didn't tell it to go...

The firmware repository is at https://github.com/UnfinishedBusiness/XmotionFirmware

The control software is at https://github.com/UnfinishedBusiness/ncPilot
The control software is cross-platform and works great on windows, linux, and MacOS. There's also post-processor for sheetcam in the Firmware Repo already setup for floating head Z touch off probing. It's just a switch connected to A5.


Documentation is pretty thin right now due to my tight schedule but create an issue for questions and I'll solve them when I have time. I've had this up and running for about 6 months now on several machines and it's been a really nice setup. This can seriously lower the cost of building a CNC plasma machine because all the complicated stuff happens on a $10 Arduino UNO (Or in my case, a Custom-designed circuit board that houses a ATMEGA328P)
Hello,

I've tried to install ncPilot but I can't getting it to work. (Running it under windows 10 and I don't know a lot about linux so thats the problem I think.)

I've installed MSYS2 (and it runs).

I've understood that I must install Xkernel and I've followed the steps at https://github.com/UnfinishedBusiness/Xkernel.

But where must I place it all. Is it in the msys64/home/Bert/

Hopefully you can help me a little bit.

With kind regards,

Bert
UnfinishedBusiness
1/2 Star Member
1/2 Star Member
Posts: 6
Joined: Tue Dec 12, 2017 2:49 pm

Re: GRBL + THC???

Post by UnfinishedBusiness »

Hey Bert,

I usually create directory /c/Xmotion then clone Xkernel and ncPilot in that directory. That path translates to c:\Xmotion on windows.

I updated the build instructions in the Xkernel repository because my old instructions were confusing.

You should be able to follow the revised instructions exactly now.

Feel free to come back here for questions or file an issue on Github and I'm more than happy to assist in getting you up and running.

Thanks,
Travis
Bert M
1/2 Star Member
1/2 Star Member
Posts: 5
Joined: Tue Apr 07, 2020 12:24 pm

Re: GRBL + THC???

Post by Bert M »

Hello Travis,

Thanks for your reply.

I will have a look at the build instructions in the Xkernel.

With kind regards,

Bert
Bert M
1/2 Star Member
1/2 Star Member
Posts: 5
Joined: Tue Apr 07, 2020 12:24 pm

Re: GRBL + THC???

Post by Bert M »

UnfinishedBusiness wrote: Fri Apr 10, 2020 1:43 pm Hey Bert,

I usually create directory /c/Xmotion then clone Xkernel and ncPilot in that directory. That path translates to c:\Xmotion on windows.

I updated the build instructions in the Xkernel repository because my old instructions were confusing.

You should be able to follow the revised instructions exactly now.

Feel free to come back here for questions or file an issue on Github and I'm more than happy to assist in getting you up and running.

Thanks,
Travis
Hello Travis,

I've managed to install/run ncPilot and the other things.

The text is a bit small, I can't read it (see image below) but I think that's up to me. I don't have a clue what I was doing. (It's getting a bit late over here. Within a few days I try to have a better look at it.)

Thanks for your help again.

With kind regards,

Bert

Image
UnfinishedBusiness
1/2 Star Member
1/2 Star Member
Posts: 6
Joined: Tue Dec 12, 2017 2:49 pm

Re: GRBL + THC???

Post by UnfinishedBusiness »

Hey Bert,

Glad you got it up and running! I should add a way to increase the text size. I mostly use it on laptops with smaller screens and the test size seems pretty good.

Thanks,
Travis
Bert M
1/2 Star Member
1/2 Star Member
Posts: 5
Joined: Tue Apr 07, 2020 12:24 pm

Re: GRBL + THC???

Post by Bert M »

Hello Travis,

Succeeded in uploading the file to an arduino. (It's the only thing I have laying around at the moment the rest of the stuff for making an test cnc plasma machine I've ordered but that will take some time before I get that.)

There's one small thing I think you have to change on the github page under Prepare a Arduino Uno (or other ATMega328p device with USB serial interface and arduino bootloader)

I think the line (because that works for me) cd /c/Xmotion/Xkernel/ must be cd /c/Xmotion/ncPilot/extra/

ncPilot is now communicating with the Arduino. (the value is going up and down behind the arc but that maybe caused by a humidity sensor which is hanging on a input.)

Hopefully the driver board etc will arrive within a few weeks so I can go futher.

Thanks for all the work you have put into this.

With kind regards,

Bert
UnfinishedBusiness
1/2 Star Member
1/2 Star Member
Posts: 6
Joined: Tue Dec 12, 2017 2:49 pm

Re: GRBL + THC???

Post by UnfinishedBusiness »

Hello Bert,

Glad you got everything working despite the mistake in the readme, which I have now fixed. I appreciate your feedback and I'm looking forward in helping you get a machine up and running with my software.

Thanks,
Travis
Bert M
1/2 Star Member
1/2 Star Member
Posts: 5
Joined: Tue Apr 07, 2020 12:24 pm

Re: GRBL + THC???

Post by Bert M »

Hello Travis,

Can you tell me were the arc_ok signal is coming from?

And also I was wondering were the torch nust be connected. I see in main.c standing PORTB &= ~(1 << PB0); //Set torch pin off so there it looks that your using bit0 of port B for controlling the torch but in the futher program I can't find bit zero for controlling the torch. But when I'm looking in cpu_map.h it looks like STEPPERS_DISABLE_PORT is connected to this pin but in the whole program thats commented so doesn't work.

I don't see how the torch is started.

With kind regards,

Bert
azdavidfarmer
1/2 Star Member
1/2 Star Member
Posts: 5
Joined: Mon May 04, 2020 4:17 am

Re: GRBL + THC???

Post by azdavidfarmer »

Interesting thread. @UnfinishedBusiness Would you be able to make a Will this work with an Openbuilds black box, and something like an Everlast plasma 50s?

It looks like you can use the door open(A1) and probe(A5) connections for the arc OK, and the arc voltage. It says it uses a standard grbl configuration, however there is easily no accessible A0 Pin. Also the A1 and A5 pin runs through a diode, which I think should be fine for the arc OK, but I'm not sure if that's OK for the arc voltage.
everlast 50s pinout.PNG
Grbl_Pin_Diagram_v0.9+.png
Grbl_Pin_Diagram_v0.9+.png (367.32 KiB) Viewed 4093 times
https://docs.openbuilds.com/blackbox/#0welcome.html
azdavidfarmer
1/2 Star Member
1/2 Star Member
Posts: 5
Joined: Mon May 04, 2020 4:17 am

Re: GRBL + THC???

Post by azdavidfarmer »

UnfinishedBusiness wrote: Sun Apr 26, 2020 2:40 pm
I havent messed around with these arduino files since I built my 3d printer back in 2013, but I think If I just switch the 0 and 5 everything should be copacetic. I was looking for the spot in the code where you specified which pin to use to read the arc voltage but I cant find it, so this seamed like it would also work. Then I can use the probe input on my blackbox for my arc voltage input.
switch pin mapping.PNG
UnfinishedBusiness
1/2 Star Member
1/2 Star Member
Posts: 6
Joined: Tue Dec 12, 2017 2:49 pm

Re: GRBL + THC???

Post by UnfinishedBusiness »

Bert M wrote: Sat May 02, 2020 3:45 pm Hello Travis,

Can you tell me were the arc_ok signal is coming from?

And also I was wondering were the torch nust be connected. I see in main.c standing PORTB &= ~(1 << PB0); //Set torch pin off so there it looks that your using bit0 of port B for controlling the torch but in the futher program I can't find bit zero for controlling the torch. But when I'm looking in cpu_map.h it looks like STEPPERS_DISABLE_PORT is connected to this pin but in the whole program thats commented so doesn't work.

I don't see how the torch is started.

With kind regards,

Bert
Hey Bert,

The arc_ok signal comes from the plasma cutter usually a dry contact closure from either the CPC or CNC interface (called different things depending on the manufacturer)

The firmware looks for the arc_ok signal on A1 and is active low, So I suggest a pull-up resistor (1K Ohm) and when the contact closes inside the plasma unit it will connect A1 to GND, I run a 0.1uF capacitor clamped to the ground to filter any contact bouncing out of the signal.

The torch contactor should be connected to D11. It's active high so configure your circuit such that when D11 goes high it switches a contactor closed to engage the arc on the plasma cutter.

The D11 pin is actually turned on and off with the M3/M5 codes. But it's all handled as part of the "fire_torch" routine and if you use the sheet cam post-processor supplied you don't need to do anything additional there. Just remember that the Z probe switch needs to be connected to A5 and the "fire_torch" routine will be looking for that input to go LOW (configured active LOW, 1K pullup) once the torch contacts the material. If you are using a floating head where there is a veriable amount of takeup from the time the torch touches the sheet until the switch contacts close, that can be adjusted in the machine parameters under "floating head takeup", if using ohmic that parameter can be zero or close to it depending on the setup

Thanks,
Travis
UnfinishedBusiness
1/2 Star Member
1/2 Star Member
Posts: 6
Joined: Tue Dec 12, 2017 2:49 pm

Re: GRBL + THC???

Post by UnfinishedBusiness »

azdavidfarmer wrote: Tue May 05, 2020 4:21 am
UnfinishedBusiness wrote: Sun Apr 26, 2020 2:40 pm
I havent messed around with these arduino files since I built my 3d printer back in 2013, but I think If I just switch the 0 and 5 everything should be copacetic. I was looking for the spot in the code where you specified which pin to use to read the arc voltage but I cant find it, so this seamed like it would also work. Then I can use the probe input on my blackbox for my arc voltage input.
switch pin mapping.PNG
azdavidfarmer,

I don't see any reason why it wouldn't work with the BlackBox, unfortunately switching the pinmap there won't make it work. The arc voltage is being converted to an analog value in the ADC_vect ISR and written to a global variable "analogVal" in the main.c. There's another ISR which fires every 125uS to make torch height control corrections. The A0 pin could be switched to another analog input but it would have to be done at the beginning of main in the form of correctly setting the ADMUX, ADC registers correctly and that would be a bit of a pain because I haven't studied the datasheet that closely for a long while for the ATMEGA328P. What would probably be easier for you is if you can pull that black box open and solder a wire connected to the A0 pin (also known as the PC5 pin if you take Arduino out of the mix). Also, the diode on A5 and A1 should be fine but you don't want a diode on A0 for the analog reading.

Thanks,
Travis
azdavidfarmer
1/2 Star Member
1/2 Star Member
Posts: 5
Joined: Mon May 04, 2020 4:17 am

Re: GRBL + THC???

Post by azdavidfarmer »

UnfinishedBusiness wrote: Wed May 06, 2020 9:49 am
azdavidfarmer wrote: Tue May 05, 2020 4:21 am
UnfinishedBusiness wrote: Sun Apr 26, 2020 2:40 pm
I havent messed around with these arduino files since I built my 3d printer back in 2013, but I think If I just switch the 0 and 5 everything should be copacetic. I was looking for the spot in the code where you specified which pin to use to read the arc voltage but I cant find it, so this seamed like it would also work. Then I can use the probe input on my blackbox for my arc voltage input.
switch pin mapping.PNG
azdavidfarmer,

I don't see any reason why it wouldn't work with the BlackBox, unfortunately switching the pinmap there won't make it work. The arc voltage is being converted to an analog value in the ADC_vect ISR and written to a global variable "analogVal" in the main.c. There's another ISR which fires every 125uS to make torch height control corrections. The A0 pin could be switched to another analog input but it would have to be done at the beginning of main in the form of correctly setting the ADMUX, ADC registers correctly and that would be a bit of a pain because I haven't studied the datasheet that closely for a long while for the ATMEGA328P. What would probably be easier for you is if you can pull that black box open and solder a wire connected to the A0 pin (also known as the PC5 pin if you take Arduino out of the mix). Also, the diode on A5 and A1 should be fine but you don't want a diode on A0 for the analog reading.

Thanks,
Travis
Ill have a look inside and see how easy that is to do.
azdavidfarmer
1/2 Star Member
1/2 Star Member
Posts: 5
Joined: Mon May 04, 2020 4:17 am

Re: GRBL + THC???

Post by azdavidfarmer »

I desoldered the diode for the probe pin(a5, then soldered a switch in and one pole is connected to a5, the other a0. Ill give it a shot. if it burns up the board im going to bite the bullet and order a masso g3 5 axis unit.
Attachments
IMG_20200509_012019.jpg
azdavidfarmer
1/2 Star Member
1/2 Star Member
Posts: 5
Joined: Mon May 04, 2020 4:17 am

Re: GRBL + THC???

Post by azdavidfarmer »

UnfinishedBusiness wrote: Wed May 06, 2020 9:49 am
azdavidfarmer wrote: Tue May 05, 2020 4:21 am
UnfinishedBusiness wrote: Sun Apr 26, 2020 2:40 pm
I havent messed around with these arduino files since I built my 3d printer back in 2013, but I think If I just switch the 0 and 5 everything should be copacetic. I was looking for the spot in the code where you specified which pin to use to read the arc voltage but I cant find it, so this seamed like it would also work. Then I can use the probe input on my blackbox for my arc voltage input.
switch pin mapping.PNG
azdavidfarmer,

I don't see any reason why it wouldn't work with the BlackBox, unfortunately switching the pinmap there won't make it work. The arc voltage is being converted to an analog value in the ADC_vect ISR and written to a global variable "analogVal" in the main.c. There's another ISR which fires every 125uS to make torch height control corrections. The A0 pin could be switched to another analog input but it would have to be done at the beginning of main in the form of correctly setting the ADMUX, ADC registers correctly and that would be a bit of a pain because I haven't studied the datasheet that closely for a long while for the ATMEGA328P. What would probably be easier for you is if you can pull that black box open and solder a wire connected to the A0 pin (also known as the PC5 pin if you take Arduino out of the mix). Also, the diode on A5 and A1 should be fine but you don't want a diode on A0 for the analog reading.

Thanks,
Travis
I got everything hooked up, then reread the thread only to realize that you use the A5 pin as a probe, so ill need to do some rewiring, probably use the coolant connector instead.

I did install ncpilot, and It is connecting to the blackbox with the xmotion firmware installed, however when I run the fbomb gcode it changes the values on the dro, but the machine doesn't move at all. Any idea whats going on.

Also I previously ran this machine with standard grbl with no issues.

Ok so I flashed standard grbl back to the blackbox, and it was misbehaving in the openbuilds control as well, turns out it has some specific settings it needs due to its configuration. Its actually a pretty nice setup with dual axis motors, controlled by a3,a4 and you can also just slave them on the board by sharing the step and direction pins. I will see what the differences are and mod the xmotion grbl, then try again.
Post Reply

Return to “General Discussion”