Thursday, April 7, 2011

Updating Gen6 Electronics Firmware

This post focuses on how to update the firmware on the Gen6 Mendel electronics.

Install Arduino Tool-Chain:

First you'll need the correct tool chain to be able to compile, link and download the firmware to the Gen6 board. Download and install the Arduino tools from here: Arduino Tools

You'll also need to install the Sanguino add-on from here: Sanguino Tools

Get the Latest Gen6 Firmware:

The latest firmware currently resides here: Gen6 FW

The firmware includes all the source code, so you can make any changes or modifications required. My specific changes are listed below.

Compile the FW Project in the Arduino Tool-Chain:

Run the Arduino tools and 'Open' the project by navigating to the latest firmware directory and opening the file 'FiveD_GCode_Interpreter.pde'.

Once you've made any changes you need, press CTRL+R to compile and verify the code. If you get any compilation errors, fix them now.

Upload the Build to the Hardware:

Once you get a clean build you can upload the code to the board. Power up the Gen6 board and connect the USB. I would also suggest that you open RepSnapper and connect to the printer and just jog the bed before attempting an upgrade, otherwise you'll get a communication failure error from the Arduino tools.

Verify that under the 'Tools->Board' menu you have 'Sanguino' selected. Also under the 'Tools->Serial Port' make sure that you have the correct COM port selected.

Now you can press the 'Upload' button (Right pointing arrow on the tool bar), this will compile the code and then attempt to upload the code to the Gen6 board.

If you get the following error from the Arduino tools: 

Problem uploading to board. See http...
Binary sketch size: 23982 bytes (of a 63488 bytes maximum)
avrdude: stk500_getsync(): not in syinc: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

Try opening RepSnapper and jogging the bed again before shutting the RepSnapper tools (don't turn the printer off), then try the upload again. 

Once the upload completes you can close the tools and power cycle the hardware.

My Specific Changes:

As I mentioned previously, I have different drive pulleys on my stepper motors. This required that I recalibrate my steps/mm calculation in the firmware.

In 'configuration.h' under the section #ifdef Mendel (around line 163 in FW from Jan-2011) at the end of the pulley descriptions I added this section:

  // define XYZ parameter of McMaster 10-tooth XL-series pulleys
  // Added by JMB - 29-Oct-2010

    #define X_STEPS_PER_MM   31.484 //31.641   
    #define INVERT_X_DIR 1
    #define Y_STEPS_PER_MM   31.599 //31.394
    #define INVERT_Y_DIR 1
    #define Z_STEPS_PER_MM   2689.682
    #define INVERT_Z_DIR 0

I also added the following line (around line 82) where the configuration is determining which pulleys are being used:


The board should now be configured and programmed with the latest version of firmware, Happy Printing!

No comments:

Post a Comment