PrusaFirmwareBraino

From RepRap
Revision as of 11:05, 17 January 2015 by Prof braino (talk | contribs) (run Arduino IDE?)
Jump to: navigation, search

PRUSA FIRMWARE

When I built my Prusa in 2011, I used Sanguino electronics, and Sprinter firmware. PC ran Windows operations system.

Now (2015), I need to modify the firmware. PC is running Linux (Mint 17, similar to Ubuntu).

When I get done here, I will go back and continue the calibration page http://reprap.org/wiki/PrusaCalibrationNotesBraino

I'm starting with the Sanguinololu page.

http://reprap.org/wiki/Sanguinololu

sprinter is broken for sanguino / sanguinololu

The firmware will not compile in the arduino IDE, and therefore will not generate any firmware image for my machine.

It seems the names sanguino was changed to sanguinololu at some point.

Note: Sanguino is an early Arduino board derivative and as it featured an ATmega644P, it required changed Arduino libraries, the Sanguino add-on. Sanguinololu is one of the successors of Generation 3 Electronics and uses the very same chip (or an 1284P), so it used the Sanguino add-on as well. Sanguino board is long gone, but the library still works with Arduino IDE before v1.0 (v0023? v0028?). That said, Gen7 Arduino IDE Support comes with a likewise changed, but updated Arduino library and should get Sprinter to compile on recent Arduino IDEs. In case you happen to actually want that, because Teacup Firmware is smaller as well as faster and features about everything Sprinter does (and a bit more). --Traumflug (talk) 13:18, 16 January 2015 (PST)

I find that all the references to the Sanguino support now point to a binoculars manufacturer in Australia.

Specifically in https://github.com/kliment/Sprinter

the readme instructions specify:

  3. Get the sanguino software, version 0023
  http://sanguino.cc/softwareforlinux

Because this does not lead to sanguino / sanguinololu support, the instructions for sprinter cannot be completed.

I tried hacking around for a bit , but also stumbled at this instruction:

  5. Edit INSTALL_DIR inside Sprinter/Makefile (do not mind the default reference to arduino 0022)

I cannot determine if this instruction applies to linux, or only to windows. Nor can I determine exactly what to edit.

There are sufficient errors to prevent me from setting up the firmware. This is unfortunate. While it worked, the sprinter firmware seemed to do its job very well. For now, I will pursue other options.

But wait, I found my old sprinter files. I wonder it the sanguino files for 2011 (and arduino 0023) will work with linux (Mint 17 MATE) and arduino 1.0.6.xx?

Let's find out...

Install

Since I'm not sure what I'm doing, I'm going to create a virtual machine. If something goes worng, its easy to delete the failed install and create a new virtual machine.

creat virtual machine (optional)

  1. First, create virtual machine using Virtual Box. I'm using 2 cpu's, 2 gig ram, 32 gig virtual hardware. Installing Linux Mint 17 MATE 64 bit.

find old Sanguino

  1. Locate (old) Sanguino: Sanguino-0018r2_1_4.zip looks to be from June 2010.

install current Arduino IDE

  1. Next install Arduino from Software Center? No, arduino.cc page says:
 --- Ubuntu 12.04 and newer ---
 sudo apt-get update && sudo apt-get install arduino arduino-core  

This terminal command might be the same as the sofwarte center, but I will do this as specified. (after Mint completes updates...)

  The arduino IDE asks to add my user to the dialout group.  Very nice that this is automatic as this is required.

copy sanguino definitions into Arduino install directories

  1. Extract the Sanguino archive. Copy the Sanguino directory to the Arduino install directory:
  2. Find the arduino install directory, /usr/share/arduino/hardware; make it look like:
/usr/share/arduino/hardware/Sanguino

--- find the file boards.txt, copy the sanguino defiinition into boards.txt file in the arduino install directory. No, don't have to do this copy, it finds sanguino definition automatically. Great! ---

At this point, the Sanguino support should be in place for the arduino IDE to use.

Find Sprinter

The current version of sprinter from github is at: https://github.com/kliment/Sprinter

So, the readme in the sprinter download says to do things in a slightly different order, and refers to the newer version "sanguinololu".

The arduino software is already in place.

The sanguino support has been copied into the hardware directory.

clone the branch from github:

 git clone https://github.com/kliment/Sprinter.git

Back to this agian, this is where I stopped last time:

5. Edit INSTALL_DIR inside Sprinter/Makefile (do not mind the default reference to arduino 0022)

6. Run make. If everything goes well Sprinter/applet/Sprinter.cpp should have been created. You can safely ignore the error message mentioning arduino-0023/hardware/arduino/cores/arduino/WString.o

So, I find the directory where sprinter is cloned: /home/sprinter/Sprinter/Sprinter (the lowercase sprinter is the linux username, the first upper case Sprinter is the directory created by the extract command, and the last Sprinter is the directory that contains the files of interest.

Modify Sprinter files

MAKE

The MAKEFILE iteslf contain the detailed instructions on what to do, it wants the ARDUNIO install directory. on my machine I think this would mean:

  /usr/share/arduino

I have an ATMEGA644P, which is the default for sanguinololu, and its 16Mhz. Port = /dev/ttyUSB0

Configuration.h

No SD on this machine:

  // Comment out (using // at the start of the line) to disable SD support:
  // #define SDSUPPORT

Select Sanguino:

  // Sanguinololu 1.2 and above = 62
  // #define MOTHERBOARD 33
  #define MOTHERBOARD 62

OK, this is what I needed to change. Last time I had 57.11 & 700. Now the calculation says I need 58.181818 and 625.70629055. This is the bit that should fix my print issues. How did I get 57.11 insttead of 58.18? I didn't know what I was doing.

  //// Calibration variables
  // X, Y, Z, E steps per unit - Metric Prusa Mendel with Wade extruder:
  // #define _AXIS_STEP_PER_UNIT {80, 80, 3200/1.25,700}
  #define _AXIS_STEP_PER_UNIT {58.181818, 58.181818, 3200/1.25,625.70629055}'

Proper bed travel for this machine:"

  //-----------------------------------------------------------------------
  //Max Length for Prusa Mendel, check the ways of your axis and set this Values
  //-----------------------------------------------------------------------
  const int X_MAX_LENGTH = 190; // 200;
  const int Y_MAX_LENGTH = 180; //200;
  const int Z_MAX_LENGTH = 94; // 100

Sprinter.pde

Put in my own id string

 Serial.begin(BAUDRATE);
 showString(PSTR("Sprinter\r\n"));
 showString(PSTR("Sprinter20150116 DAW\r\n"));


run MAKE again

 test -d applet || mkdir applet
 echo '#include "WProgram.h"' > applet/Sprinter.cpp
 cat Sprinter.pde >> applet/Sprinter.cpp
 cat /usr/share/arduino/hardware/arduino/cores/arduino/main.cpp >> applet/Sprinter.cpp
 make: *** No rule to make target `/usr/share/arduino/hardware/arduino/cores/arduino/pins_arduino.o', needed by `applet/core.a'.  Stop.


run Arduino IDE?

Need to log out and log in again for the "DIALOUT" group assignement to take affect.

restart the IDE. Use the Sprinter.pde as startingg point.

Didn't compile. copied sprinter directory into sketchbook direcotory.

Didin't compile. Could not find Arduino.h, which is in /usr/share/arduino/hardware/arduino/cores/arduino. What is this problem?


This page http://forum.arduino.cc/index.php?topic=162194.0 says:

  You can't use a post 1.0 library with pre 1.0 versions. Time to upgrade. Or downgrade the library.

So I need to use Arduino-0023, not Arduino 1.0.6; unless I can figure out the fix.

this is in the release note from 0023 to 1.0

  • The WProgram.h file, which provides declarations for the Arduino API,
 has been renamed to Arduino.h. To create a library that will work in
 both Arduino 0022 and Arduino 1.0, you can use an #ifdef that checks
 for the ARDUINO constant, which was 22 and is now 100.  For example:
 #if defined(ARDUINO) && ARDUINO >= 100
 #include "Arduino.h"
 #else
 #include "WProgram.h"
 #endif

So if Iadd this to the new stuff, it should also find the old stuff in Sanguino ?

Marlin

The next firmware option listed is Marlin http://reprap.org/wiki/Marlin