Welcome! Log In Create A New Profile

Advanced

Sprinter (was Klimentkip/caruKlip) with acceleration

Posted by caru 
Sprinter (was Klimentkip/caruKlip) with acceleration
April 18, 2011 12:06PM
I would just like to inform everyone that I implemented acceleration on Klimentkip firmware.
For more info and videos, you are welcome to visit: [www.thingiverse.com]

Klimentkip/caruKlip are the same thing at the moment, and they will soon merge in a single fork with a different name.
I will keep you informed about this.

Edited 2 time(s). Last edit at 04/30/2011 11:50PM by caru.
Re: Klimentkip/caruKlip with acceleration (changing name soon)
April 20, 2011 06:22AM
Oh, and please move the project to the Wiki, then. Thingiverse is meant for printed objects and people won't search for firmwares there.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Klimentkip/caruKlip with acceleration (changing name soon)
April 20, 2011 08:24AM
There are plenty of non-printable things on Thingiverse, objects and otherwise. I have no problem with that. This does seem like something that should be on the Wiki too. And here. And everywhere else. The more visibility the better. I intend to try this firmware as soon as I feel like I have my current tool chain working well. (Only change one thing at a time).
Re: Sprinter (was Klimentkip/caruKlip) with acceleration
April 30, 2011 11:57PM
Ok, so the new firmware name is now Sprinter.

@Traumflug: I will write a wiki page when things get more stable. We are probably going to change the acceleration algorithm soon.
Re: Sprinter (was Klimentkip/caruKlip) with acceleration
May 27, 2011 07:44AM
Has anyone shifts during printing on Sprinter? Teacup working stable.
Re: Sprinter (was Klimentkip/caruKlip) with acceleration
May 27, 2011 08:35AM
Do you mean you are missing steps?
Which version of sprinter are you using? What are your acceleration settings, print speeds and travel speeds?
Re: Sprinter (was Klimentkip/caruKlip) with acceleration
May 27, 2011 09:55PM
I have printed for about 12 hours with Sprinter without any issues or missed steps.
Re: Sprinter (was Klimentkip/caruKlip) with acceleration
May 29, 2011 03:09PM
Hello,

I have been using Teacup since the beginning of my RepRap life but thought I would try out Sprinter and found that the Config file was not as clean as Teacups and noticed a few places for improvement.

I added the ability to change microstepping easily (taken from teacup)
I rearranged the config file to make it easier to follow.
I added defines to make it a little less overwhelming for noobs.

Download the attachment for proper formatting
Quote
Sublimes Sprinter Config File
#ifndef PARAMETERS_H
#define PARAMETERS_H

// NO RS485/EXTRUDER CONTROLLER SUPPORT
// PLEASE VERIFY PIN ASSIGNMENTS FOR YOUR CONFIGURATION!!!!!!!
#define MOTHERBOARD 3 // ATMEGA168 = 0, SANGUINO = 1, MOTHERBOARD = 2, MEGA/RAMPS = 3, ATMEGA328 = 4, Gen6 = 5, Sanguinololu = 6

//*************************************************************************************************************************************

//Calibration variables

//*************************************************************************************************************************************

// calculate these values appropriate for your machine
// for threaded rods, this is (steps motor per turn) / (pitch of the thread)
// for belts, this is (steps per motor turn) / (number of gear teeth) / (belt module)
// half-stepping doubles the number, quarter stepping requires * 4, etc.
#define MICROSTEPPING_X 16.0
#define MICROSTEPPING_Y 16.0
#define MICROSTEPPING_Z 16.0
#define MICROSTEPPING_E 4.0

#define STEPS_PER_MM_X (5.023*MICROSTEPPING_X)
#define STEPS_PER_MM_Y (5.023*MICROSTEPPING_Y)
#define STEPS_PER_MM_Z (416.699*MICROSTEPPING_Z)
#define STEPS_PER_MM_E (2.759*MICROSTEPPING_E)

#define MAXIMUM_FEEDRATE 200000
#define MAXIMUM_FEEDRATE_Z 120

#define MAX_LENGTH_X 220
#define MAX_LENGTH_Y 220
#define MAX_LENGTH_Z 100

//*************************************************************************************************************************************

// acceleration settings

//*************************************************************************************************************************************

//Comment this to disable ramp acceleration
#define RAMP_ACCELERATION 1

#define MIN_FEEDRATE 35 // the minimum feedrate
#define MAX_PRINT_ACCEL 750 // Max acceleration in mm/s^2 for printing moves
#define MAX_TRAVEL_ACCEL 1500 // Max acceleration in mm/s^2 for travel moves

//Uncomment this to enable exponential acceleration
//#define EXP_ACCELERATION 1

#define EXP_UNITS_PRINT 10 // the units between minimum and G1 move feedrate
#define EXP_UNITS_TRAVEL 10 // used for travel moves
#define EXP_MIN_FEEDRATE 35 // the minimum feedrate
#define EXP_MIN_CONSTANT 2 // the minimum units of an accelerated move that must be done at constant speed
// Note that if the move is shorter than this value, acceleration won't be perfomed,
// but will be done at the minimum between min_units_per_seconds and move feedrate speeds.


//*************************************************************************************************************************************

// temperature settings

//*************************************************************************************************************************************

// AD595 THERMOCOUPLE SUPPORT UNTESTED... USE WITH CAUTION!!!!

//PID settings:
//Uncomment the following line to enable PID support. This is untested and could be disastrous. Be careful.
//#define PIDTEMP 1
#ifdef PIDTEMP
#define PID_MAX 255 // limits current to nozzle
#define PID_INTEGRAL_DRIVE_MAX 220
#define PID_PGAIN 180 //100 is 1.0
#define PID_IGAIN 2 //100 is 1.0
#define PID_DGAIN 100 //100 is 1.0
#endif

//How often should the heater check for new temp readings, in milliseconds
#define HEATER_CHECK_INTERVAL 50
#define BED_CHECK_INTERVAL 5000

// Select one of these only to define how the nozzle temp is read.
#define HEATER_USES_THERMISTOR
//#define HEATER_USES_AD595
//#define HEATER_USES_MAX6675

// Select one of these only to define how the bed temp is read.
#define BED_USES_THERMISTOR
//#define BED_USES_AD595

//Thermistor settings:

//Uncomment for 100k thermistor
//#include "ThermistorTable_100k.h"
//#include "BedThermistorTable_100k.h"

//Uncomment for 200k thermistor
//#include "ThermistorTable_200k.h"
//#include "BedThermistorTable_200k.h"

//Identical thermistors on heater and bed - use this if you have no heated bed or if the thermistors are the same on both:
#include "ThermistorTable_200k.h"
//#include "ThermistorTable_100k.h"
//#include "ThermistorTable_mendelparts.h"
#define BNUMTEMPS NUMTEMPS
#define bedtemptable temptable

//Experimental temperature smoothing - only uncomment this if your temp readings are noisy
//#define SMOOTHING 1
//#define SMOOTHFACTOR 16 //best to use a power of two here - determines how many values are averaged together by the smoothing algorithm

//Experimental watchdog and minimal temp
//The watchdog waits for the watchperiod in milliseconds whenever an M104 or M109 increases the target temperature
//If the temperature has not increased at the end of that period, the target temperature is set to zero. It can be reset with another M104/M109
//#define WATCHPERIOD 5000 //5 seconds
//The minimal temperature defines the temperature below which the heater will not be enabled
//#define MINTEMP

//Experimental max temp
//When temperature exceeds max temp, your bot will halt.
//This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure!
//You should use MINTEMP for thermistor short/failure protection.
//#define MAXTEMP 275

//*************************************************************************************************************************************

// miscellaneous settings

//*************************************************************************************************************************************

//For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
const bool X_ENABLE_ON = 0;
const bool Y_ENABLE_ON = 0;
const bool Z_ENABLE_ON = 0;
const bool E_ENABLE_ON = 0;

//Disables axis when it's not being used.
const bool DISABLE_X = false;
const bool DISABLE_Y = false;
const bool DISABLE_Z = true;
const bool DISABLE_E = false;

const bool INVERT_X_DIR = false;
const bool INVERT_Y_DIR = false;
const bool INVERT_Z_DIR = true;
const bool INVERT_E_DIR = false;

// Sets direction of endstops when homing; 1=MAX, -1=MIN
const int X_HOME_DIR = -1;
const int Y_HOME_DIR = -1;
const int Z_HOME_DIR = -1;

//Endstop Settings
#define ENDSTOPPULLUPS 1
const bool ENDSTOPS_INVERTING = false;
const bool min_software_endstops = false; //If true, axis won't move to coordinates less than zero.
const bool max_software_endstops = true; //If true, axis won't move to coordinates greater than the defined lengths below.
const int X_MAX_LENGTH = MAX_LENGTH_X;
const int Y_MAX_LENGTH = MAX_LENGTH_Y;
const int Z_MAX_LENGTH = MAX_LENGTH_Z;

#define BAUDRATE 115200

//Comment out to disable SD support
#define SDSUPPORT 1

//Min step delay in microseconds. If you are experiencing missing steps, try to raise the delay microseconds, but be aware this
// If you enable this, make sure STEP_DELAY_RATIO is disabled.
#define STEP_DELAY_MICROS 1

//Step delay over interval ratio. If you are still experiencing missing steps, try to uncomment the following line, but be aware this
//If you enable this, make sure STEP_DELAY_MICROS is disabled.
//#define STEP_DELAY_RATIO 0.25


//*************************************************************************************************************************************

// do not edit below this line unless you know what you are doing

//*************************************************************************************************************************************

float x_steps_per_unit = STEPS_PER_MM_X;
float y_steps_per_unit = STEPS_PER_MM_Y;
float z_steps_per_unit = STEPS_PER_MM_Z;
float e_steps_per_unit = STEPS_PER_MM_E;
float max_feedrate = MAXIMUM_FEEDRATE;
float max_z_feedrate = MAXIMUM_FEEDRATE_Z;

#ifdef RAMP_ACCELERATION
float min_units_per_second = MIN_FEEDRATE;
long max_acceleration_units_per_sq_second = MAX_PRINT_ACCEL;
long max_travel_acceleration_units_per_sq_second = MAX_TRAVEL_ACCEL;
#endif

#ifdef EXP_ACCELERATION
float full_velocity_units = EXP_UNITS_PRINT;
float travel_move_full_velocity_units = EXP_UNITS_TRAVEL;
float min_units_per_second = EXP_MIN_FEEDRATE;
float min_constant_speed_units = EXP_MIN_CONSTANT;
#endif


#endif


FFF Settings Calculator Gcode post processors Geometric Object Deposition Tool Blog
Tantillus.org Mini Printable Lathe How NOT to install a Pololu driver
Attachments:
open | download - configuration.h (8.3 KB)
Re: Sprinter (was Klimentkip/caruKlip) with acceleration
June 01, 2011 07:47PM
Sublime, I agree with you. Thank you for posting this, I will certainly keep this in mind if I find the time to merge it.
Re: Sprinter (was Klimentkip/caruKlip) with acceleration
June 02, 2011 11:52AM
@caru: I've been wondering about something for a while now. When I first found caruklip, and installed it, the acceleration feature was noticeable. Either my memory of that event is faulty, or the acceleration feature is disabled/not the same in recent revs of Sprinter.

I notice that there are Ramp and Exponential acceleration methods. Which one was enabled in the original Caruklip?

I'm guessing it was exponential, but I can't be sure, and have not tried it. It just seems like my motion profiles were extremely smooth back then, compared to now.
Re: Sprinter (was Klimentkip/caruKlip) with acceleration
June 02, 2011 02:27PM
The first acceleration in caruKlip was exponential.

However, I think constant acceleration (which produces a speed ramp) is better under many aspects. If you think it's not smooth enough, you can decrease the units_per_sqr_seconds. Doing so will give you a smoother speed ramp.

Currently, though, exponential acceleration is only supported in the master branch of Sprinter, and not in the experimental branch.
Re: Sprinter (was Klimentkip/caruKlip) with acceleration
June 06, 2011 08:38AM
The printer prints multiple layers. Then there is a shift along the axis of y and z. Naturally, further printing is meaningless. What could it be?
Attachments:
open | download - configuration.h (5.9 KB)
open | download - pins.h (13.3 KB)
Re: Sprinter (was Klimentkip/caruKlip) with acceleration
June 06, 2011 01:19PM
Vato Wrote:
-------------------------------------------------------
> The printer prints multiple layers. Then there is
> a shift along the axis of y and z. Naturally,
> further printing is meaningless. What could it be?

A shift along the Y-and X-Axis is usually caused by missed steps. Meaning that your firmware is issuing step commands that your hardware can't execute. This happens when the axis is trying to move faster than it can or it is trying to accelerate/decelerate harder than it can. This causes an offset on x/y that your firmware is not aware of.
I assume that when you wrote Z-Axis you actually meant X-Axis. Offset in Z is less likely, because it usually doesn't need to go very fast at all.

Dial down your acceleration setting and/or your speed and see if that fixes it.
Re: Sprinter (was Klimentkip/caruKlip) with acceleration
June 06, 2011 02:08PM
Folks! As you may know, we are going to merge the experimental branch of sprinter into the stable branch. So everyone is encouraged to take some time to test it and report the outcome (either successful or not) and bugs here.

To download the experimental branch go here:
[github.com]
Re: Sprinter (was Klimentkip/caruKlip) with acceleration
June 06, 2011 03:10PM
have you considered increasing the buffer?
Re: Sprinter (was Klimentkip/caruKlip) with acceleration
June 06, 2011 04:51PM
BTW, here the new features you will find the experimental branch:
- Each axis now has its configurable acceleration, start speed and max feedrate
- Fixed feedrate bug (now it is calculated in XYZ space), this allows more uniform printing
- Added useful debugging code to make it easier to spot bugs
- Exponential acceleration is no longer supported
Re: Sprinter (was Klimentkip/caruKlip) with acceleration
June 06, 2011 04:53PM
jamesdanielv Wrote:
-------------------------------------------------------
> have you considered increasing the buffer?

You mean the serial buffer? Incresing it may lead to overflow, causing the atmega to halt.
Re: Sprinter (was Klimentkip/caruKlip) with acceleration
June 06, 2011 06:56PM
you could shrink the data each line takes in the buffer, keeping the buffer size without over running the stack. would it still crash arduino this way? thx for your quick reply. I'm curious as to how buffer size changes performance.

Edited 1 time(s). Last edit at 06/06/2011 06:57PM by jamesdanielv.
Re: Sprinter (was Klimentkip/caruKlip) with acceleration
June 06, 2011 09:15PM
I'd suggest you to join #reprap on IRC and ask Kliment, as he wrote the buffering code winking smiley
Re: Sprinter (was Klimentkip/caruKlip) with acceleration
June 07, 2011 04:02PM
ok. thanks.
Re: Sprinter (was Klimentkip/caruKlip) with acceleration
June 08, 2011 08:01AM
Does sprinter work with the reprap host?
Re: Sprinter (was Klimentkip/caruKlip) with acceleration
June 09, 2011 05:50AM
brnrd Wrote:
-------------------------------------------------------
> Does sprinter work with the reprap host?

reprap host is well known to be broken, and I've been finding that all the graphical hosts have issues. Kliment's pronsole seems to be far more reliable. Other command-line based hostwares seem effective too, such as send.py and Teacup's func.sh:mendel_print.

I have no idea why mixing graphical hostware and serial communications is so difficult, but apparently it is.


-----------------------------------------------
Wooden Mendel
Teacup Firmware
Re: Sprinter (was Klimentkip/caruKlip) with acceleration
June 11, 2011 06:25PM
how does sprinter read adc data? also where is the direct link download. i might already be playing around with it if it is the latest caruKlip release. with a buffer of 64 and char size of 64 it runs directly from host without sd card.

please post a page in the reprap wiki. firmwares are growing like weeds...

Edited 1 time(s). Last edit at 06/11/2011 06:26PM by jamesdanielv.
Re: Sprinter (was Klimentkip/caruKlip) with acceleration
June 11, 2011 09:01PM
sprinter is [github.com]


-----------------------------------------------
Wooden Mendel
Teacup Firmware
Re: Sprinter (was Klimentkip/caruKlip) with acceleration
June 14, 2011 08:20AM
hey sprinter firmware would crash on my when gcode was generated by repsnapper and would work when skeinforge generated it.

i found this line of gcode odd G1 E0 Fxxx (xxx being whatever feed rate you set)

I spent 4 hrs troubleshooting tonight to find out what was going on. i disabled steps for e axis and it continued to work without crashing, so it was in the e axis. I think e axis is doing a division by zero.


change this line in sprinter (line 978ish)

if(e_steps_to_take && (x_steps_to_take + y_steps_to_take <= 0) ) e_interval = time_for_move / e_steps_to_take * 100;


to this:
if(e_steps_to_take && (x_steps_to_take + y_steps_to_take <= 0) ) e_interval = time_for_move +1/ e_steps_to_take * 100;

there is a bug in the firmware for when no e movements are calculated. it causes a division by zero. processor locks up!

or remove this line

G1 E0 FXXXX ; from beginning of gcode. either way rep snapper is allowed to do G1 E0, so the firmware should not crash!

you will now be able to use gcode generated in repsnapper!


i have not checked to be sure my hack is correct in the sense of distance but it seems to prevent the crash!

Edited 1 time(s). Last edit at 06/14/2011 08:21AM by jamesdanielv.
Re: Sprinter (was Klimentkip/caruKlip) with acceleration
June 14, 2011 08:43AM
I wonder why it's even trying to work out move times if the distance is zero? If teacup detects a zero distance move with a feedrate, it simply updates the stored feedrate and moves on, without queueing anything.


-----------------------------------------------
Wooden Mendel
Teacup Firmware
Re: Sprinter (was Klimentkip/caruKlip) with acceleration
June 14, 2011 08:49AM
teacup->teacup forum. this is for sprinter!!
Quote
Triffid_Hunter
I wonder why it's even trying to work out move times if the distance is zero? If teacup detects a zero distance move with a feedrate, it simply updates the stored feedrate and moves on, without queueing anything.


sorry. your right. sprinter does this in most cases. it just tries to move the e axis even if zero steps and somehow crashes.

Edited 1 time(s). Last edit at 06/15/2011 07:32AM by jamesdanielv.
Re: Sprinter (was Klimentkip/caruKlip) with acceleration
June 15, 2011 07:29AM
well i checked into it tonight and the wrong values are generated for e darn it. tried to compare to Tonokip firmware and this section is completely rewritten. so until a real fix is posted for firmware then use this workaround

erase this from repsnapper:

G1 E0 FXXXX


if not able to find a true fix, then I'll cheat and replace the string in buffer with G92 E0 Fxxxx ; the fxxxx is ignored

any one else look into sprinter firmware, and dive into the code at all??

I think this is a firmware bug. G1 E0 Fxxxx although poor form, should process normally.

thx.


hooked up o-scope to e step pin and it still was turning on for very short perieds. set 1us delay for step hi/low pulse and extruder was working. it was backtracking its filament to g1 e0. my bad. of course this is with changed adc to interrupt.could not get firmware to work for very long with analog read method.


a workaround is this
// comm variables
#define e_backStepsAllowed 1000 //how many steps back allowed for e- prevents long pauses, and wtf builds.

xdiff = (destination_x - current_x);
ydiff = (destination_y - current_y);
zdiff = (destination_z - current_z);
ediff = (destination_e - current_e);
x_steps_to_take = abs(xdiff) * x_steps_per_unit;
y_steps_to_take = abs(ydiff) * y_steps_per_unit;
z_steps_to_take = abs(zdiff) * z_steps_per_unit;
e_steps_to_take = abs(ediff) * e_steps_per_unit;
//************* moded code
if(x_steps_to_take || y_steps_to_take){
e_steps_to_take = abs(ediff) * e_steps_per_unit;
}
else{e_steps_to_take = abs(ediff) * e_steps_per_unit;
if (ediff<0 ){ if(e_steps_to_take>e_backStepsAllowed) e_steps_to_take =e_backStepsAllowed ;}}
///************************************************************************************************************
//max back steps


so far the following changes. probably should comment on git.
interrupt sampling of adc (so far only reads pin0)
digitalfastwrite (25 times faster);
digitalreadfast (50 times faster)
#define e_backStepsAllowed
buffers 64 (not sure it is really buffering :/)

Edited 3 time(s). Last edit at 06/15/2011 03:11PM by jamesdanielv.
Re: Sprinter (was Klimentkip/caruKlip) with acceleration
June 17, 2011 10:35AM
I have converted my electronics to RAMPS 1.2 and loaded the latest sprinter from github. I am printing SF 41 generated g-code with Repsnapper on the MacOS 10.5.8 at 115200 baud and it seems to be a good working combination. Last night I printed a part that took 6.5 hours successfully. But the rounded corners came out rough and the quality didn't look as good as prints that I was getting with Gen 3.

I have the Pololus set as follows: 1/16 steps for x and y, 1/2 steps on z and 1/8 steps on E. Printing at a feed rate of 30 mm/s, I can see that it doesn't go around arcs smoothly and it goes slower than at straight segments. The filament at curves comes out wavy instead of smooth. This is a sign that the Arduino is not getting the data fast enough when it makes short moves as it goes around arcs. Is there a way to fix this bottleneck in the Repsnapper and/or firmware setting? Can be fixed with an SD-card? Is an SD card kit available somewhere?

Thanks.
Re: Sprinter (was Klimentkip/caruKlip) with acceleration
June 17, 2011 11:23AM
You are probably using Oozebane. Turn that off. I get silky smooth rounds using Sprinter.

Maybe post your settings, and we can compare.
Sorry, only registered users may post in this forum.

Click here to login