Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login
    1. Home
    2. machinemark
    • Profile
    • Following 0
    • Followers 0
    • Topics 6
    • Posts 28
    • Best 4
    • Controversial 0
    • Groups 0

    machinemark

    @machinemark

    4
    Reputation
    3
    Profile views
    28
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    machinemark Unfollow Follow

    Best posts made by machinemark

    • Duet 6XD RRF3 Create a Input and Check its Status

      I have been trying to create an input on io6 using

      M950 J1 C"io6 . in" in the config.g file

      Then tried to check the status from the console with;

      M950 J1

      But always get - Pin io6 . in, active, true

      I tried changing the state of the input by tying the pin to GND and 3.3V but the message never changes. Also tried to check the status of the input using
      M409 K"inputs" but the output is not clear which input I should be looking at on the list.

      I also tried writing a simple macro

      if sensors.gpIn[6].value != 0
      M117 "Output should be on"
      else
      M117 "Output should be off"

      Not sure is the pin naming in the macro is correct so cannot trust the output of this macro.
      In any case there is no change in message from the macro even though there was a change of input.

      Any help would be appreciated,

      Thanks Mark

      posted in General Discussion
      machinemarkundefined
      machinemark
    • RE: WHILE loop acts like an IF statement

      Hello zuoyan,

      Thanks for message, you are spot about macro "blocking". There is a little more to the story. The input is fed from an output (I did this for testing as I am connected to the Duet remotely). So I would run the macro that runs the WHILE loop and as it is counting up I would run another macro to change the state of an output that is connected to the input (sensors.gpIn[2]) that we are testing. Once I got somebody to switch the input with a simple button, all worked as expected.

      Thank you for all your help.

      posted in Gcode meta commands
      machinemarkundefined
      machinemark
    • RE: Custom M104 macro or Edit Existing M104 macro

      Hi Tony,

      Thanks for your reply. I was thinking on similar lines but incremental ie in the slicer set start g code to run M180
      Then the Duet runs M180 which turns on the output, runs a while loop waiting for an input to change ie Heaters change voltage of an input on the duet board or powers one of the opto isolated inputs once they are up to temperature. Then the while loop is broken and can continue, Assume
      T0 M568 S200
      T1 M568 S220
      T2 M568 S240
      T3 M568 S250

      This of coarse is simplified, there would be a few safety interlocks and checks.

      In your example M1040, M568, M1060 run in parallel? The question would be bringing on outputs and checking inputs. I still having issues with both. I seem to have had success declaring outputs and inputs in the config.g file but only had success turning on the heater outputs from a macro. No luck turning on GPIO outputs or checking GPIO inputs. Any ideas or examples?

      Thanks Mark

      posted in Duet Hardware and wiring
      machinemarkundefined
      machinemark
    • RE: Is it possible to RESET the Duet over the network ?

      Hello droftarts,

      I RTFM of both links and had a guess and used;

      http://192.168.1.14/rr_gcode?gcode=M999

      WOW! That worked.

      Back to playing with the Duet.

      Thanks again for your help.

      posted in General Discussion
      machinemarkundefined
      machinemark

    Latest posts made by machinemark

    • RE: Is it possible to RESET the Duet over the network ?

      No I did not, just worked

      posted in General Discussion
      machinemarkundefined
      machinemark
    • RE: Is it possible to RESET the Duet over the network ?

      Hello droftarts,

      I RTFM of both links and had a guess and used;

      http://192.168.1.14/rr_gcode?gcode=M999

      WOW! That worked.

      Back to playing with the Duet.

      Thanks again for your help.

      posted in General Discussion
      machinemarkundefined
      machinemark
    • RE: Is it possible to RESET the Duet over the network ?

      I tried the common keys (ENTER, ESC, DEL, SPACE, BACKSPACE etc ) to acknowledge the M291 message but no luck. I was hoping to hover the cursor over the ESTOP, use a shortcut to acknowledge the M291 message and then press the ESTOP before (very little time) the message comes up again. Regret not putting a pause 😞 in the macro.

      posted in General Discussion
      machinemarkundefined
      machinemark
    • RE: Is it possible to RESET the Duet over the network ?

      Hello droftarts,

      I cannot run anything from the console unless there is a way to append M999 in the browsers address bar. I am remotely logged in and the Duet has a static IP address 192.168.1.14 in the address bar. Is there some sort of HTML method to POST ??

      posted in General Discussion
      machinemarkundefined
      machinemark
    • RE: Is it possible to RESET the Duet over the network ?

      There is no one to do a hard reset. Or is there a key board short cut to acknowledge the OK on the M291 message and or a keyboard short cut for ESTOP.? Maybe if I can quickly apply the two to get out of the loop.

      Thanks again.

      posted in General Discussion
      machinemarkundefined
      machinemark
    • Is it possible to RESET the Duet over the network ?

      I am remotely logged into a laptop that has a Duet 6XD hanging off it.

      I wrote a macro that is in a never ending loop that brings up a message using M291. I hit ok but then the message displays again and there is not enough time to hit the Estop between messages.

      Is there a way to send a command to reboot the board from my browser in a remote location?

      Thanks Mark

      posted in General Discussion
      machinemarkundefined
      machinemark
    • RE: WHILE loop acts like an IF statement

      Hello zuoyan,

      Thanks for message, you are spot about macro "blocking". There is a little more to the story. The input is fed from an output (I did this for testing as I am connected to the Duet remotely). So I would run the macro that runs the WHILE loop and as it is counting up I would run another macro to change the state of an output that is connected to the input (sensors.gpIn[2]) that we are testing. Once I got somebody to switch the input with a simple button, all worked as expected.

      Thank you for all your help.

      posted in Gcode meta commands
      machinemarkundefined
      machinemark
    • RE: WHILE loop acts like an IF statement

      Hi mikeabuilder,

      That's a top idea. Also modified the echo state during the WHILE loop;

      var timeOut = 8 ; Set time out in seconds
      var tooLong = 0 ; Reset 
      var count = 1 ; Counter reset to 1
      var trippedInput = 0 ; Reset
      
      echo "State of input before the WHILE loop is " , sensors.gpIn[2].value
      G4 P2000 ; Pause for 2 seconds to see the input state
      
      while sensors.gpIn[2].value == 0 
      	echo var.count , "Seconds. Input state - " , sensors.gpIn[2].value
      	G4 P1000 ; Pause for 1 second
      	set var.count = var.count + 1
      	if var.count > var.timeOut
      		set var.tooLong = 1
      		break
      
      echo "State of input after the WHILE loop is " , sensors.gpIn[2].value
      
      if var.tooLong == 1
      	M291 P"Time Out" S2
      else
      	M291 P"Input Tripped" S2
      

      I notice that the input state only shows '1' if the input is high before starting the macro. If I switch the input high during the WHILE loop, the input state remains at '0' even after the while loop. Unexpected behavior. May need to restructure using IF statement but can not see a way to BRANCH to loop like using a GOTO statement.

      Thanks again for the idea, showed something is not right.

      posted in Gcode meta commands
      machinemarkundefined
      machinemark
    • RE: WHILE loop acts like an IF statement

      Thanks dc42, I see you have been busy in the forums.

      echo boards[0].firmwareVersion
      

      Returns 3.5.1

      As far as I know, the Duet is in Standalone mode ie we do NOT have an SBC like a RPI or other hanging off the Duet.

      Thanks Mark

      posted in Gcode meta commands
      machinemarkundefined
      machinemark
    • WHILE loop acts like an IF statement

      I have been trying to create a while loop that either breaks out after some time or when an input becomes high.

      The following code sort of works,

      If the input is high before running, the code goes through the while loop and displays the 'Input Tripped' message as expected.

      If the input remains low the iterations/count are reached and breaks out of the while loop displaying the 'Time Out' message as expected.

      However if the input goes from low to high during the WHILE loop it does not 'break' out and 'Times out'

      It is almost as if the WHILE acts as an IF

      I have tried several variations, like 'while true' , using the iterations variable etc but never had any luck achieving an expected result.

      var timeOut = 8 ; Set time out in seconds
      var tooLong = 0 ; Reset 
      var count = 1 ; Counter reset to 1
      var trippedInput = 0 ; Reset
      
      echo "State of input is " , sensors.gpIn[2].value
      G4 P2000 ; Pause for 2 seconds to see the input state
      
      while sensors.gpIn[2].value == 0 
      	echo "Seconds " , var.count 
      	G4 P1000 ; Pause for 1 second
      	set var.count = var.count + 1
      	if var.count > var.timeOut
      		set var.tooLong = 1
      		break
      
      if var.tooLong == 1
      	M291 P"Time Out" S2
      else
      	M291 P"Input Tripped" S2
      

      I have had a look at other examples and spent several hours, on what I thought should be a simple execution of a WHILE loop but ............

      My next idea is to try and structure the code not using any WHILE statement and using only IF statements. Getting clunkier as we go along.

      Any ideas would be great.

      Thanks Mark

      posted in Gcode meta commands
      machinemarkundefined
      machinemark