m42 PWM backwards?

Tagged: , , ,

This topic contains 5 replies, has 3 voices, and was last updated by  Jeffeb3 3 weeks, 5 days ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #46482

    beetlejuice0331
    Participant

    I have a mech. relay hooked up to P4 which in turn is used to power on/off the spindle and vacuum.  My gcode to turn it on is M42 P4 S0 and M42 P4 S255 to turn it off.  It works great but the problem is that I want to use that same pin for a 2.5W laser (replace spindle/vacuum).  Problem is that Image2gcode has a power setting for min/max (0/255).  Would my current setup (S0=on/S255=off) be an issue or is there a way I can change it?

    #46536

    Ryan
    Keymaster

    S0 is off, no current, so no relay activation, S255 is full power=relay activation. That is how the laser power supply should see it as well 255 = full power, 0=off.

    Does that make sense? The relay is what is reversing the logic not the board, right?

    #46579

    beetlejuice0331
    Participant

    That’s what I’m trying to figure out.  When I power on my machine it sits idle with the motors disengaged and the spindle relay off (not active).  It’s not until I send my gcode:

    program start:

    G90
    M03 S
    M106     //fan on
    M42 P4 S0     //relay for spindle on

    program end:

    M05
    M107     //fan off
    M42 P4 S255     //relay for spindle off

     

    If the board defines S0 as off then the pin P4 would not see a signal thus the relay would not get a signal and should remain inactive.  As you can see from my gcode, when the board first executes command S0 it doesn’t shut off a signal but rather it sends a signal to the relay which activates it.  Make sense or am I missing something?

    #46580

    Jeffeb3
    Participant

    Your relay may be driven with inverted logic.

    That doesn’t mean the laser will be inverted.

    You aren’t planning on running image2gcode against your mechanical relay are you? That will destroy it.

    #46582

    beetlejuice0331
    Participant

    No I’m removing the relay to use that Ramps pin as my laser signal.    I’ll try it out… what’s the worst that could happen?

    #46585

    Jeffeb3
    Participant

    Fire. But that’s unlikely 🙂

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

You must be logged in to reply to this topic.