Jump to content

enable output pin when print finished and get an email.


dubtec

Recommended Posts

Posted · enable output pin when print finished and get an email.

I want to enable an output pin, when print has finished.. I have tried to use the second heater o/p. but cant get this to work.

M42 P4 S255;

G4 P5;

M42 P4 S0;

Do i need to do something in the firmware for this to work? I heater 2 enabled by default?

If i want to use another available pin, do I need to "define"it, if so where.

-----------------------------

Basically once I can get an o/p to do something when finished,, I'm going to link it to an arduino with ethernet sheild... using this I can get an email, when print has finished using "pushing box"... I'm using 10 printers, and this would be an awesome feature.

----------------------------

I would really appreciate some help with this,

David

 

  • Link to post
    Share on other sites

    Posted · enable output pin when print finished and get an email.

    Someone wanted to do a layer-by-layer timelapse using a similar command. Someone else suggested the m42 command in the layer comment.

    You can probably leverage the same solution for your use. However, it requires you to tap into the board expansion points and I think you will need to solder a header on to do so.

    https://groups.google.com/forum/#!msg/ultimaker/vZok0JVD430/jVH5kOwj620J

    Daid

    4/12/12

    Actually, you don't need to touch Arduino code. You can change pins with the M42 code. Combine this with G4 (delay) and you can code your camera trigger in pure GCode.

    For example:

    M42 P23 S255 ; Set the trigger camera pin high

    G4 P100 ; Wait 100ms

    M42 P23 S0 ; Set the trigger camera pin low

    Gijs

    Nice!

    do you also know how that corresponds to the 1.5.4 ultimaker pcb? because from the wiki it's not clear to me where I would connect the opto-coupler,

    cheers,

    Daid

    The pin numbers correspond to the numbers shown here:

    http://www.reprap.org/wiki/Ultimaker%27s_v1.5.4_PCB#Pinout_of_Extension_connectors

    I recommend you use one of the PWM or ANALOGUE pins, because the EXP1 and EXP2 are used by the Ultipanel later on, if you get one.

    (The analogue pins can also be used as digital outputs, something you might not guess from the name)

    Gijs

    OK, suppose I would use PWM 8 and 9, what would then be the corresponding M42 pin assignment? just P8 and P9?

    Daid

    Yes, P8 and P9 would do the trick then. Small note about the PWM outputs, those can be PWM driven, not sure if the Arduino will do that or not, just be sure to use S0 and S255, no values in between to enable/disable the output.

     

  • Link to post
    Share on other sites

    Posted · enable output pin when print finished and get an email.

    It may be worth pointing out that Marlin defines some pins as sensitive and won't allow you to change their value with M42. The default list of sensitive pins is something like this:

    0, 1,

    X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN,

    Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN,

    Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN,

    PS_ON_PIN, HEATER_BED_PIN, FAN_PIN,

    E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN, HEATER_0_PIN,

    analogInputToDigitalPin( TEMP_0_PIN),

    analogInputToDigitalPin( TEMP_1_PIN),

    analogInputToDigitalPin( TEMP2_PIN),

    analogInputToDigitalPin( TEMP_BED_PIN),

    (E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, HEATER_1_PIN; if dual extrusion enabled )

    which for me translates to

    0, 1,

    25, 23, 27, 22, 24,

    31, 33, 29, 26, 28,

    37, 39, 35, 30, 32,

    12, 4, 7,

    43, 45, 41, 2,

    ((8 < 16) ? (8) + 54 : -1), ((9 < 16) ? (9) + 54 : -1), ((-1 < 16) ? (-1) + 54 : -1), ((10 < 16) ? (10) + 54 : -1)

    (49, 47, 48, 3, if dual extrusion enabled)

    The reason your code wont work is P4 is by default the HEATER_BED_PIN which is sensitive.

    /Johan

    @Daid: TEMP2_PIN defined to -1 doesn't play well with analogInputToDigitalPin(). Pin 53 is protected unintentionally. Perhaps use,

    #define alt_analogInputToDigitalPin(p) ( ((p) < 16) ? ( ((p) >= 0 ) ? (p) + 54 : -1 ) : -1 )

     

  • Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    • Our picks

      • UltiMaker Cura 5.8 Stable released 🎉
        In the Cura 5.8 stable release, everyone can now tune their Z seams to look better than ever. Method series users get access to new material profiles, and the base Method model now has a printer profile, meaning the whole Method series is now supported in Cura!
        • 5 replies
      • Introducing the UltiMaker Factor 4
        We are happy to announce the next evolution in the UltiMaker 3D printer lineup: the UltiMaker Factor 4 industrial-grade 3D printer, designed to take manufacturing to new levels of efficiency and reliability. Factor 4 is an end-to-end 3D printing solution for light industrial applications
          • Thanks
          • Like
        • 3 replies
    ×
    ×
    • Create New...