Saturday, June 3, 2017

Modifying firmware for the fan.

I have modified two files in Vertex-Nano-Firmware-master for controlling the cooling fan with standard M106 G-code.

File 1: Marlin-main.cpp
Find the function "set_led_brightness"
// Set led brightness according to current variable
void set_led_brightness()
{
   analogWrite(7, map(vertexLedBrightness, 0, 100, 0, 255));
}

and then just put a comment before the AnalogWrite statement:

void set_led_brightness()
{
// analogWrite(7, map(vertexLedBrightness, 0, 100, 0, 255));
}

File 2: pins_K8600.h

Change
#define FAN_PIN 8

to
#define FAN_PIN 7

And then compile  and upload to board. I used Arduino IDE ver 1.8.1

The LED can be connected to the 12V pin located near the connector for the internal fan.

Have fun
Niels



1 comment:

  1. To program using arduino :

    1st : make a backup of settings
    - using putty (speed 250000) type M501 (you will not see what you type but it will work. It will show you a LOT of settings, save all to a Notepad)

    Board : arduino mega 2560
    Processor : 2560
    Port : select the right COM port

    On the mainboard, plug the JPROG switch on both pin

    Power on the printer

    On arduino, press program button. (you could see the led flashing while programming)


    Once programmed:
    - remove JPROG PIN
    - previously settings must be restored
    -- type every Mxxx command in putty to set values
    -- once everything is inserted, type M500 (it saves settings)
    -- power off, remove usb, and power on. it should work (in my case, it did..)

    ReplyDelete