Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login
    1. Home
    2. awitc
    • Profile
    • Following 0
    • Followers 0
    • Topics 13
    • Posts 42
    • Best 9
    • Controversial 0
    • Groups 0

    awitc

    @awitc

    9
    Reputation
    6
    Profile views
    42
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    awitc Unfollow Follow

    Best posts made by awitc

    • Custom temperature control

      Hi!

      I am currently looking for a solution for a custom water cooler for one of the tools.

      For now, I am running a continuous macro in the daemon.g, which controls the temperature based on some GCode meta commands. It works as desired, however I can't actively change the temperature ranges in a nicely manner. I would love to implement something looking like a heater, ie. fields where the input temperature is entered, and a target temperature is shown, but instead of the heater control algorithm, my custom code runs.

      Best regards,
      AW

      posted in Duet Web Control
      awitcundefined
      awitc
    • RE: Problem with daemon.g timing

      @fcwilt The idea of the while true loop was taken from this forum itself I think, to have it check faster than every 10 seconds. According to @dc42:

      @dc42 said in daemon.g usage cases:

      @OwenD said in daemon.g usage cases:

      Does G4 pass control back to the main process when used in a loop?

      Yes.

      From this I understand that I effectively get a daemon.g running every G4 Px milliseconds at least (not taking into account the time it takes for the daemon to execute).

      The choice between M226 and M25 was made because of this description:

      Initiates a pause in the same way as if the pause button is pressed, except that execution of all prior GCode commands in the same input stream is completed first.

      On the other hand M25:
      M25 attempts to execute as quickly as possible

      Even though the GCode dictionary mentions M25 to be the command to stop a print from DWC or some other source, the M226 in my case is like an extension of Gcode. I had to come up with a conditional check during printing.

      The flow is as follows:

      Print started -> Start Gcode toggles -> Custom macro starts extruder (controlled by a different board than the Duet3), Gcode paused by M226 in start gcode -> print paused till daemon.g checks for appropriate pressure (M24) -> continuous checks for any pressure jumps.

      I imagined this as an extension of the Gcode, running along, not a definite break in the flow - like the M25.

      The cases where I use my M226/M24 weren't causing problems yet, my print pauses at start, communicates with external controller for the extruder, resolves when pressure builds up fine. During the creation of this topic, these if statements were not checked, the delays have to stem from something else.

      posted in Gcode meta commands
      awitcundefined
      awitc
    • RE: Temperature sensor triggering some macro

      Thank you for your replies @jay_s_uk and @dc42. Both suggestions seem to be valid solutions. I will firstly look more into the daemon.g file, as it is more customizable and fitting for my purpose.

      posted in General Discussion
      awitcundefined
      awitc
    • RE: Connecting a capacitive sensor, but not as a probe

      The addition of "^" helped to bring the voltages to 0.7V and 3.3V respectively. I thought the pullup on the input is enabled by default. Thanks a lot!

      I found also that testing the trigger with a M117 message makes the message show up only the first time the trigger is evoked. At least in my case.

      posted in Duet Hardware and wiring
      awitcundefined
      awitc
    • RE: Issue during accelerometer data collection

      Today I tested with a 5m long HDMI cable, and every issue went away, thanks.

      Picture resembling used cable:

      8be1bed7-0641-4eca-843d-48bf7a2710de-obraz.png

      posted in General Discussion
      awitcundefined
      awitc
    • RE: Replacing a Duet3 6XD board when in SBC mode

      @jay_s_uk Yeah, I intend to use this as an opportunity to upgrade the firmware. Thanks

      posted in Duet Hardware and wiring
      awitcundefined
      awitc
    • RE: Issue during accelerometer data collection

      @droftarts I used the red/white, blue/white, brown/white, and green/white. I didn't ground the shield.

      posted in General Discussion
      awitcundefined
      awitc
    • RE: Duet3 6XD based 3D printer freezes mid-print, then continues

      Thanks for the replies, I have ordered a new SD card, it has 200/90 MB/s speeds:
      b77c6cd3-f837-435c-aece-4cf6b9f819b3-obraz.png

      Will give an update after I get the card.

      posted in General Discussion
      awitcundefined
      awitc
    • RE: Sending data from a microcontroller to Duet3 (with SBC)

      @jay_s_uk @chrishamm Yes, I have added the command, using 115200 as baudrate, but from what I see, I had the parameter S set to be default. I will try with the raw mode, that might have been the problem. Thanks!

      posted in General Discussion
      awitcundefined
      awitc

    Latest posts made by awitc

    • RE: Problem with daemon.g timing

      @dc42

      I didn't have the macro for changing nozzle size at hand, so I copied my other one and replaced this line, so that it only demonstrates the saving. Should look like this, but it is for volume measurement parameters:

      echo "Previous val: ", global.coef
      echo "Reference volume: ", global.reference_volume
      echo "Actual volume: ", global.actual_volume
      
      echo >"/sys/coef.g" "set global.coef = "^{global.coef * global.reference_volume/global.actual_volume}^""
      
      G4 P1
      M98 P"coef.g"
      echo "Updated val: ", global.coef
      

      Here the result is calculated and stored in the coef.g file and then loaded so the printer has the updated value, too.

      posted in Gcode meta commands
      awitcundefined
      awitc
    • RE: Problem with daemon.g timing

      @infiniteloop @dc42

      This sounds like it! I will remove this macro from the daemon and figure out a different way of doing this.

      Is there a good way of saving parameters while the Duet3 is running? This is how I have done it so far:

      ; macro for updating the value
      
      echo >"/sys/coef.g" "set global.coef = {global.coef}"
      
      G4 P1
      M98 P"coef.g"
      echo "Updated val: ", global.coef
      

      This is how the logic looks like (not direct code, because I don't have access to the printer right now), I have a variable in config.g, then the file coef.g contains an overwrite,
      which is using a new value. In config, the macro is run at every start-up to load the new value from SD card. The global.coef can be overwritten during printer operation by other macros etc.

      Looking at this code, I am feeling quite silly that I completely missed having a G4 P1 executing at EVERY loop iteration. I have focused on the code I added (the feeder checks) and that is when I noticed delays. The SD card saving macro I added couple of weeks ago, but didn't test it thoroughly (my oversight). Thanks a lot!

      TLDR: avoid M98 in daemon.g, especially when it introduces another G4 delay.

      edit:

      @infiniteloop said in Problem with daemon.g timing:

      As a self-assigned expert for infinite loops

      took me a while 🙂

      posted in Gcode meta commands
      awitcundefined
      awitc
    • RE: Problem with daemon.g timing

      @fcwilt The idea of the while true loop was taken from this forum itself I think, to have it check faster than every 10 seconds. According to @dc42:

      @dc42 said in daemon.g usage cases:

      @OwenD said in daemon.g usage cases:

      Does G4 pass control back to the main process when used in a loop?

      Yes.

      From this I understand that I effectively get a daemon.g running every G4 Px milliseconds at least (not taking into account the time it takes for the daemon to execute).

      The choice between M226 and M25 was made because of this description:

      Initiates a pause in the same way as if the pause button is pressed, except that execution of all prior GCode commands in the same input stream is completed first.

      On the other hand M25:
      M25 attempts to execute as quickly as possible

      Even though the GCode dictionary mentions M25 to be the command to stop a print from DWC or some other source, the M226 in my case is like an extension of Gcode. I had to come up with a conditional check during printing.

      The flow is as follows:

      Print started -> Start Gcode toggles -> Custom macro starts extruder (controlled by a different board than the Duet3), Gcode paused by M226 in start gcode -> print paused till daemon.g checks for appropriate pressure (M24) -> continuous checks for any pressure jumps.

      I imagined this as an extension of the Gcode, running along, not a definite break in the flow - like the M25.

      The cases where I use my M226/M24 weren't causing problems yet, my print pauses at start, communicates with external controller for the extruder, resolves when pressure builds up fine. During the creation of this topic, these if statements were not checked, the delays have to stem from something else.

      posted in Gcode meta commands
      awitcundefined
      awitc
    • RE: Problem with daemon.g timing

      @fcwilt The M226 is maybe not the best, but it is needed for when I am stopping the print due to problems with a custom extruder (temps, pressure errors) or pausing it from gcode to wait for initial pressure to raise. In this post I was focused on the while true and G4 Px duo, where I want an infinite loop that checks several things ever x milliseconds. That is also why the loop doesn't ever exit. Also I remember to have read somewhere that without it the daemon.g executes slower, like every several seconds or so.

      posted in Gcode meta commands
      awitcundefined
      awitc
    • Problem with daemon.g timing

      Hi,

      My daemon.g looks like this:

      var pump_started = false
      
      var fans_started = false
      var fans_time_elapsed = 0 ; [s]
      var fans_time_disable = 30
      
      var feeder_time_elapsed = 0 ; [s]
      var feeder_time_disable = 8
      
      var dt = 500 ; loop delay time [ms]
      
      
      
      while true
      
      	; monitor current pressure
      	if {global.nozzle_pressure > global.nozzle_pressure_threshold}
      		M98 P"/macros/disable_extruder.g" ; stop extruder
      		M226 ; stop print
      		M118 S"Error: Nozzle pressure is too high!"; error message
      	
      	if {global.pump_pressure > (global.target_pressure + global.pressure_difference_threshold)}
      		; if state.status == "processing"
      		M98 P"/macros/disable_extruder.g" ; stop extruder
      		M226 ; stop print
      		M118 S"Error: Pump pressure not within correct limits!"; error message
      		
      	elif {abs(global.target_pressure - global.pump_pressure) < global.pressure_difference_threshold}	; if pressure is at the expected levels, resume print
      		if state.status == "paused"
      			M24 ; resume print job
      	
      	
      	; monitor temperature
      	if sensors.analog[9].lastReading  > global.pump_trigger_temp && var.pump_started == false
      		set var.pump_started = true
      		set var.fans_started = true
      		set var.fans_timer_reset = true
      		
      		M42 P1 S1		; enable pump		
      		M106 P3 S255	; enable fans
      		
      	if sensors.analog[9].lastReading  < global.pump_trigger_temp && var.pump_started == true
      		set var.pump_started = false
      		set var.fans_started = false
      		
      		M42 P1 S0 		; disable pump immediately
      		
      	if var.fans_started == true
      		set var.fans_time_elapsed = var.fans_time_elapsed + {var.dt} / 1000 ; [s]
      
      		if var.fans_time_elapsed >= var.fans_time_disable
      			set var.fans_time_elapsed = 0
      			M106 P3 S0 		; disable fans
      			set var.fans_started = false
      	
      	; monitor pellet feeder
      	if global.feeder_started == true
      		set var.feeder_time_elapsed = var.feeder_time_elapsed + {var.dt} / 1000 ; [s]
      
      	  	if var.feeder_time_elapsed >= var.feeder_time_disable
      			set var.feeder_time_elapsed = 0
      			set global.feeder_started = false
      			M42 P5 S0		; disable feeder		
      			M118 S"Pellet feeder disabled"
      	
      	
      	G4 P{var.dt} ; loop delay, 500ms, P = [ms], S = [s]
      
      	; if nozzle_size changed, save the new value and update volume
      	M98 P"/macros/update_nozzle_size.g"
      	set global.reference_volume = global.volume_coefficient * global.nozzle_size
      	
      

      At first it was working fine, but I have added more and more stuff to it. The last change was the addition of the feeder code. It should trigger every 8 seconds or so, but as of now it is more like 30 seconds. Is there anything very wrong in my code?

      The macros I use in the code are also like 1-3 lines of code, containing M42 and echo commands.

      posted in Gcode meta commands
      awitcundefined
      awitc
    • RE: Replacing a Duet3 6XD board when in SBC mode

      @jay_s_uk Yeah, I intend to use this as an opportunity to upgrade the firmware. Thanks

      posted in Duet Hardware and wiring
      awitcundefined
      awitc
    • Replacing a Duet3 6XD board when in SBC mode

      Hi,

      Due to some fan wiring touching the build plate in an unfortunate accident one of the transistors got fried. I have spare Duet3 6XD boards and run the SBC setup. Since all the data is on the Raspberry Pi, can I just rewire everything to a new board? Is there something I overlook?

      Thanks,
      AW

      posted in Duet Hardware and wiring
      awitcundefined
      awitc
    • RE: Sending data from a microcontroller to Duet3 (with SBC)

      EDIT: took me way too long, no idea what was missing, just started working as it should, thanks

      posted in General Discussion
      awitcundefined
      awitc
    • RE: Sending data from a microcontroller to Duet3 (with SBC)

      @jay_s_uk @chrishamm Yes, I have added the command, using 115200 as baudrate, but from what I see, I had the parameter S set to be default. I will try with the raw mode, that might have been the problem. Thanks!

      posted in General Discussion
      awitcundefined
      awitc
    • RE: Sending data from a microcontroller to Duet3 (with SBC)

      @jay_s_uk for now I have a STM32F411RE, will switch up to STM32F491RE in the following days. So it has Arm Cortex-M4. The STM is used to run a custom PID controller, which manipulates the speed of the extruder stepper motor, based on pressure.

      EDIT: not extruder motor, but a drive which provides material to be extruded. I want to have the pressure in the extruder at a certain level.

      posted in General Discussion
      awitcundefined
      awitc