grblHAL / Plugin_plasma

grblHAL plugin for plasma cutters (THC)
Other
13 stars 1 forks source link

Plasma mode not available warning #8

Open cdagneta opened 6 months ago

cdagneta commented 6 months ago

Hey All

I'm running PLASMA v0.13 on 1.1f.20240404 in up/down mode.

When I fire the torch using the M4 command I get the warning "[MSG:Warning: Plasma mode not available!]" and the relay triggers, but none of the Plasma specific functionality appears to work.

I'm sure I missed something somewhere but figured I'd reach out incase I haven't 😂

Plasma Config

; 350 - Plasma mode
$350=2
; 351 - Plasma THC delay
$351=1.0
; 358 - Plasma Arc fail timeout
$358=1.0
; 359 - Plasma Arc retry delay
$359=1.0
; 360 - Plasma Arc max retries
$360=3
; 366 - Arc voltage port
$366=0
; 367 - Arc ok port
$367=1
; 368 - Cutter down port
$368=3
; 369 - Cutter up port
$369=2
terjeio commented 6 months ago

Which board?

cdagneta commented 6 months ago

Teensy 4.1

{
  "driver": "iMXRT1062",
  "URL": "https://github.com/grblHAL/iMXRT1062",
  "board": "BOARD_T41U5XBB",
  "symbols": [
    "USB_SERIAL_CDC=1",
    "Y_AUTO_SQUARE=1",
    "PROBE_ENABLE=1",
    "KEYPAD_ENABLE=1",
    "BLUETOOTH_ENABLE=0",
    "PLASMA_ENABLE=1",
    "MCP3221_ENABLE=1",
    "NETWORKING_ENABLE=0",
    "ESTOP_ENABLE=1"
  ],
  "docker_instance": "",
  "grblHAL": "webBuilder"
}
$pins
[PIN:16,Feed hold]
[PIN:17,Cycle start]
[PIN:14,Emergency stop]
[PIN:15,Probe]
[PIN:20,X limit min]
[PIN:21,Y limit min]
[PIN:23,Y limit min 2]
[PIN:22,Z limit min]
[PIN:36,Aux in 0,P0]
[PIN:30,Aux in 1,P1]
[PIN:34,Aux in 2,P2]
[PIN:35,Aux in 3,P3]
[PIN:28,Aux in 5,P4]
[PIN:29,Aux in 6,P5]
[PIN:MCP3221:0,Aux analog in 0,No power]
[PIN:2,X step]
[PIN:4,Y step]
[PIN:8,Y2 step]
[PIN:6,Z step]
[PIN:3,X dir]
[PIN:5,Y dir]
[PIN:9,Y2 dir]
[PIN:7,Z dir]
[PIN:10,X enable]
[PIN:40,Y enable]
[PIN:38,Y enable]
[PIN:39,Z enable]
[PIN:12,Spindle on]
[PIN:11,Spindle direction]
[PIN:13,Spindle PWM]
[PIN:18,Mist]
[PIN:19,Flood]
[PIN:31,Aux out 0,P0]
[PIN:32,Aux out 1,P1]
[PIN:33,Aux out 2,P2]
[PIN:24,I2C SCK]
[PIN:25,I2C SDA]
[PIN:41,I2C strobe]
[PIN:0,RX,UART1]
[PIN:1,TX,UART1]
$i
[VER:1.1f.20240513:]
[OPT:NMTSL2,100,1024,3,0]
[AXS:3:XYZ]
[NEWOPT:ENUMS,RT+,HOME,ES,REBOOT,SED,RTC]
[FIRMWARE:grblHAL]
[SIGNALS:HSEP]
[NVS STORAGE:*FLASH]
[FREE MEMORY:484K]
[DRIVER:iMXRT1062]
[DRIVER VERSION:240404]
[DRIVER OPTIONS:USB.1]
[BOARD:T41U5XBB]
[AUX IO:6,3,0,0]
[PLUGIN:PLASMA v0.13]
[PLUGIN:KEYPAD v1.36]
$$
$0=10.0
$1=25
$2=0
$3=3
$4=7
$5=3
$6=0
$8=0
$9=0
$10=4095
$11=0.010
$12=0.002
$13=0
$14=70
$15=0
$16=0
$17=0
$18=0
$19=0
$20=1
$21=3
$22=49
$23=0
$24=100.0
$25=3000.0
$26=50
$27=1.000
$28=0.100
$29=0.0
$30=0.000
$31=0.000
$32=1
$33=0.0
$34=0.0
$35=0.0
$36=0.0
$37=7
$39=1
$40=1
$43=1
$44=4
$45=3
$46=0
$50=100.0
$51=600.0
$52=3000.0
$53=0.250
$54=500.0
$55=3000.0
$62=1
$63=3
$64=0
$65=0
$100=196.00000
$101=196.00000
$102=196.00000
$110=15000.000
$111=15000.000
$112=10000.000
$120=150.000
$121=150.000
$122=100.000
$130=765.000
$131=845.000
$132=93.000
$170=0.000
$171=0.000
$172=0.000
$341=0
$342=30.0
$343=25.0
$344=200.0
$345=200.0
$346=1
$347=5.0
$348=2.500
$349=25.000
$350=2
$351=1.0
$358=1.0
$359=1.0
$360=3
$366=0
$367=1
$368=2
$369=3
$370=0
$372=0
$384=0
$394=4.0
$398=100
$481=1000
$484=0
$486=0
$673=1.0
terjeio commented 6 months ago

There is an issue with the plugin claiming aux inputs - it does not do that successfully.

I wonder if there is a conflict with the keypad plugin, there should not be but can you try without it enabled? FYI since I am away for a while I am not able to debug this now, I only have two development cards available and a Teensy is not among them. With one of them I have confirmed that pin claiming is working so the plugin itself should be ok.

cdagneta commented 6 months ago

Removed the keypad plugin and I'm still getting the plasma mode not available warning.

cdagneta commented 6 months ago

I've been poking this a bit today. I compiled the code from https://github.com/grblHAL/iMXRT1062.git and have been stepping through enabling the individual plugins to figure out which addition breaks the pin assignment.

It appears to be related to the MCP3211 plugin being included with the webbuilder by default when you choose the plasma plugin. Compiling without the MCP3221 plugin works properly and adding the module in causes the warning to appear.

It does appear that the keypad plugin also mildly conflicts with the original auto claimed pins only if I upload firmware with the keypad plugin enabled AFTER testing with firmware that only has the plasma plugin first, the keypad plugin auto-claims pins that the plasma plugin had originally tried to auto-claim and causes a conflict. Re-configuring the previous plasma auto-claimed pins to ones that don't overlap with the keypad plugin resolves that issue after a reboot.

Failed - With PLASMA, MCP3221, Y_AUTO_SQUARE

[VER:1.1f.20240513:]
[OPT:VNMSL2,100,1024,3,0]
[AXS:3:XYZ]
[NEWOPT:ENUMS,RT+,ES,REBOOT,SED,RTC]
[FIRMWARE:grblHAL]
[SIGNALS:HSEP]
[NVS STORAGE:*FLASH]
[FREE MEMORY:484K]
[DRIVER:iMXRT1062]
[DRIVER VERSION:240404]
[DRIVER OPTIONS:USB.2]
[BOARD:T41U5XBB]
[AUX IO:7,3,0,0]
[PLUGIN:PLASMA v0.13]
M3
[MSG:Warning: Plasma mode not available!]
$pins
[PIN:16,Feed hold]
[PIN:17,Cycle start]
[PIN:14,Emergency stop]
[PIN:15,Probe]
[PIN:20,X limit min]
[PIN:21,Y limit min]
[PIN:23,Y limit min 2]
[PIN:22,Z limit min]
[PIN:36,Aux in 0,P0]
[PIN:30,Aux in 1,P1]
[PIN:34,Aux in 2,P2]
[PIN:35,Aux in 3,P3]
[PIN:41,Aux in 4,P4]
[PIN:28,Aux in 5,P5]
[PIN:29,Aux in 6,P6]
[PIN:MCP3221:0,Aux analog in 0,No power]
[PIN:2,X step]
[PIN:4,Y step]
[PIN:8,Y2 step]
[PIN:6,Z step]
[PIN:3,X dir]
[PIN:5,Y dir]
[PIN:9,Y2 dir]
[PIN:7,Z dir]
[PIN:10,X enable]
[PIN:40,Y enable]
[PIN:38,Y enable]
[PIN:39,Z enable]
[PIN:12,Spindle on]
[PIN:11,Spindle direction]
[PIN:13,Spindle PWM]
[PIN:18,Mist]
[PIN:19,Flood]
[PIN:31,Aux out 0,P0]
[PIN:32,Aux out 1,P1]
[PIN:33,Aux out 2,P2]
[PIN:24,I2C SCK]
[PIN:25,I2C SDA]
[PIN:0,RX,UART1]
[PIN:1,TX,UART1]
$$
$0=10.0
$1=25
$2=0
$3=0
$4=7
$5=7
$6=1
$8=0
$9=1
$10=511
$11=0.010
$12=0.002
$13=0
$14=70
$15=0
$16=0
$17=0
$18=0
$19=0
$20=0
$21=0
$22=0
$23=0
$24=25.0
$25=500.0
$26=250
$27=1.000
$28=0.100
$29=0.0
$30=1000.000
$31=0.000
$32=0
$33=5000.0
$34=0.0
$35=0.0
$36=100.0
$37=0
$39=1
$40=0
$43=1
$44=4
$45=3
$46=0
$62=0
$63=3
$64=0
$65=0
$100=250.00000
$101=250.00000
$102=250.00000
$110=500.000
$111=500.000
$112=500.000
$120=10.000
$121=10.000
$122=10.000
$130=200.000
$131=200.000
$132=200.000
$170=0.000
$171=0.000
$172=0.000
$341=0
$342=30.0
$343=25.0
$344=200.0
$345=200.0
$346=1
$347=5.0
$348=2.500
$349=25.000
$350=2
$351=3.0
$358=3.0
$359=3.0
$360=3
$366=0
$367=6
$368=5
$369=4
$370=240
$372=0
$384=0
$394=4.0
$398=100
$481=0
$484=1
$486=0
$673=1.0

Success - With PLASMA, Y_AUTO_SQUARE

[VER:1.1f.20240513:]
[OPT:VNMSL2,100,1024,3,0]
[AXS:3:XYZ]
[NEWOPT:ENUMS,RT+,ES,REBOOT,SED,RTC,THC]
[FIRMWARE:grblHAL]
[SIGNALS:HSEP]
[NVS STORAGE:*FLASH]
[FREE MEMORY:484K]
[DRIVER:iMXRT1062]
[DRIVER VERSION:240404]
[DRIVER OPTIONS:USB.2]
[BOARD:T41U5XBB]
[AUX IO:4,3,0,3]
[PLUGIN:PLASMA v0.13]
M3
[MSG:arc on]
[MSG:arc delay]
[MSG:arc on]
[MSG:arc delay]
[MSG:arc on]
[MSG:Warning: arc failed]
ok
$pins
[PIN:16,Feed hold]
[PIN:17,Cycle start]
[PIN:14,Emergency stop]
[PIN:15,Probe]
[PIN:20,X limit min]
[PIN:21,Y limit min]
[PIN:23,Y limit min 2]
[PIN:22,Z limit min]
[PIN:36,Aux in 0,P0]
[PIN:30,Aux in 1,P1]
[PIN:34,Aux in 2,P2]
[PIN:35,Aux in 3,P3]
[PIN:41,Aux in 4,Cutter up]
[PIN:28,Aux in 5,Cutter down]
[PIN:29,Aux in 6,Arc ok]
[PIN:2,X step]
[PIN:4,Y step]
[PIN:8,Y2 step]
[PIN:6,Z step]
[PIN:3,X dir]
[PIN:5,Y dir]
[PIN:9,Y2 dir]
[PIN:7,Z dir]
[PIN:10,X enable]
[PIN:40,Y enable]
[PIN:38,Y enable]
[PIN:39,Z enable]
[PIN:12,Spindle on]
[PIN:11,Spindle direction]
[PIN:13,Spindle PWM]
[PIN:18,Mist]
[PIN:19,Flood]
[PIN:31,Aux out 0,P0]
[PIN:32,Aux out 1,P1]
[PIN:33,Aux out 2,P2]
[PIN:0,RX,UART1]
[PIN:1,TX,UART1]
$$
$0=10.0
$1=25
$2=0
$3=0
$4=7
$5=7
$6=1
$8=0
$9=1
$10=511
$11=0.010
$12=0.002
$13=0
$14=70
$15=0
$16=0
$17=0
$18=0
$19=0
$20=0
$21=0
$22=0
$23=0
$24=25.0
$25=500.0
$26=250
$27=1.000
$28=0.100
$29=0.0
$30=1000.000
$31=0.000
$32=0
$33=5000.0
$34=0.0
$35=0.0
$36=100.0
$37=0
$39=1
$40=0
$43=1
$44=4
$45=3
$46=0
$62=0
$63=3
$64=0
$65=0
$100=250.00000
$101=250.00000
$102=250.00000
$110=500.000
$111=500.000
$112=500.000
$120=10.000
$121=10.000
$122=10.000
$130=200.000
$131=200.000
$132=200.000
$170=0.000
$171=0.000
$172=0.000
$341=0
$342=30.0
$343=25.0
$344=200.0
$345=200.0
$346=1
$347=5.0
$348=2.500
$349=25.000
$350=2
$351=3.0
$356=90
$358=3.0
$359=3.0
$360=3
$367=6
$368=5
$369=4
$370=240
$372=0
$384=0
$394=4.0
$398=100
$481=0
$484=1
$486=0
$673=1.0

Success - With PLASMA, KEYPAD, Y_AUTO_SQUARE

[VER:1.1f.20240513:]
[OPT:VNMSL2,100,1024,3,0]
[AXS:3:XYZ]
[NEWOPT:ENUMS,RT+,ES,REBOOT,SED,RTC,THC]
[FIRMWARE:grblHAL]
[SIGNALS:HSEP]
[NVS STORAGE:*FLASH]
[FREE MEMORY:484K]
[DRIVER:iMXRT1062]
[DRIVER VERSION:240404]
[DRIVER OPTIONS:USB.2]
[BOARD:T41U5XBB]
[AUX IO:3,3,0,3]
[PLUGIN:PLASMA v0.13]
[PLUGIN:KEYPAD v1.36]
M3
[MSG:arc on]
[MSG:arc ok]
$pins
[PIN:16,Feed hold]
[PIN:17,Cycle start]
[PIN:14,Emergency stop]
[PIN:15,Probe]
[PIN:20,X limit min]
[PIN:21,Y limit min]
[PIN:23,Y limit min 2]
[PIN:22,Z limit min]
[PIN:36,Aux in 0,P0]
[PIN:30,Aux in 1,Arc ok]
[PIN:34,Aux in 2,Cutter up]
[PIN:35,Aux in 3,Cutter down]
[PIN:28,Aux in 5,P1]
[PIN:29,Aux in 6,P2]
[PIN:2,X step]
[PIN:4,Y step]
[PIN:8,Y2 step]
[PIN:6,Z step]
[PIN:3,X dir]
[PIN:5,Y dir]
[PIN:9,Y2 dir]
[PIN:7,Z dir]
[PIN:10,X enable]
[PIN:40,Y enable]
[PIN:38,Y enable]
[PIN:39,Z enable]
[PIN:12,Spindle on]
[PIN:11,Spindle direction]
[PIN:13,Spindle PWM]
[PIN:18,Mist]
[PIN:19,Flood]
[PIN:31,Aux out 0,P0]
[PIN:32,Aux out 1,P1]
[PIN:33,Aux out 2,P2]
[PIN:24,I2C SCK]
[PIN:25,I2C SDA]
[PIN:41,I2C strobe]
[PIN:0,RX,UART1]
[PIN:1,TX,UART1]
$$
$0=10.0
$1=25
$2=0
$3=0
$4=7
$5=7
$6=1
$8=0
$9=1
$10=511
$11=0.010
$12=0.002
$13=0
$14=70
$15=0
$16=0
$17=0
$18=0
$19=0
$20=0
$21=0
$22=0
$23=0
$24=25.0
$25=500.0
$26=250
$27=1.000
$28=0.100
$29=0.0
$30=1000.000
$31=0.000
$32=0
$33=5000.0
$34=0.0
$35=0.0
$36=100.0
$37=0
$39=1
$40=0
$43=1
$44=4
$45=3
$46=0
$50=100.0
$51=600.0
$52=3000.0
$53=0.250
$54=500.0
$55=3000.0
$62=0
$63=3
$64=0
$65=0
$100=250.00000
$101=250.00000
$102=250.00000
$110=500.000
$111=500.000
$112=500.000
$120=10.000
$121=10.000
$122=10.000
$130=200.000
$131=200.000
$132=200.000
$170=0.000
$171=0.000
$172=0.000
$341=0
$342=30.0
$343=25.0
$344=200.0
$345=200.0
$346=1
$347=5.0
$348=2.500
$349=25.000
$350=2
$351=3.0
$356=90
$358=3.0
$359=3.0
$360=3
$367=1
$368=3
$369=2
$370=224
$372=0
$384=0
$394=4.0
$398=100
$481=0
$484=1
$486=0
$673=1.0
terjeio commented 6 months ago

It appears to be related to the MCP3211 plugin being included with the webbuilder by default when you choose the plasma plugin. Compiling without the MCP3221 plugin works properly and adding the module in causes the warning to appear.

Good to know- I have to figure out why. The board I have here works with the MCP enabled, but that has the MCP code in ioports_analog.c unlike the Teensy where it is still in ioports.c. I'll move it when I am back home. I'll also update the webuilder to not enable the MCP driver by default and make it an option instead.

It does appear that the keypad plugin also mildly conflicts with the original auto claimed pins only if I upload firmware with the keypad plugin enabled AFTER testing with firmware that only has the plasma plugin first, the keypad plugin auto-claims pins that the plasma plugin had originally tried to auto-claim and causes a conflict.

This is/could be a tricky one to resolve, one option would be to not assign pins per default and force the user to do it instead. WIll have to think about it.

cdagneta commented 6 months ago

Good to know- I have to figure out why. The board I have here works with the MCP enabled, but that has the MCP code in ioports_analog.c unlike the Teensy where it is still in ioports.c. I'll move it when I am back home. I'll also update the webuilder to not enable the MCP driver by default and make it an option instead.

👍

terjeio commented 5 months ago

MCP3221 support (when available) must now be enabled separately in the Web Builder - in the Optional inputs tab.