Bug 2: RRF 3.3beta2 Axis hanging after M584 re-assignemnt
-
Related to using syringe pumps as discussed:
https://forum.duet3d.com/topic/21815/syringe-pumps-depositing-viscous-materials/18?_=1616236469240
Relevant section of config.g
; Free endstops M574 X0 P"nil" ; no X endstop switch, free up X endstop input M574 Y0 P"nil" ; no Y endstop switch, free up Y endstop input M574 Z0 P"nil" ; no Z endstop switch, free up Z endstop input [...clip...] M98 P"set_syringe_settings.g"
set_syringe_settings.g
; Setup e0stop and e1stop inputs to trigger trigger2.g and trigger3.g M950 J0 C"^e0stop" ; Input 0 uses e0Stop pin, pullup enabled M950 J1 C"^e1stop" ; Input 1 uses e4Stop pin, pullup enabled ; Define triggers M581 T2 P0 S0 R0 ; Run sys/trigger2.g on falling edge on input 0 at any time. M581 T3 P1 S0 R0 ; Run sys/trigger3.g on falling edge on input 1 at any time. ; Drive Settings M350 E16 B16 I1 ; configure microstepping with interpolation M92 E400 B400 ; set steps per mm M566 E450 B450 ; set maximum instantaneous speed changes (mm/min) M203 E1200 B1200 ; set maximum speeds (mm/min) M201 E450 B450 ; set accelerations (mm/s^2) M906 E2000 B2000 I30 ; set motor currents (mA) and motor idle factor in per cent M208 B0:300 ; Set axis limits
trigger2.g
; Used to switch the E axis from the primary to secondary syringe. M98 P"set_secondary_syringe.g" G91 G1 H1 B-100 F400 ; Drive empty syringe to limit.
trigger3.g
; Used to switch the E axis from the secondary to primary syringe. M98 P"set_primary_syringe.g" G91 G1 H1 B-100 F400 ; Drive empty syringe to limit. G90
Sequence that raises bug:
[DWC estop]
G1 E50 F500
[axis drives as expected]
[physically trigger e0stop]
[axis retracts upto limit switch]G1 E50 F500
[No movement...]
M122
[response in code block below.]=== Diagnostics === RepRapFirmware for Duet 2 WiFi/Ethernet version 3.3beta2 running on Duet Ethernet 1.02 or later Board ID: 08DGM-917DA-G4MS8-6JKD4-3S86M-19S7A Used output buffers: 1 of 24 (12 max) === RTOS === Static ram: 21568 Dynamic ram: 70680 of which 12 recycled Never used RAM 22156, free system stack 112 words Tasks: NETWORK(ready,222) HEAT(delaying,310) MAIN(running,459) IDLE(ready,20) Owned mutexes: === Platform === Last reset 00:01:57 ago, cause: software Last software reset at 2021-03-20 11:56, reason: User, GCodes spinning, available RAM 22156, slot 2 Software reset code 0x0003 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x0041f000 BFAR 0xe000ed38 SP 0x00000000 Task MAIN Freestk 0 n/a Error status: 0x00 Aux0 errors 0,0,0 MCU temperature: min 32.5, current 34.4, max 34.6 Supply voltage: min 24.2, current 24.3, max 24.4, under voltage events: 0, over voltage events: 0, power good: yes Heap OK, handles allocated/used 0/0, heap memory allocated/used/recyclable 0/0/0, gc cycles 0 Driver 0: position 0, standstill, SG min/max not available Driver 1: position 0, standstill, SG min/max not available Driver 2: position 0, standstill, SG min/max not available Driver 3: position 0, standstill, SG min/max 0/0 Driver 4: position 0, standstill, SG min/max not available Driver 5: position 0 Driver 6: position 0 Driver 7: position 0 Driver 8: position 0 Driver 9: position 0 Driver 10: position 0 Driver 11: position 0 Date/time: 2021-03-20 11:58:18 Cache data hit count 130708414 Slowest loop: 8.09ms; fastest: 0.22ms I2C nak errors 0, send timeouts 0, receive timeouts 0, finishTimeouts 0, resets 0 === Storage === Free file entries: 10 SD card 0 detected, interface speed: 20.0MBytes/sec SD card longest read time 1.1ms, write time 0.0ms, max retries 0 === Move === DMs created 83, maxWait 10257ms, bed compensation in use: none, comp offset 0.000 === MainDDARing === Scheduled moves 3, completed moves 3, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 2], CDDA state -1 === AuxDDARing === Scheduled moves 0, completed moves 0, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 0], CDDA state -1 === Heat === Bed heaters = 0 -1 -1 -1, chamberHeaters = -1 -1 -1 -1 Heater 1 is on, I-accum = 0.0 === GCodes === Segments left: 0 Movement lock held by null HTTP is idle in state(s) 0 Telnet is idle in state(s) 0 File is idle in state(s) 0 USB is idle in state(s) 0 Aux is idle in state(s) 0 Trigger is idle in state(s) 0 Queue is idle in state(s) 0 LCD is idle in state(s) 0 Daemon is idle in state(s) 0 Autopause is idle in state(s) 0 Code queue is empty. === Network === Slowest loop: 9.38ms; fastest: 0.02ms Responder states: HTTP(0) HTTP(0) HTTP(0) HTTP(0) FTP(0) Telnet(0), 0 sessions HTTP sessions: 1 of 8 Interface state active, link 100Mbps full duplex
G1 E5 B5 F500
[both move]
-
@DocTrucker said in [Bug 2: RRF 3.3beta2 Axis hanging after M584 re-assignemnt]
Sequence that raises bug:
[DWC estop]
G1 E50 F500
[trigger e0stop]
G1 E50 F500
[No movement...]
I really have no idea what you mean here. For example what does [DWC estop] mean?
As to the lack of movement for the second G1 that is likely because your are in absolute mode (G90 as opposed to G91) thus a move to E50 when you are already at E50 won't do anything.
Frederick
-
DWC estop = Duet Web Control emergency stop.
Why would the first G1 E command work fine (and a second if requested) but the second hang? The macros swap to relative for the home drive (when asigned to B axis) but switch back to absolute. The extruder axis is running in relative mode and not altered.
-
Edited the original post to make it clearer.
-
@DocTrucker said in Bug 2: RRF 3.3beta2 Axis hanging after M584 re-assignemnt:
DWC estop = Duet Web Control emergency stop.
Why would the first G1 E command work fine (and a second if requested) but the second hang?
The extruder axis is running in relative mode and not altered.Are you sure the E axis is in relative mode?
Where does it get set to relative mode?
Frederick
-
Yes because it moves twice if I repeat G1 E5 F500 before re-assigning the drives. Also the following line is at the head of the config file:
; General preferences G90 ; send absolute coordinates... M83 ; ...but relative extruder moves
I had however forgot to include the macros that re-assign the drives:
set_primary_syring
M584 E3 B4 ; Set primary syringe to active M574 B1 S1 P"ystop" ; Set limit switch
set_secondary_syring
M584 E4 B3 ; Swap drives M574 B1 S1 P"xstop" ; Set limit
-
The whole config file won't make a massive amount of sense as I am just using the printer to test the dual syringe system before the hardware arrives.
Primary syringe on physical drive 3 (e0)
Secondary syringe on physical drive 4 (e1)xstop = Primary syringe full, set as limit when running as B axis as you can't do a home drive on an extruder.
ystop = Secondary syringe full, set as limit when running as B axis as you can't do a home drive on an extruder.e0stop = Primary syringe empty. Used to trigger trigger2.g which swaps the drive assignment to E to the secondary syringe, and assigns the primary syringe drive to the B axis.
e1stop = Secondary syringe empty. Used to trigger trigger3.g which swaps the drive assignment to E to the secondary syringe, and assigns the secondary syringe drive to the B axis.config.g
; Configuration file for Duet WiFi (firmware version 3) ; General preferences G90 ; send absolute coordinates... M83 ; ...but relative extruder moves M550 P"DS" ; set printer name ; Network M540 PBE:EF:DE:AD:FE:F2 ; set custom MAC address M552 P192.168.85.116 S1 ; enable network and set IP address M553 P255.255.255.0 ; set netmask M554 P192.168.85.1 ; set gateway M586 P0 S1 ; enable HTTP M586 P1 S0 ; disable FTP M586 P2 S0 ; disable Telnet ; ###### ; Free endstops M574 X0 P"nil" ; no X endstop switch, free up X endstop input M574 Y0 P"nil" ; no Y endstop switch, free up Y endstop input M574 Z0 P"nil" ; no Z endstop switch, free up Z endstop input ; Drives M569 P0 S1 ; physical drive 0 goes forwards M569 P1 S1 ; physical drive 1 goes forwards M569 P2 S1 ; physical drive 2 goes forwards M569 P3 S1 ; physical drive 3 goes forwards M569 P4 S1 ; physical drive 4 goes forwards ;M584 X0 Y1 Z2 E3:4 ; set drive mapping M584 X0 Y1 Z2 M350 X16 Y16 Z16 I1 ; configure microstepping with interpolation M92 X100.00 Y100.00 Z3200.00 ; set steps per mm M566 X450.00 Y450.00 Z24.00 ; set maximum instantaneous speed changes (mm/min) M203 X12000.00 Y12000.00 Z250.20 ; set maximum speeds (mm/min) M201 X1800.00 Y1800.00 Z250.00 ; set accelerations (mm/s^2) M906 X2000 Y2000 Z800 I30 ; set motor currents (mA) and motor idle factor in per cent M84 S30 ; Set idle timeout M593 F0 ; Configure dynamic acceleration adjustment. M98 P"set_primary_syringe.g" M98 P"set_syringe_settings.g" ; Axis Limits M208 X-104.6:83 Y-102.00:102.5 Z-5:196 B0:300 ;M208 X-104.6 Y-102 Z-5 S1 ; set axis minima ;M208 X83 Y102.5 Z196 S0 ; set axis maxima ; Lead screws ;M671 X165.0:-165.0 Y0.0:0.0 ; Z leadscrews are at (-165,0), (165,0) ; Endstops ;M574 X1 S1 P"xstop" ; configure active-high endstop for low end on X via pin xstop ;M574 Y1 S1 P"ystop" ; configure active-high endstop for low end on Y via pin ystop ;M574 Z0 P"nil" ; no Z endstop switch, free up Z endstop input ; Z-Probe M558 P5 C"zstop" H2.5 F100 T6000 A5 S0.03 R1 ; Set Z probe type to unmodulated and the dive height + speeds. Prod 5 times max to reach 0.03 tollerance. G31 P500 X0 Y-59 Z1.17 ; set Z probe trigger value, offset and trigger height M556 S74.25 X0 Y0 Z0 ; set orthogonal axis compensation parameters M557 X-85:80 Y-85:39 S33:24.8 ; define mesh grid ; Heaters M308 S0 P"bedtemp" Y"thermistor" T100000 B3950 ; configure sensor 0 as thermistor on pin bedtemp M950 H0 C"bedheat" T0 ; create bed heater output on bedheat 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 A0 C0 ; Raise a heater fault if heatbed exceeds 120C. ;M308 S1 P"spi.cs1" Y"rtd-max31865" ; configure sensor 1 as pt100 via CS pin spi.cs1 ;M305 P1 B4725 C7.060000e-8 R4700 ; https://e3d-online.dozuki.com/Guide/V6+RepRap+Firmware+Configuration/26 ;e0temp M308 S1 P"e0temp" Y"thermistor" B4725 C7.060000e-8 ; configure sensor 1 as thermistor via pin e0temp M950 H1 C"e0heat" T1 ; create nozzle heater output on e0heat and map it to sensor 1 M307 H1 B0 S1.00 ; disable bang-bang mode for heater and set PWM limit M143 H1 S300 A0 C0 ; Raise a heater fault if hotend exceeds 300C. M570 H0 P10 T10 S1 ; Allow a heat bed anomaly to persist for 10 seconds (P10) ; on the before raising a heater fault. Allow a 10C deviation ; from set point (T10) After 0.17 minutes of heater fault ; cancel the build (S0.17). M570 H1 P10 T10 S1 ; Allow a hot end anomaly to persist for 10 seconds (P10) ; on the before raising a heater fault. Allow a ; 10C deviation from set point (T10 - default) After 0 ; minutes of heater fault cancel the build (S0.17). ; Fans M950 F0 C"fan0" Q500 ; create fan 0 on pin fan0 and set its frequency M106 P0 S0 H-1 ; set fan 0 value. Thermostatic control is turned off ; Tools M563 P0 S"E3D V6 Hotend" D0 H1 F0 ; define tool 0 G10 P0 X0 Y0 Z0 ; set tool 0 axis offsets G10 P0 R0 S0 ; set initial tool 0 active and standby temperatures to 0C T0 ; select tool 0 M302 P1; allow cold extrude G92 X0 Y0 Z0 B0 ; set position ; Automatic saving after power loss is not enabled ; Custom settings are not defined ; Miscellaneous M80 ; Enable PS_ON M501 ; load saved parameters from non-volatile memory ;T0 ; select first tool
-
Hi,
Is there a reason to have just one logical extruder and have to swap as opposed to having two logical extruders?
The firmware already has features to handle multiple tools - which sounds like what you have.
Is it because of the "homing" issue?
Frederick
-
Progress. It has something to do with idle hold. If I sent M84 after the syringe swap. The second axis works as expected. Also if I wait for long enough after the hung command the machine has a subtle tone changes and the axus runs as expected.
So the following sequence of gcodes fails with a hung command...
G1 E25 F500 G1 E25 F500 M584 E4 B3 M574 B1 S1 P"xstop" G91 G1 H1 B-100 F400 G90 M83 ; this has no effect on this problem G1 E25 F500 ; this command not executed.
But the following works fine...
G1 E25 F500 G1 E25 F500 M584 E4 B3 M574 B1 S1 P"xstop" G91 G1 H1 B-100 F400 G90 M84 ; STOP IDLE HOLD G1 E25 F500 G1 E25 F500
Edit: I'll be testing this more to see if the hold issue effects all drives, or just the E/B. Likewise I wouod like to restrict the Idle hold command to just the E and/or B axis to avoid quality issues. Ideally what ever calling M84 fixes can be resolved.
-
@fcwilt did you have a look at the linked thread in the first post? I don't want to make this thread a duplicate of that as I think this is a valid bug, but yes.
I am looking into reducing down time in a production syringe pump system by running two syringes. At best @dc42 has hinted parallel gcode streams is on the horizon, but at worst I change the home drive of the B axis into a number of smaller drives parsed into other G1 commands so that the idle syringe refills while the other is printing.
Not being able todo a home drive on an extruder drive does appear to necessitate the use of B drive too.
Edit: "on the horizon" would have probably been better written as "has been considered and not ruled out for a future - not imminent - release"
-
Hi Wes,
I've only glanced through this thread so might have missed something, but as I read it you have a macro that uses M584 but it's called after all the M350, M92, M566 (etc) commands and it creates a new axis (the B) axis. From the wiki we have this (quote) :
M584 must come earlier in config.g than any M350 and M906 commands. If it creates new axes, it must also be earlier than any M92, M201, M203, M208, M350, M566, M574, M667 and M669 commands.
So moving those macro calls to a position earlier in the config.g file should help.
-
@deckingman afternoon Ian. Calling M584 outside of the config file or dynamically is certinally not common and I think the comment in the gcode docs is only really concerned with the initial startup. I was concerned about that and created a macro called set_syringe_settings that set all of the commands that should be set after M584, and called it in the config file. It is in the first post.
I tried calling this in the macros that are called dynamically when a syringe hits empty but it didn't seem to help. I will double check though.
I did however do empty calls to all of the M/G codes listed in set_syringe_settings after swapping the E/B drives around using M584 and it didn't seem to effect any if the values reported.
-
@deckingman Just checked and adding :
M98 P"set_syringe_settings.g"
To the end of the trigger2.g or trigger3.g had no effect.
Also checked the effect of M84 E0 & M84 B. The M84 B had no effect, but M84 E0 did work as well as M84 on its own. Odd that a relative move on the B axis is fine after a drive re-assignment (as the home drive works) but not on the E axis.
I did try various versions of G92 after the drive swap (hence finding other bug) encase there was a home flag that needed to be forced, but that had no effect.
-
@DocTrucker said in Bug 2: RRF 3.3beta2 Axis hanging after M584 re-assignemnt:
@fcwilt did you have a look at the linked thread in the first post? I don't want to make this thread a duplicate of that as I think this is a valid bug, but yes.
Not being able todo a home drive on an extruder drive does appear to necessitate the use of B drive too.
An extruder axis doesn't seem to match up well with the limited travel of the device you are trying to control.
What is the thinking behind trying to use an extruder axis as opposed to a "normal" axis?
Thanks.
Frederick
-
@fcwilt trying to make use of all of the additional features that are available to an extrusion axis. For this application the argument for using RRF over other Linux CNC is that it is designed and a large amount of its testing is based on systems that squirt a viscous liquid. Loose those and LinuxCNC makes more sense.
Besides, this post is predominantly raising the bug that I found after following an approach suggested by @dc42. An extruder axis often has limit switches for out of, or stuck filament. It seems odd that the E axis is behaving differently to the others. My abnormal operations may just be highlighting a usually well hidden bug that can now be addressed.
-
@deckingman @fcwilt thanks for the questions though, rethinking from different angles helped me find the M84 E0 work around.
-
@DocTrucker said in Bug 2: RRF 3.3beta2 Axis hanging after M584 re-assignemnt:
@deckingman @fcwilt thanks for the questions though, rethinking from different angles helped me find the M84 E0 work around.
I was thinking that if super fast homing is not needed you could use the conditional code feature of v3 firmware to "home" an extruder axis without messing with the swapping and encountering the "bug".
Frederick
-
Is this a confirmed bug in 3.3beta2?
-
@dc42 @droftarts @Phaedrux @T3P3Tony
Is this a confirmed bug in 3.3beta2?
-
@doctrucker, not it's not a known bug. Are you able to provide a GCode file that when run, provokes the undesired behaviour, without using triggers?