LASER upgrade pin alteration troubles

New Home Forum Mostly Printed CNC – MPCNC Troubleshooting – MPCNC LASER upgrade pin alteration troubles

Tagged: 

This topic contains 7 replies, has 4 voices, and was last updated by  Jason Dentler 1 year ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #71586

    creecher
    Participant

    if this is too awful to read due to the text blocks please let me know and i can throw them into paste bins.

     

    So, as it says in step 1 of section B here, https://www.v1engineering.com/wp-content/uploads/2016/01/MPCNC-laser-add-on-walk-through-Rev2.0.pdf

     

    youre supposed to change the pin from d9 to pin 44. the pins_RAMPS_13.h file that the guide originally calls for no longer has any pinouts, so i went to where it was calling for the pins,  pins_ramps.h and i changed the designated pin for the fan from

    // Heaters / Fans
    //
    #ifndef MOSFET_D_PIN
    #define MOSFET_D_PIN -1
    #endif
    #ifndef RAMPS_D8_PIN
    #define RAMPS_D8_PIN 8
    #endif
    #ifndef RAMPS_D9_PIN
    #define RAMPS_D9_PIN 9
    #endif
    #ifndef RAMPS_D10_PIN
    #define RAMPS_D10_PIN 10
    #endif

    replacing the 9 to a 44

     

    this didn’t work when i tested it.

    when i went back to look and further explore the file, i found

    // M3/M4/M5 – Spindle/Laser Control
    //
    #if ENABLED(SPINDLE_LASER_ENABLE) && !PIN_EXISTS(SPINDLE_LASER_ENABLE)
    #if !defined(NUM_SERVOS) || NUM_SERVOS == 0 // try to use servo connector first
    #define SPINDLE_LASER_ENABLE_PIN 4 // Pin should have a pullup/pulldown!
    #define SPINDLE_LASER_PWM_PIN 6 // MUST BE HARDWARE PWM
    #define SPINDLE_DIR_PIN 5
    #elif !(ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL) \
    && (ENABLED(PANEL_ONE) || ENABLED(VIKI2) || ENABLED(miniVIKI) || ENABLED(MINIPANEL) || ENABLED(REPRAPWORLD_KEYPAD))) // try to use AUX 2
    #define SPINDLE_LASER_ENABLE_PIN 40 // Pin should have a pullup/pulldown!
    #define SPINDLE_LASER_PWM_PIN 44 // MUST BE HARDWARE PWM
    #define SPINDLE_DIR_PIN 65
    #endif
    #endif

    do i no longer need to fuck with the pinout lists? seems like it is controlled here but i cant figure out exactly what its doing, and more importantly, which pins to use.

    i looked in config.adv of the current marlin dualendstop firmware that ryan gives us, and i find

    /**
    * Spindle & Laser control
    *
    * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and
    * to set spindle speed, spindle direction, and laser power.
    *
    * SuperPid is a router/spindle speed controller used in the CNC milling community.
    * Marlin can be used to turn the spindle on and off. It can also be used to set
    * the spindle speed from 5,000 to 30,000 RPM.
    *
    * You’ll need to select a pin for the ON/OFF function and optionally choose a 0-5V
    * hardware PWM pin for the speed control and a pin for the rotation direction.
    *
    * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details.
    */
    //#define SPINDLE_LASER_ENABLE
    #if ENABLED(SPINDLE_LASER_ENABLE)

    #define SPINDLE_LASER_ENABLE_INVERT false // set to “true” if the on/off function is reversed
    #define SPINDLE_LASER_PWM true // set to true if your controller supports setting the speed/power
    #define SPINDLE_LASER_PWM_INVERT true // set to “true” if the speed/power goes up when you want it to go slower
    #define SPINDLE_LASER_POWERUP_DELAY 5000 // delay in milliseconds to allow the spindle/laser to come up to speed/power
    #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // delay in milliseconds to allow the spindle to stop
    #define SPINDLE_DIR_CHANGE true // set to true if your spindle controller supports changing spindle direction
    #define SPINDLE_INVERT_DIR false
    #define SPINDLE_STOP_ON_DIR_CHANGE true // set to true if Marlin should stop the spindle before changing rotation direction

    /**

    anyone have any luck?

    #71588

    creecher
    Participant

    ok, i read through http://marlinfw.org/docs/configuration/laser_spindle.html and may be able to figure this out. it looks like its preset to pins 4 and 6. now i just need to find pins 4 and 6?

     

    edit: ok maybe not.

    #71590

    Bryan
    Participant

    If you map D9 to 44 you need to use M106 and M107 to activate the laser.

    #71591

    creecher
    Participant

    i tried that but it did nothing 🙁

    i dont believe its that simple to change the pinout anymore

    #71597

    creecher
    Participant

    i got it! will post more in the morning. its 230 am and i have a presentation tomorrow 🙂

     

    ended up being a game of “find the pins that are working”

     

    #71608

    Bryan
    Participant

    Great. For reference this is from my configuration file.

    #define SPINDLE_LASER_ENABLE
    #if ENABLED(SPINDLE_LASER_ENABLE)

    #define SPINDLE_LASER_ENABLE_INVERT false // set to “true” if the on/off function is reversed
    #define SPINDLE_LASER_PWM true // set to true if your controller supports setting the speed/power
    #define SPINDLE_LASER_PWM_INVERT true // set to “true” if the speed/power goes up when you want it to go slower
    #define SPINDLE_LASER_POWERUP_DELAY 5000 // delay in milliseconds to allow the spindle/laser to come up to speed/power
    #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // delay in milliseconds to allow the spindle to stop
    #define SPINDLE_DIR_CHANGE true // set to true if your spindle controller supports changing spindle direction
    #define SPINDLE_INVERT_DIR false
    #define SPINDLE_STOP_ON_DIR_CHANGE true // set to true if Marlin should stop the spindle before changing rotation direction

    /**
    * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power
    *
    * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT
    * where PWM duty cycle varies from 0 to 255
    *
    * set the following for your controller (ALL MUST BE SET)
    */

    #define SPEED_POWER_SLOPE 0.3922
    #define SPEED_POWER_INTERCEPT 0
    #define SPEED_POWER_MIN 10
    #define SPEED_POWER_MAX 100 //

    Use M106 SXXX set XXX at 0 to 255.

    Double check the wiring feeding the signal to the TTL board. The +/- on the TTl board was backwards.

    #71630

    Ryan
    Keymaster

    The PDF for the pinout change is for using the fan Gcode to control the laser on a 5v pin instead of 12v. Marlin now lets you make this change easier but using a different gcode command.

    #71635

    Jason Dentler
    Participant

    The PDF for the pinout change is for using the fan Gcode to control the laser on a 5v pin instead of 12v. Marlin now lets you make this change easier but using a different gcode command.

    This may solve my problem!

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.