Sunday 4 March 2012

Firmware

Before our brand new printer can print anything the electronics needs firmware.

There are numerous different firmwares, each with there own advantages and disadvantages. At the moment there are 2 main contenders when it comes to firmware for RAMPS; Sprinter and Marlin.

Sprinter has been out longer and is a little easier to configure and get up and running, so I'll start with Sprinter.


Step 1. Arduino Software

In order to install the firmware we need to be able to talk to the electronics.
To do this we need to use the Arduino software which can be downloaded here.

Uncompress the download and run the program.
Now the programming is running we need to make sure the settings are correct for the electronics.


The Board option needs to be set to the Arduino chip being used, for RAMPS this is Mega or Mega 2560 (2560 if you using the newer board).
The Serial Port also needs to be correct, as a rule of thumb its the last one of the list.

At this point if you want to quickly test RAMPS copy and paste the code from here into the sketch window then hit upload
All the motors should cycle (turn both directions, one after the other) and the heaters will turn on and off.


Step 2. Configuring Sprinter

Download Sprinter from here and uncompress the file.
Ignore the message in the centre,
simply click either of the links in the red box

In the Sprinter folder there is a file called Configuration.h open it using notepad or a similar program (eg notepad++).


Line 17

#define MOTHERBOARD 3

Change the number to suit your electronics, in the case of RAMPS 1.4 its 33.
#define MOTHERBOARD 33


Line 26 and 27

#define THERMISTORHEATER 1
#define THERMISTORBED 1

Change the number to suit the thermistor your using.


Line 31

float axis_steps_per_unit[] = {80, 80, 3200/1.25,700}; 

If your using 1/8 microstepping stepper drivers half all numbers. If just one of the motors is using 1/8 microstepping just half the relevant number.


Line 51

#define SDSUPPORT

If your not using a SD attachment you can comment this line out, like so
//#define SDSUPPORT


Line 74

const bool INVERT_Y_DIR = false;

If your using the standard prusa setup with the motor at the front this line needs to be changed otherwise your prints will be mirrored.
const bool INVERT_Y_DIR = true;


Save the file and now its time to upload Sprinter.

In the Arduino software, File -> Open
Select sprinter.pde

Click upload.

Congratulations you've installed Sprinter firmware on your electronics.

6 comments:

  1. In your step 2. Configuring Sprinter, where you give a link to download a Sprinter:
    https://github.com/kliment/Sprinter/downloads
    If I go there, I get a message:
    Sorry, there aren't any downloads for this repository.

    --Dmitri

    ReplyDelete
    Replies
    1. Just above where it says, "Sorry, there aren't any downloads for this repository." there are 2 buttons.
      Download as zip and Download as tar.gz
      Click the relevant file (zip is generally for Windows, tar.gz for Linux).

      I'll update the post with a image as it did confuse me a little when I came to download the files.

      Delete
  2. What a great blog, after endless hours of needlessly trying to compile sprint with Adruino with no luck, i ran into your blog and voila, I see the first movement ever from the steppers after running your test link. I'm not done yet compiling the whole thing but I had to take a moment and thank you for posting it so simply.
    The problem I had is as soon as the the fist stepper activates the power supply triggers off. I rejoice it and same thing happens. I don't have my end stops or heater connected yet. Do you have any suggestions why this would happen.

    ReplyDelete
    Replies
    1. Thank you.
      What powersupply are you using?
      It sounds like it might not have even ampage (~2amps per stepper motor).
      I've also heard some pc psu's need a load of the other rails to stay stable. An easy way to do this is to hook up a usb lamp to the psu.

      Delete
    2. I have enough amps 12, since I am not using a heated bed yet. But it is a pc power supply, so I'll try to do what you suggested untill I get the real 20 amp power supply.
      Thanks again

      Delete
    3. This comment has been removed by the author.

      Delete