From: <adr...@us...> - 2011-05-08 17:05:23
|
Revision: 4124 http://reprap.svn.sourceforge.net/reprap/?rev=4124&view=rev Author: adrian-bowyer Date: 2011-05-08 17:05:16 +0000 (Sun, 08 May 2011) Log Message: ----------- Tonkip firmware wip. Modified Paths: -------------- trunk/software/firmware/Tonokip_Firmware/Tonokip_Firmware.pde trunk/software/firmware/Tonokip_Firmware/configuration.h trunk/software/firmware/Tonokip_Firmware/pins.h Modified: trunk/software/firmware/Tonokip_Firmware/Tonokip_Firmware.pde =================================================================== --- trunk/software/firmware/Tonokip_Firmware/Tonokip_Firmware.pde 2011-05-05 11:21:54 UTC (rev 4123) +++ trunk/software/firmware/Tonokip_Firmware/Tonokip_Firmware.pde 2011-05-08 17:05:16 UTC (rev 4124) @@ -116,7 +116,7 @@ float destination_x =0.0, destination_y = 0.0, destination_z = 0.0, destination_e = 0.0; float current_x = 0.0, current_y = 0.0, current_z = 0.0, current_e = 0.0; long x_interval, y_interval, z_interval, e_interval; // for speed delay -float feedrate = 1500, next_feedrate, saved_feedrate; +float feedrate = 1500, next_feedrate, saved_feedrate, current_feedrate=1500; float time_for_move; long gcode_N, gcode_LastN; bool relative_mode = false; //Determines Absolute or Relative Coordinates @@ -126,9 +126,7 @@ long long_step_delay_ratio = STEP_DELAY_RATIO * 100; #endif -float current_feedrate; - // comm variables #define MAX_CMD_SIZE 256 #define BUFSIZE 8 @@ -490,64 +488,62 @@ #endif } - - inline void home_x() { - saved_feedrate = feedrate; - feedrate = 1500; - current_to_dest(); - destination_x = -2*X_MAX_LENGTH; - setup_move(); -#ifdef REPRAP_ACC - linear_move(); -#else - linear_move(x_steps_to_take, y_steps_to_take, z_steps_to_take, e_steps_to_take); // make the move -#endif - previous_millis_cmd = millis(); - current_x = 0; - feedrate = saved_feedrate; + saved_feedrate = current_feedrate; + current_feedrate = 1500.0; + current_to_dest(); + destination_x = -2.0*X_MAX_LENGTH; + setup_move(); + #ifdef REPRAP_ACC + linear_move(); + #else + linear_move(x_steps_to_take, y_steps_to_take, z_steps_to_take, e_steps_to_take); // make the move + #endif + current_x = 0; + current_feedrate = saved_feedrate; } - + inline void home_y() { - saved_feedrate = feedrate; - feedrate = 1500; - current_to_dest(); - destination_y = -2*Y_MAX_LENGTH; - setup_move(); -#ifdef REPRAP_ACC - linear_move(); -#else - linear_move(x_steps_to_take, y_steps_to_take, z_steps_to_take, e_steps_to_take); // make the move -#endif - previous_millis_cmd = millis(); - current_y = 0; - feedrate = saved_feedrate; + saved_feedrate = current_feedrate; + current_feedrate = 1500.0; + current_to_dest(); + destination_y = -2.0*Y_MAX_LENGTH; + setup_move(); + #ifdef REPRAP_ACC + linear_move(); + #else + linear_move(x_steps_to_take, y_steps_to_take, z_steps_to_take, e_steps_to_take); // make the move + #endif + current_y = 0; + current_feedrate = saved_feedrate; } - + inline void home_z() { - saved_feedrate = feedrate; - feedrate = 50; - current_to_dest(); - destination_z = -2*Z_MAX_LENGTH; - setup_move(); -#ifdef REPRAP_ACC - linear_move(); -#else - linear_move(x_steps_to_take, y_steps_to_take, z_steps_to_take, e_steps_to_take); // make the move -#endif - previous_millis_cmd = millis(); - current_z = 0; - feedrate = saved_feedrate; -} + saved_feedrate = current_feedrate; + current_feedrate = 100.0; + current_to_dest(); + destination_z = -2.0*Z_MAX_LENGTH; + setup_move(); + #ifdef REPRAP_ACC + linear_move(); + #else + linear_move(x_steps_to_take, y_steps_to_take, z_steps_to_take, e_steps_to_take); // make the move + #endif + current_z = 0; + current_feedrate = saved_feedrate; + } + + + inline void process_commands() { unsigned long codenum; //throw away variable char *starpos=NULL; - bool done; + boolean done; if(code_seen('G')) { switch((int)code_value()) @@ -576,27 +572,28 @@ break; case 28: // Home axis or axes done = false; - if(code_seen('X')) - { - home_x(); - done = true; - } - if(code_seen('Y')) - { - home_y(); - done = true; - } - if(code_seen('Z')) - { - home_z(); - done = true; - } - if(!done) - { - home_x(); - home_y(); - home_z(); - } + if(code_seen('X')) + { + home_x(); + done = true; + } + if(code_seen('Y')) + { + home_y(); + done = true; + } + if(code_seen('Z')) + { + home_z(); + done = true; + } + if(!done) + { + home_x(); + home_y(); + home_z(); + } + previous_millis_cmd = millis(); break; case 90: // G90 relative_mode = false; @@ -780,8 +777,8 @@ if( (millis()-previous_millis_heater) > 1000 ) //Print Temp Reading every 1 second while heating up. { tt=analog2temp(current_raw); - Serial.print("T:"); - Serial.println( tt ); + //Serial.print("T:"); + //Serial.println( tt ); Serial.print("ok T:"); Serial.print( tt ); Serial.print(" B:"); @@ -850,7 +847,7 @@ Serial.print(current_z); Serial.print(" E:"); Serial.println(current_e); - break; + return; } } @@ -1232,24 +1229,36 @@ bool nullmove, real_move; bool direction_f; bool x_can_step, y_can_step, z_can_step, e_can_step, f_can_step; -unsigned long total_steps, t_scale; +long total_steps, t_scale; long dda_counter_x, dda_counter_y, dda_counter_z, dda_counter_e, dda_counter_f; long current_steps_x, current_steps_y, current_steps_z, current_steps_e, current_steps_f; long target_steps_x, target_steps_y, target_steps_z, target_steps_e, target_steps_f; long delta_steps_x, delta_steps_y, delta_steps_z, delta_steps_e, delta_steps_f; float position, target, diff, distance; -unsigned long integer_distance; -unsigned long step_time, time_increment; +long integer_distance; +long step_time, time_increment; -inline unsigned long calculate_feedrate_delay(const unsigned long& feedrate_now) -{ - // Calculate delay between steps in microseconds. Here it is in English: - // (feedrate_now is in mm/minute, distance is in mm, integer_distance is 60000000.0*distance) - // 60000000.0*distance/feedrate_now = move duration in microseconds - // move duration/total_steps = time between steps for master axis. +/* - //return integer_distance/(feedrate_now*total_steps); -return 500; +Calculate delay between steps in microseconds. Here it is in English: + +60000000.0*distance/feedrate_now = move duration in microseconds +move duration/total_steps = time between steps for master axis. + +feedrate_now is in mm/minute, +distance is in mm, +integer_distance is 3000000.0*distance + +To prevent long overflow, we work in increments of 20 microseconds; hence +the 3,000,000 rather than 60,000,000. +*/ + +#define DISTANCE_MULTIPLIER 3000000.0 +#define MICRO_RES 20 + +inline long calculate_feedrate_delay(const long& feedrate_now) +{ + return MICRO_RES*(integer_distance/(feedrate_now*total_steps)); } inline void do_x_step() @@ -1276,8 +1285,42 @@ digitalWrite(E_STEP_PIN, LOW); } +#define ALWAYS_UPDATE 1 +#define CONDITIONAL_UPDATE 2 +#define NEVER_UPDATE 3 + +inline void coord_to_steps(const float& current, const float& destination, long& current_steps, const long& steps_per_unit, + long& target_steps, long& delta_steps, bool& dir, unsigned char dist_check) +{ + position = current; + current_steps = lround(position*steps_per_unit); + target = destination; + target_steps = lround(target*steps_per_unit); + delta_steps = target_steps - current_steps; + if(delta_steps >= 0) dir = 1; + else + { + dir = 0; + delta_steps = -delta_steps; + } + switch(dist_check) + { + case CONDITIONAL_UPDATE: + if(distance > SMALL_DISTANCE2) + return; + case ALWAYS_UPDATE: + diff = target - position; + distance += diff*diff; + break; + case NEVER_UPDATE: + default: + break; + } +} + inline void setup_move() { + if(feedrate > max_feedrate) feedrate = max_feedrate; if(feedrate<10) feedrate=10; @@ -1297,86 +1340,29 @@ nullmove = false; - position = current_x; - current_steps_x = round(position*x_steps_per_unit); - target = destination_x; - target_steps_x = round(target*x_steps_per_unit); - delta_steps_x = target_steps_x - current_steps_x; - if(delta_steps_x >= 0) direction_x = 1; - else - { - direction_x = 0; - delta_steps_x = -delta_steps_x; - } - diff = target - position; - distance = diff*diff; - - position = current_y; - current_steps_y = round(position*y_steps_per_unit); - target = destination_y; - target_steps_y = round(target*y_steps_per_unit); - delta_steps_y = target_steps_y - current_steps_y; - if(delta_steps_y >= 0) direction_y = 1; - else - { - direction_y = 0; - delta_steps_y = -delta_steps_y; - } - diff = target - position; - distance += diff*diff; - - position = current_z; - current_steps_z = round(position*z_steps_per_unit); - target = destination_z; - target_steps_z = round(target*z_steps_per_unit); - delta_steps_z = target_steps_z - current_steps_z; - if(delta_steps_z >= 0) direction_z = 1; - else - { - direction_z = 0; - delta_steps_z = -delta_steps_z; - } - diff = target - position; - distance += diff*diff; - - position = current_e; - current_steps_e = round(position*e_steps_per_unit); - target = destination_e; - target_steps_e = round(target*e_steps_per_unit); - delta_steps_e = target_steps_e - current_steps_e; - if(delta_steps_e >= 0) direction_e = 1; - else - { - direction_e = 0; - delta_steps_e = -delta_steps_e; - } - if(distance < SMALL_DISTANCE2) // Only consider E if it's the only thing that's moving - { - diff = target - position; - distance += diff*diff; - } - + distance = 0.0; + + coord_to_steps(current_x, destination_x, current_steps_x, x_steps_per_unit, + target_steps_x, delta_steps_x, direction_x, ALWAYS_UPDATE); + coord_to_steps(current_y, destination_y, current_steps_y, y_steps_per_unit, + target_steps_y, delta_steps_y, direction_y, ALWAYS_UPDATE); + coord_to_steps(current_z, destination_z, current_steps_z, z_steps_per_unit, + target_steps_z, delta_steps_z, direction_z, ALWAYS_UPDATE); + coord_to_steps(current_e, destination_e, current_steps_e, e_steps_per_unit, + target_steps_e, delta_steps_e, direction_e, CONDITIONAL_UPDATE); + if(distance < SMALL_DISTANCE2) // If only F changes, do it in one shot { nullmove = true; current_feedrate = feedrate; return; } - - position = current_feedrate; - current_steps_f = round(position*f_steps_per_unit); - target = feedrate; - target_steps_f = round(target*f_steps_per_unit); - delta_steps_f = target_steps_f - current_steps_f; - if(delta_steps_f >= 0) direction_f = 1; - else - { - direction_f = 0; - delta_steps_f = -delta_steps_f; - } + coord_to_steps(current_feedrate, feedrate, current_steps_f, f_steps_per_unit, + target_steps_f, delta_steps_f, direction_f, NEVER_UPDATE); + distance = sqrt(distance); - integer_distance = round(distance*60000000.0); + integer_distance = lround(distance*DISTANCE_MULTIPLIER); total_steps = max(delta_steps_x, delta_steps_y); total_steps = max(total_steps, delta_steps_z); @@ -1392,7 +1378,7 @@ } // Rescale the feedrate so it doesn't take lots of steps to do - + t_scale = 1; if(delta_steps_f > total_steps) { @@ -1418,7 +1404,7 @@ dda_counter_f = dda_counter_x; time_increment = calculate_feedrate_delay(t_scale*current_steps_f); - + if(delta_steps_x) enable_x(); if(delta_steps_y) enable_y(); if(delta_steps_z) enable_z(); @@ -1431,39 +1417,13 @@ if (direction_z) digitalWrite(Z_DIR_PIN,!INVERT_Z_DIR); else digitalWrite(Z_DIR_PIN,INVERT_Z_DIR); if (direction_e) digitalWrite(E_DIR_PIN,!INVERT_E_DIR); - else digitalWrite(E_DIR_PIN,INVERT_E_DIR); - -#if 0 + else digitalWrite(E_DIR_PIN,INVERT_E_DIR); - Serial.print("destination_x: "); Serial.println(destination_x); - Serial.print("current_x: "); Serial.println(current_x); - Serial.print("x_steps_to_take: "); Serial.println(delta_steps_x); - Serial.print("time increment: "); Serial.println(time_increment); - Serial.print("total_steps: "); Serial.println(total_steps); - Serial.println(""); - Serial.print("destination_y: "); Serial.println(destination_y); - Serial.print("current_y: "); Serial.println(current_y); - Serial.print("y_steps_to_take: "); Serial.println(delta_steps_y); - Serial.println(""); - Serial.print("destination_z: "); Serial.println(destination_z); - Serial.print("current_z: "); Serial.println(current_z); - Serial.print("z_steps_to_take: "); Serial.println(delta_steps_z); - Serial.println(""); - Serial.print("destination_e: "); Serial.println(destination_e); - Serial.print("current_e: "); Serial.println(current_e); - Serial.print("e_steps_to_take: "); Serial.println(delta_steps_e); - Serial.println(""); - Serial.print("destination_f: "); Serial.println(feedrate); - Serial.print("current_f: "); Serial.println(current_feedrate); - Serial.print("f_steps_to_take: "); Serial.println(delta_steps_f); - Serial.println(""); -#endif - } -inline bool can_step_switch(const long& current, const long& target, bool direction, byte minstop, byte maxstop) +inline bool can_step_switch(const long& here, const long& there, bool direction, int minstop, int maxstop) { - if(current == target) + if(here == there) return false; if(direction) @@ -1479,9 +1439,9 @@ return true; } -inline bool can_step(const long& current, const long& target) +inline bool can_step(const long& here, const long& there) { - return current != target; + return here != there; } void linear_move() // make linear move with preset speeds and destinations, see G0 and G1 @@ -1493,7 +1453,7 @@ } step_time = micros(); - + do { while(step_time > micros()) @@ -1599,18 +1559,29 @@ } if(real_move) // If only F has changed, no point in delaying - step_time += time_increment; + step_time += time_increment; } while (x_can_step || y_can_step || z_can_step || e_can_step || f_can_step); + if(DISABLE_X) disable_x(); if(DISABLE_Y) disable_y(); if(DISABLE_Z) disable_z(); if(DISABLE_E) disable_e(); - current_x = destination_x; - current_y = destination_y; - current_z = destination_z; + if(digitalRead(X_MIN_PIN) != ENDSTOPS_INVERTING) + current_x = 0.0; + else + current_x = destination_x; + if(digitalRead(Y_MIN_PIN) != ENDSTOPS_INVERTING) + current_y = 0.0; + else + current_y = destination_y; + if(digitalRead(Z_MIN_PIN) != ENDSTOPS_INVERTING) + current_z = 0.0; + else + current_z = destination_z; + current_e = destination_e; current_feedrate = feedrate; Modified: trunk/software/firmware/Tonokip_Firmware/configuration.h =================================================================== --- trunk/software/firmware/Tonokip_Firmware/configuration.h 2011-05-05 11:21:54 UTC (rev 4123) +++ trunk/software/firmware/Tonokip_Firmware/configuration.h 2011-05-08 17:05:16 UTC (rev 4124) @@ -72,10 +72,12 @@ float y_steps_per_unit = 91.42; float z_steps_per_unit = 5028.6; float e_steps_per_unit = 30; -float max_feedrate = 200000; //mmm, acceleration! #ifdef REPRAP_ACC float f_steps_per_unit = 1; +float max_feedrate = 4000; +#else +float max_feedrate = 200000; //mmm, acceleration! #endif //float x_steps_per_unit = 10.047; Modified: trunk/software/firmware/Tonokip_Firmware/pins.h =================================================================== --- trunk/software/firmware/Tonokip_Firmware/pins.h 2011-05-05 11:21:54 UTC (rev 4123) +++ trunk/software/firmware/Tonokip_Firmware/pins.h 2011-05-08 17:05:16 UTC (rev 4124) @@ -392,7 +392,7 @@ #define X_DIR_PIN 21 #define X_ENABLE_PIN 4 #define X_MIN_PIN 18 -#define X_MAX_PIN -2 //2 +#define X_MAX_PIN -1 //2 #define Y_STEP_PIN 22 #define Y_DIR_PIN 23 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <adr...@us...> - 2011-07-06 17:36:53
|
Revision: 4144 http://reprap.svn.sourceforge.net/reprap/?rev=4144&view=rev Author: adrian-bowyer Date: 2011-07-06 17:36:46 +0000 (Wed, 06 Jul 2011) Log Message: ----------- Added configuration.h.dist to stop files getting corrupted with each download. Also some useful thermistor files. Added Paths: ----------- trunk/software/firmware/Tonokip_Firmware/BedThermistorTable_10k_EPCOS_B57550G103J.h trunk/software/firmware/Tonokip_Firmware/ThermistorTable_100k_EPCOS_B57540G0104J.h trunk/software/firmware/Tonokip_Firmware/configuration.h.dist Removed Paths: ------------- trunk/software/firmware/Tonokip_Firmware/configuration.h Added: trunk/software/firmware/Tonokip_Firmware/BedThermistorTable_10k_EPCOS_B57550G103J.h =================================================================== --- trunk/software/firmware/Tonokip_Firmware/BedThermistorTable_10k_EPCOS_B57550G103J.h (rev 0) +++ trunk/software/firmware/Tonokip_Firmware/BedThermistorTable_10k_EPCOS_B57550G103J.h 2011-07-06 17:36:46 UTC (rev 4144) @@ -0,0 +1,46 @@ +#ifndef BEDTHERMISTORTABLE_10K_H_ +#define BEDTHERMISTORTABLE_10K_H_ + +// Thermistor lookup table for RepRap Temperature Sensor Boards (http://make.rrrf.org/ts) +// See this page: +// http://dev.www.reprap.org/bin/view/Main/Thermistor +// for details of what goes in this table. +// Made with createTemperatureLookup.py (http://svn.reprap.org/trunk/reprap/firmware/Arduino/utilities/createTemperatureLookup.py) + + + +// RS thermistor 484-0149; EPCOS B57550G103J +// Made with createTemperatureLookup.py (http://svn.reprap.org/trunk/reprap/firmware/Arduino/utilities/createTemperatureLookup.py) +// ./createTemperatureLookup.py --r0=10000 --t0=25 --r1=0 --r2=4700 --beta=3480 --max-adc=1023 +// r0: 10000 +// t0: 25 +// r1: 0 +// r2: 4700 +// beta: 3480 +// max adc: 1023 +#define BNUMTEMPS 20 +short bedtemptable[BNUMTEMPS][2] = { + {1, 599}, + {54, 160}, + {107, 123}, + {160, 103}, + {213, 90}, + {266, 79}, + {319, 70}, + {372, 62}, + {425, 55}, + {478, 49}, + {531, 43}, + {584, 37}, + {637, 31}, + {690, 25}, + {743, 19}, + {796, 12}, + {849, 5}, + {902, -3}, + {955, -16}, + {1008, -42} +}; +#endif + + Added: trunk/software/firmware/Tonokip_Firmware/ThermistorTable_100k_EPCOS_B57540G0104J.h =================================================================== --- trunk/software/firmware/Tonokip_Firmware/ThermistorTable_100k_EPCOS_B57540G0104J.h (rev 0) +++ trunk/software/firmware/Tonokip_Firmware/ThermistorTable_100k_EPCOS_B57540G0104J.h 2011-07-06 17:36:46 UTC (rev 4144) @@ -0,0 +1,77 @@ +#ifndef THERMISTORTABLE_100K_H_ +#define THERMISTORTABLE_100K_H_ + +// "RS 100k thermistor" Rs Part: 528-8592; "EPCOS NTC G540" B57540G0104J +// ./createTemperatureLookup.py --r0=100000 --t0=25 --r1=0 --r2=4700 --beta=4036 --max-adc=1023 +// r0: 100000 +// t0: 25 +// r1: 0 +// r2: 4700 +// beta: 4036 +// max adc: 1023 + +#define NUMTEMPS 20 +short temptable[NUMTEMPS][2] = { + {1, 864}, + {54, 258}, + {107, 211}, + {160, 185}, + {213, 168}, + {266, 154}, + {319, 143}, + {372, 133}, + {425, 125}, + {478, 116}, + {531, 109}, + {584, 101}, + {637, 94}, + {690, 87}, + {743, 79}, + {796, 70}, + {849, 61}, + {902, 50}, + {955, 34}, + {1008, 2} +}; + + +// Thermistor lookup table for RepRap Temperature Sensor Boards (http://make.rrrf.org/ts) +// See this page: +// http://dev.www.reprap.org/bin/view/Main/Thermistor +// for details of what goes in this table. +// Made with createTemperatureLookup.py (http://svn.reprap.org/trunk/reprap/firmware/Arduino/utilities/createTemperatureLookup.py) +// ./createTemperatureLookup.py --r0=100000 --t0=25 --r1=0 --r2=4700 --beta=4066 --max-adc=1023 +// r0: 100000 +// t0: 25 +// r1: 0 +//// r2: 4700 +//// beta: 4066 +//// max adc: 1023 +// +//#define NUMTEMPS 20 +//short temptable[NUMTEMPS][2] = { +// {1, 864}, +// {54, 258}, +// {107, 211}, +// {160, 185}, +// {213, 168}, +// {266, 154}, +// {319, 143}, +// {372, 133}, +// {425, 125}, +// {478, 116}, +// {531, 109}, +// {584, 101}, +// {637, 94}, +// {690, 87}, +// {743, 79}, +// {796, 70}, +// {849, 61}, +// {902, 50}, +// {955, 34}, +// {1008, 2} +//}; + + +#endif + Deleted: trunk/software/firmware/Tonokip_Firmware/configuration.h =================================================================== --- trunk/software/firmware/Tonokip_Firmware/configuration.h 2011-06-28 17:08:09 UTC (rev 4143) +++ trunk/software/firmware/Tonokip_Firmware/configuration.h 2011-07-06 17:36:46 UTC (rev 4144) @@ -1,139 +0,0 @@ -#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 - -//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 - -// Do RepRap-style accelerations -// See: http://reprap.org/wiki/GCodes#G1:_Controlled_move -// Comment out to get Ordinary G-code F-value behaviour -#define REPRAP_ACC - -//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 - -//Acceleration settings -float full_velocity_units = 10; // the units between minimum and G1 move feedrate -float travel_move_full_velocity_units = 10; // used for travel moves -float min_units_per_second = 35.0; // the minimum feedrate -float min_constant_speed_units = 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. - -// 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 - -//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 - -// 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 - -// Calibration formulas -// e_extruded_steps_per_mm = e_feedstock_steps_per_mm * (desired_extrusion_diameter^2 / feedstock_diameter^2) -// new_axis_steps_per_mm = previous_axis_steps_per_mm * (test_distance_instructed/test_distance_traveled) -// units are in millimeters or whatever length unit you prefer: inches,football-fields,parsecs etc - -//Calibration variables -float x_steps_per_unit = 80; -float y_steps_per_unit = 80; -float z_steps_per_unit = 6667.184; -float e_steps_per_unit = 48; - -#ifdef REPRAP_ACC -float f_steps_per_unit = 1; -float max_feedrate = 12000; -#else -float max_feedrate = 200000; //mmm, acceleration! -#endif - -//float x_steps_per_unit = 10.047; -//float y_steps_per_unit = 10.047; -//float z_steps_per_unit = 833.398; -//float e_steps_per_unit = 0.706; -//float max_feedrate = 3000; - -//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 = false; -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; - -//Thermistor settings: -//Uncomment for 10k thermistor -#include "BedThermistorTable_10k.h" - -//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 - -//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. N.B. If true this prevents G28 homing axes. -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 = 220; -const int Y_MAX_LENGTH = 220; -const int Z_MAX_LENGTH = 100; - -#define BAUDRATE 115200 - - - -#endif Added: trunk/software/firmware/Tonokip_Firmware/configuration.h.dist =================================================================== --- trunk/software/firmware/Tonokip_Firmware/configuration.h.dist (rev 0) +++ trunk/software/firmware/Tonokip_Firmware/configuration.h.dist 2011-07-06 17:36:46 UTC (rev 4144) @@ -0,0 +1,138 @@ +#ifndef PARAMETERS_H +#define PARAMETERS_H + +// NO RS485/EXTRUDER CONTROLLER SUPPORT +// PLEASE VERIFY PIN ASSIGNMENTS FOR YOUR CONFIGURATION!!!!!!! +#define MOTHERBOARD 6 // ATMEGA168 = 0, SANGUINO = 1, MOTHERBOARD = 2, MEGA/RAMPS = 3, ATMEGA328 = 4, Gen6 = 5, Sanguinololu = 6 + +//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 + +// Do RepRap-style accelerations +// See: http://reprap.org/wiki/GCodes#G1:_Controlled_move +// Comment out to get Ordinary G-code F-value behaviour +#define REPRAP_ACC + +//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 + +//Acceleration settings +float full_velocity_units = 10; // the units between minimum and G1 move feedrate +float travel_move_full_velocity_units = 10; // used for travel moves +float min_units_per_second = 35.0; // the minimum feedrate +float min_constant_speed_units = 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. + +// 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 + +//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 + +// 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 + +// Calibration formulas +// e_extruded_steps_per_mm = e_feedstock_steps_per_mm * (desired_extrusion_diameter^2 / feedstock_diameter^2) +// new_axis_steps_per_mm = previous_axis_steps_per_mm * (test_distance_instructed/test_distance_traveled) +// units are in millimeters or whatever length unit you prefer: inches,football-fields,parsecs etc + +//Calibration variables +float x_steps_per_unit = 80; +float y_steps_per_unit = 80; +float z_steps_per_unit = 2560; +float e_steps_per_unit = 30; + +#ifdef REPRAP_ACC +float f_steps_per_unit = 1; +float max_feedrate = 12000; +#else +float max_feedrate = 200000; //mmm, acceleration! +#endif + +//float x_steps_per_unit = 10.047; +//float y_steps_per_unit = 10.047; +//float z_steps_per_unit = 833.398; +//float e_steps_per_unit = 0.706; +//float max_feedrate = 3000; + +//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 = false; +const bool DISABLE_E = false; + +const bool INVERT_X_DIR = false; +const bool INVERT_Y_DIR = false; +const bool INVERT_Z_DIR = false; +const bool INVERT_E_DIR = false; + +//Thermistor settings: +//Uncomment for 10k thermistor +#include "BedThermistorTable_10k_EPCOS_B57550G103J.h" + +//Thermistor settings: +//Uncomment for 100k thermistor +#include "ThermistorTable_100k_EPCOS_B57540G0104J.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 + +//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. N.B. If true this prevents G28 homing axes. +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 = 220; +const int Y_MAX_LENGTH = 220; +const int Z_MAX_LENGTH = 100; + +#define BAUDRATE 115200 + + + +#endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |