Variable confusion in M command.
-
@Chriss can you paste in your whole config.g - its sounds like those variables are not initialised before you try and use them in config.g
I assume that when you run the M558 line from the dWC console after boot it works fine, as it does via telnet?
-
@Chriss this is fixed in the latest RRF 3.5 build at https://www.dropbox.com/scl/fo/yzchzlyxmxlzywjawqflu/h?rlkey=tl7dfs75yozhfgpze0jnkn32n&dl=0.
-
@dc42 I still get the same error after the upgrade.
Duet 3 Mini 5+ Mini5plus 3.5.0-rc.3+ Duet 3 Expansion TOOL1LC TOOL1LC 3.5.0-rc.3+ Duet WiFi Server n/a 2.1beta7 Duet Web Control DWC 3.5.0-rc.3
@T3P3Tony
Here is my entire config.g.; Hardware: Duet Mini 5+ ; Toolboard 1.1 LC ; PalenlDue 7" PanelDueFirmware-logo-3.5.0-rc8-7.0i.bin ; Stepper XY = LDO 0,9° 2Amax LDO-42STH40-2004MAC ; Stepper Z = LDO 1,8° 2Amax LDO-42STH48-2004AC ; Stepper E = LDO 1,8 1Amax LDO-42STH20-1004ASH ; Enable network if {network.interfaces[0].type = "ethernet"} M552 P0.0.0.0 S1 else M552 S1 ; Network M586 P0 S1 ; enable HTTP M586 P1 S1 ; enable FTP M586 P2 S1 ; enable Telnet G90 ; send absolute coordinates... M83 ; ...but relative extruder moves M550 P"v2" ; set printer name M669 K1 ; 1=select CoreXY mode 0=Cadasian ;; Helpful Toolboards commands ; M115 B121 ; Show board 121 ; M997 B121 ; Update tool 121 ; M122 B121 ; Detailed status of toolboard G4 S1 ; wait 1s for expansion boards to start ;;; Drives ;X M569 P0.2 S1 D3 ; physical drive 0.2 goes forward M584 X0.2 ; Map the stepper to X ;Y M569 P0.1 S0 D3 ; physical drive 0.1 goes backward M584 Y0.1 ; Map the stepper to Y ;; Z ; - front left M569 P0.5 S1 D3 ; physical drive 0.5 goes forward ; - front right M569 P0.6 S0 D3 ; physical drive 0.6 goes backward ; - back right M569 P0.0 S1 D3 ; physical drive 0.0 goes forward ; - back left M569 P0.4 S0 D3 ; physical drive 0.4 goes backward M584 Z0.5:0.4:0.0:0.6 ; Mapping ;; E M569 P121.0 S0 D3 ; Extruder stepper goes backward M584 E121.0 ; Map the E stepper to E ; Stepper settings M350 X16 Y16 Z16 E32 I1 ; configure microstepping with interpolation M92 X160 Y160 Z400 E823 ; set steps per mm (800 from manuall, measured 823 M98 P"/macros/print_scripts/speed_printing.g" ; Accelerations and speed M906 X1400 Y1400 Z1000 E700 I30 ; set motor currents (mA) and motor idle factor in per cent (E stepper max 1A) M84 S120 ; Idle timeout ; Axis Limits M208 X0 Y0 Z0 S1 ; set axis minima M208 X250 Y258 Z210 S0 ; set axis maxima ;; Endstops -- Display status with: M119 M574 Y2 S1 P"0.io5.in" ; Y M574 X2 S1 P"!0.io6.in" ; X M574 Z0 P"nil" ; No endstop we have the switch and a probe M574 Z1 S2 ; configure Z-probe endstop for low end on Z ; Z probe M98 P"/macros/print_scripts/activate_z_probe.g" ; Z-level settings ;M671 X-75:-75:288:289 Y0:320:320:0 S20 ; Define Z belts locations (Front_Left, Back_Left, Back_Right, Front_Right) ;M671 X-75:-75:288:289 Y0:328:328:0 S20 ; Define Z belts locations (Front_Left, Back_Left, Back_Right, Front_Right) M671 X-75:-75:288:289 Y0:358:358:0 S20 ; Define Z belts locations (Front_Left, Back_Left, Back_Right, Front_Right) ;; Define the mesh ;M557 X5:245 Y22:245 S35 ; spacing ;M557 X5:245 Y22:245 P9 ; grid (points per axis) M557 X5:245 Y22:220 P9 ; grid (points per axis) ;; Heaters :: Tune with: M303 H0 S110 ; Bed M308 S0 P"0.temp0" Y"thermistor" A"Bed" T100000 B4138 ; configure sensor 0 as thermistor on pin temp0 M950 H0 C"out5+out6" T0 Q10 ; create bed heater outputs for both SSRs on out0 and map it to sensor 0 M307 H0 B0 S1.00 ; disable bang-bang mode for the bed heater and set PWM limit M140 H0 ; map heated bed to heater 0 M143 H0 S120 ; set temperature limit for heater 0 to 120C ;; Bed Corner temp sensor (2=Orange, 3=Brown, 4=Green, 5=Yellow, 6=Purple 7=Black, ) ; Configure Bed corner temp sensor as thermistor on pin temp2 M308 S5 P"0.temp2" Y"thermistor" A"Bed-Corner" T100000 B4138 ; Hotend ; Tune in with: M303 H1 S270 (270=Temp) (M500 to save) ; Show current settings M307 H1 ;M308 S1 P"121.temp0" Y"thermistor" A"Hotend" T500000 B4702 C1.171057e-7 ; configure sensor 1 as thermistor on pin temp1 Mosquito ;M308 S1 P"121.temp0" A"Hotend" Y"thermistor" T100000 B4725 C7.06e-8 ; define E0 temperature sensor Rapido Argo M308 S1 P"121.temp0" A"Hotend" Y"thermistor" T100000 B4725 C7.060000e-8 ; define E0 temperature sensor e3d revo M950 H1 C"121.out0" T1 ; create nozzle heater output on 0.out3 and map it to sensor 1 M143 H1 S300 ; set temperature limit for heater 1 to 300C ;; Fans ; Fan for the printed part: M950 F0 C"121.out1" Q500 ; create fan 0 on pin 0.out9 and set its frequency M106 P0 S0 H-1 C"Part" ; set fan 0 value. Thermostatic control is turned off ; Fan for the Hotend: M950 F1 C"121.out2" Q500 ; create fan 1 on pin 0.out9 and set its frequency M106 P1 S1 H1 T45 C"Hotend" ; P="set fan 1" S="value" H="Thermostatic control Heater No." T=" is turned on at 45°C" ;; Tool M563 P0 S"Tool" D0 H1 F0 ; define tool G10 P0 X0 Y0 Z0 ; set tool 0 axis offsets G10 P0 R0 S0 ; set initial tool 0 active and standby temperatures to 0C ; Filament sensor : Status M591 D0 ;M591 D0 P7 C"io4.in" L7 R50:150 E5 S0 ;pulse, disabled, 7 mm/pulse, measure every 22 sec, minimum 50 maximum 250, S1 = Enabled S0 = Disabled ;M591 D0 P1 C"io4.in" S1 M950 J3 C"!io4.in" ; Create a trigger on io4.in (NC) M581 P3 T3 S0 R1 ; R1=Trigger only while printing ;; Chamber temp sensor M308 S4 P"0.temp1" Y"thermistor" A"Chamber" T100000 B4138 ; configure Chamber temp sensor as thermistor on pin temp1 ;; Input Shaping ; Accelerometer https://duet3d.dozuki.com/Wiki/Input_shaping M955 P121.0 I05 ; specify orientation of accelerometer on Toolboard 1LC with CAN address 121 ; Input Shaping ;M593 P"zvd" F40.5 ; use ZVD input shaping to cancel ringing at 40.5Hz ;M593 P"none" ; disable input shaping ;M593 P"custom" H0.4:0.7 T0.0135:0.0135 ; use custom input shaping ; PA https://duet3d.dozuki.com/Wiki/Pressure_advance M572 D0 S0.025 ;;;;;;;;;;;; Setup Only ;M564 S0 H0 ; Allow movement over the endstops ;M302 P1 ; allow cold extrusion ;M302 S1 ; deny cold extrusion ;;;;;;;;;;;; Setup Only END ;; Case Cooling ; Temps M308 S9 P"mcu-temp" Y"mcu-temp" A"Mainboard" ; define sensor 9 to be mcu temperature ; Case Fans M950 F3 C"!0.out3" Q50 ; Fan on out3 ground on top pin, plus on 3rd pin from top (V_OUTLC1) M106 P3 C"Base" S120 ; Setup the FAN and slow it down ; Nevermore m950 F4 C"0.out0" Q50 m106 P4 C"Nevermore" S0 ; Define the LED stripe and turn it off M950 F5 C"0.out1" Q100 ; LED on out1 M106 P5 C"LED" S0 ; Make sure that the LEDs are off ; Trigger on the toolboard ; Front button M950 J14 C"121.button0" M581 T14 P14 S1 R0 ; Rear button M950 J15 C"121.button1" M581 T15 P15 S1 R0 ;######################################## M950 J1 C"^0.io1.in" M581 P1 T2 S0 ;M572 D0 S0.037 ; Set preasure Advance Gemessen M501 ; Load config-override.g ;; Serial interface ; Duet M575 P1 S1 B57600 ;;;;;; Old Display ;M575 P1 B115200 S1 ;; Mini 12864 ;M918 P2 ;M918 P2 E4 R3 C100 ;M150 X2 R255 U255 B255 S3 ; set all 3 LEDs to white ;M150 X2 R0 U255 B0 S3 ; set all 3 LEDs to red T0 ; Select the tool 0 as default ; Make sure that all heaters are off M104 S0 ; Extruder temp to 0 M568 P0 A0 ; Extruder heater off M140 S0 ; Set the bed temp to 0 M140 S-276 ; Bed heater off ; Some variables for later global tool_temp_initial=0 global bed_temp_initial=0 global debug=false ; AutoZ global klicky_home=true global qgl_done=false global nozzle_cleaned=false global Zswitch_homed=false global probetype="euclid" global clickystatus = "none" global probe_settingsH=10 global probe_settingsA=1 global autoz_temp2=20 # Stealthburner LEDs: global sb_leds="n-off" M98 P"/macros/sb_leds/sb_leds.g" set global.sb_leds="hot" set global.sb_leds="n-off" ;set global.sb_logo="red" ;set global.sb_leds="n-off" ;global sb_nozzle="off" ; M307 H0 R0.327 C227.635:227.635 D5.48 S1.00 V24.4 B0 I0 ; R altered for a firmware bug ; EOF
It works via the DWC:
Cheers, Chriss
-
@Chriss are you running in standalone or SBC mode?
-
@Chriss You have some macro calls in your config.g file, I think we will need to see those (along with any macros that they may call).
-
@Chriss Standalone....
-
@gloomyandy
That is a deep thingy of macro calls.... I can upload all of my macros if you need that.. But I think that David is already on the right track... -
@Chriss In which case I'll leave it with you. You might want to check that none of the scripts that you call in config.g are trying to make use of the globals that you create later on in the config.g file. That is what this problem looks like to me...
-
You are wrong here. I initialize the variables in the config,g. The start gcode from the slicer starts a macro, which starts a other macro with starts the next macro and that one reports the problem.
And you see that the macro contains two variables:
The error report is only about the first variable, the 2nd seems to be OK, at least form the error message.
-
@dc42 My reply was wrong; Standalone
P.s.: Would it make sense to drive a 5+ in SBC?
-
This post is deleted! -
P.s.: Would it make sense to drive a 5+ in SBC?
That was not very serious. I was in troll mode...
-
@Chriss have you try looking at global variables in the Object Model browser in DWC, to see whether those global variables exist?
-
@Chriss Yes I see them, you can see the screenshot in my initial post. And I would expect a complain if the variable does not exist and I use the command via telnet or the DWC.
One more observation: I have the feeling that I see the error since I have upgraded the display (!!!) to 3.4rc3. I have no idea how that could influence the firmware to be honest but that is what I have in my memories. (Yes, I see the error in the logfile and in the DWC, not on the display only.)
Does that makes sene to you?
Cheers, Chriss
-
One more thing: I see the error already at boot time not only when when the macro gets called, if that helps.....
-
@Chriss If you are getting that error at boot time then something in your config.g file or the macros it calls is referencing the global. You seem to call two macros in your config.g and both of those calls are before you have created the globals are you sure that those macros (or any others they may call) do not try to reference the globals before you have created them?
From your config.g:
M98 P"/macros/print_scripts/speed_printing.g" ; Accelerations and speed M98 P"/macros/print_scripts/activate_z_probe.g"
-
@gloomyandy Holy cow... you are right.... the /macros/print_scripts/activate_z_probe.g contains:
M558 P8 H{global.probe_settingsH} A{global.probe_settingsA} S0.003 F700:120 C"^121.io2.in" T8000 B0 R0
But this part of the config is older than the stone age, and the error popped up after a recent upgrade. I'm sure that I observed this messages after a print start too. So Davids fix did something too. I did not see the messages after I started the current print, my guess is that we had two problems here.
Long story short, I moved the variables to the start of the config,g. I will reboot the printer later today when the current print has completed and let you guys know.
Cheers, Chriss
-
@Chriss The code to report errors in the config.g file during RRF startup is a new feature in 3.5, so you would not have seen that message in early versions.
-
Got it... I'm not sure what the previous version of that printer was. I should have a logbook for that purpose.
Anyway, whatever David did suppressed the error message when the activate_z_probe.g gets triggered in the homing moves. My conclusion is that it was not only my stupidity with the order of the commands in the config.g
I guess that it is solved now.
Cheers, Chriss
P.s.: I just saw this:
M558 now supports two dive heights. When probing multiple times at the same point, the second and subsequent probes use the second dive height and it is calculated relative to the height at which the probe last triggered. The idea is to speed up probing if you make the second dive height smaller than the first.
I think that I do not need my hack with the variables for H and A anymore for M588. I should read the release nodes more carefully.