1. Got a question or need help troubleshooting? Post to the troubleshooting forum or Search the forums!

Regain Control of Existing Case Lights

Discussion in 'Mods and Upgrades' started by WheresWaldo, Dec 12, 2017.

  1. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    Warning: This is not a beginner mod as it requires board component removal as well as firmware modifications.

    Description: When the R2 was created Robo went with a custom designed Mainboard (version 2.1.5, RAMPS compatible) with support for a few user convenience items. One of those items is case lighting that is attached to the FAN2 header. Even though FAN2 is connected to a hardware PWM digital pin on the Arduino MEGA 2560 (pin D5) and the circuitry is there to allow PWM control, Robo decided not to enable that feature.

    The newest revision of the Mainboard (version 2.1.8, currently still under development) re-enables the case lighting feature. The development version of Robo Marlin also enabled G-Code control of the lighting. The purpose of this modification is to allow the same control for all us early R2 users.
     
  2. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    Warning: This is not a beginner mod as it requires board component removal as well as firmware modifications.

    Hardware:
    In order to regain control the shunt resistor R47 must either be cut or removed from the board. Both procedures are destructive and will void your warranty. Proceed with caution and at your own risk.

    No other hardware modification is necessary.

    WIN_20171212_09_10_34_Pro.png
     
    #2 WheresWaldo, Dec 12, 2017
    Last edited: Jan 20, 2018
  3. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    Warning: This is not a beginner mod as it requires board component removal as well as firmware modifications.

    Firmware: Please note that the examples presented here will use the current Robo firmware as a source. If you are using other firmware the modifications may not appear in exactly the same places.

    Update: Version 1.2.1 of RoboMarlin has been posted on their GITHUB for both the R2 / C2. This version of the firmware already has the modifications needed to control the lights. On Mainboard 2.1.5 (current) you will need to remove component R47 (location shown above) in order to make it work. On the next Mainboard revision 2.1.8 the component is not preinstalled, so no modification is necessary.
     
    #3 WheresWaldo, Dec 12, 2017
    Last edited: Dec 14, 2017
  4. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    Warning: This is not a beginner mod as it requires board component removal as well as firmware modifications.

    There are a couple of ways to control the lighting using G-code commands. There is currently no functionality in the RoBoLCD add-on nor in OctoPrint to control the lighting.

    Turn lights on for printing and off after it is done:

    In your startup G-code you need to add the code M355 S1. That code will turn on the lights at exactly the same level they were at when turned off. If you want to control the brightness also just add the P parameter with a value between 0 - 255 inclusive. A value of 0 would turn the lights off a value of 255 would turn them on at maximum brightness. Please note that the scale is far from linear and a P value of 128 would not suggest half brightness. It might but there is no guarantee. For example, to turn the lights on with reduced brightness your G-code might look like M355 S1 P64.

    Normally to turn the lights off you would issue a M355 S0, but because of a bug in the current version of Marlin nothing really happens so instead you have to turn the brightness down to 0 in order to turn the lights off, M355 S1 P0. Marlin version 1.1.7 (coming soon) has been fixed to that the off command works.

    Adding functionality to OctoPrint to control lighting:

    If you ssh into your printer's IP address, you have direct access to the RaspberryPi located within the printer. The rPi is where the LCD interface and OctoPrint runs. A simple addition to the configuration file for OctoPrint can add a slider and on and off buttons for the case lights.

    If you want to control this from the Robo Web interface you can do so by adding a section to /home/pi/.octoprint/config.yaml. The following section needs to be added:
    Code:
    controls:
      - name: Case Lighting
        layout: horizontal
        children:
        - name: Light On
          command: M355 S1 P%(brightness)s
          input:
          - name: Brightness (0 - 255)
            parameter: brightness
            default: 105
            slider:
              min: 0
              max: 255
        - name: Light Off
          command: M355 S1 P0
    
    The lighting buttons and slider will appear in the Control section of the web interface.
     
    #4 WheresWaldo, Dec 12, 2017
    Last edited: Dec 14, 2017
  5. RSC

    RSC New Member

    Joined:
    Nov 25, 2017
    Messages:
    20
    Likes Received:
    6
    I hate the case lights, they're not very bright and they're below the print bed when the print starts, so they're not very effective particularly for shorter prints. I want to replace them. Strips along the inside of the top side frame members. I was just going to wire them up direct, but I like the idea of g-code control of the lights.

    I don't suppose you know how much current the FAN2 driver can sink (I'm assuming it's open collector. If that's wrong, then "source" instead)? Or give me a hint as to where I could find that info?
     

Share This Page