From 4c7e7b5d99800a50cd0d3a238182021d94a6a81e Mon Sep 17 00:00:00 2001 From: Filip Mulier Date: Sun, 29 Jun 2014 22:19:06 -0500 Subject: [PATCH] Clean up configuration file. Add option to run without filament sensor. Clean up Configuration. Added option to run without filament sensor. --- Mackerel/Configuration.h | 32 ++++++++++++------- Mackerel/Configuration_adv.h | 2 +- Mackerel/Mackerel_main.cpp | 4 +-- Mackerel/ultralcd.cpp | 21 ++++++------ .../ultralcd_implementation_hitachi_HD44780.h | 4 +-- 5 files changed, 37 insertions(+), 26 deletions(-) diff --git a/Mackerel/Configuration.h b/Mackerel/Configuration.h index 96ee81e..1cb4014 100644 --- a/Mackerel/Configuration.h +++ b/Mackerel/Configuration.h @@ -21,8 +21,8 @@ * Display items * Show more on the main display (length, rpm, diameter) - complete * Trem went blank, but returned - check why this might be - occurs when not collecting stats (like when paused) -* Remove dmin and dmax since does not seem useful -* Add one more digit to M2 RPM (0.00) +* Remove dmin and dmax since does not seem useful - complete +* Add one more digit to M2 RPM (0.00) - complete * Would like to change the total mm while running. - you can do this already - moved to better menus - complete * Need to clear the Tela time stat with the length stat - complete * Figure out how to resent the display periodically so that it restarts after static elect. - complete @@ -32,7 +32,7 @@ * figure out the right thermister - complete * seems to hit max or min temp - fixed * tune the PID - complete -* add autotune to the menus +* add autotune to the menus - complete * * Filament width * Add input and code for filament width sensor - complete @@ -41,9 +41,9 @@ * get PID to work with the filament width to puller speed control and add LCD manual/automatic control - complete * add filament dia max,min, avg, and some way to clear and freeze it - complete * add winder on/off control with an input, screen way, and #define to enable/disable in code - complete -* make sure new configuration items are saved in flash +* make sure new configuration items are saved in flash - complete * add new g-codes for manual/automatic control to allow it to be controlled via pronterface -* clean-up of LCD menus +* clean-up of LCD menus - complete * * need to make filament pid not time based but mm based - complete * change back to direct control, not incremental. - complete @@ -55,12 +55,12 @@ * Clean up the Tune menu to remove factors no longer needed - complete * Change the feedmultiply to an absolute puller_feedrate - complete * Info page does not show M2 rpm. - complete -* Need docs of each function in the menus. +* Need docs of each function in the menus. - complete * * make PID autotune go back to the info screen after launching -* Remove endstop logic out of the stepper interrupt ISR(TIMER1_COMPA_vect) to improve stepper speed and reliability -* Rename to Mackerel from Marlin +* Remove endstop logic out of the stepper interrupt ISR(TIMER1_COMPA_vect) to improve stepper speed and reliability - complete +* Rename to Mackerel from Marlin where referred to in code - complete debug notes: - Hardcoded the temperature reading of the extruder for testing - search for FMMDEBUGTEMP @@ -285,6 +285,9 @@ debug notes: #define LYMAN_EXTRUDER +//comment the next line out if there is no filament sensor +#define FILAMENT_SENSOR + #define DEFAULT_EXTRUDER_RPM 12 //define default extruder RPM #define EXTRUDER_RPM_MAX 50 @@ -296,7 +299,7 @@ debug notes: #define DEFAULT_WINDER_RPM_FACTOR 70 //factor for converting winder PW to rpm - reflects rpm of motor at 12v #define DEFAULT_WINDER_SPEED 35 //default winder speed (0-DEFAULT_WINDER_RPM_FACTOR) -#define KEEP_WINDER_ON 1 //Define when you want to keep the winder power on and use an external switch + #define DESIRED_FILAMENT_DIA 2.8 //define the default desired Filament diameter #define PREHEAT_EXTRUDER_TEMP 185 //Set to 185 deg C based on Hugh's suggestion @@ -316,8 +319,15 @@ debug notes: //can be software-disabled for whatever purposes by #define PREVENT_DANGEROUS_EXTRUDE -#define DEFAULT_AXIS_STEPS_PER_UNIT {78.7402,78.7402,200.0*8/3,30.6*16, 165.85*16} // default steps per unit for Ultimaker //FMM added P_AXIS *16 for 1/16 step -#define DEFAULT_MAX_FEEDRATE {500, 500, 5, 50, 50} // (mm/sec) //FMM added P_AXIS + +#define DEFAULT_ESTEP_PER_REV 489.6 //default setting for the extruder step calibration +#define DEFAULT_PSTEP_PER_MM 2653.6 //default setting for the puller motor step calibration + +//The next two defines have arrays of 5 values which correspond to the 5 axis X,Y,Z,E,P +//For the Lyman Extruder, only E = Extruder Motor and P = Puller Motor settings are utilized +#define DEFAULT_AXIS_STEPS_PER_UNIT {78.7402,78.7402,200.0*8/3,DEFAULT_ESTEP_PER_REV, DEFAULT_PSTEP_PER_MM} +#define DEFAULT_MAX_FEEDRATE {500, 500, 5, 50, 50} // (mm/sec) + #define DEFAULT_MOTOR_ACCELERATION 200 // E and P max acceleration in mm/s^2 - controls extruder acceleration #define DEFAULT_EJERK 1.0 // (mm/sec) #define DEFAULT_PJERK 1.0 // (mm/sec) diff --git a/Mackerel/Configuration_adv.h b/Mackerel/Configuration_adv.h index 0f91a44..5fc3d76 100644 --- a/Mackerel/Configuration_adv.h +++ b/Mackerel/Configuration_adv.h @@ -237,7 +237,7 @@ // Feedrates for manual moves along X, Y, Z, E, P from panel #ifdef ULTIPANEL -#define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 30*60, 40*60} // set the speeds for manual moves (mm/min) +#define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 50*60, 50*60} // set the speeds for manual moves (mm/min) #endif //Comment to disable setting feedrate multiplier via encoder diff --git a/Mackerel/Mackerel_main.cpp b/Mackerel/Mackerel_main.cpp index bfd0d97..fada8be 100644 --- a/Mackerel/Mackerel_main.cpp +++ b/Mackerel/Mackerel_main.cpp @@ -645,11 +645,11 @@ void loop() deltatime = timebuff-lasttime; //calculate delta times lasttime = timebuff; //keep track of last sample time -#ifdef KEEP_WINDER_ON + if(extrude_length < fil_length_cutoff) winderSpeed = default_winder_speed*255/winder_rpm_factor; //keep winder on all the time unless at end of spool -#endif + diff --git a/Mackerel/ultralcd.cpp b/Mackerel/ultralcd.cpp index 7cc0502..6acbaa3 100644 --- a/Mackerel/ultralcd.cpp +++ b/Mackerel/ultralcd.cpp @@ -304,9 +304,7 @@ static void lcd_extruder_pause() { extrude_status=extrude_status & ES_ENABLE_CLEAR; puller_feedrate_default = puller_feedrate; //save default feed rate -#ifndef KEEP_WINDER_ON - winderSpeed = 0; //stop winder -#endif + digitalWrite(CONTROLLERFAN_PIN, 0); //stop fan lcd_disable_statistics(); @@ -365,9 +363,7 @@ void lcd_cooldown() setTargetHotend1(0); setTargetHotend2(0); setTargetBed(0); - #ifndef KEEP_WINDER_ON - winderSpeed = 0; //stop winder - #endif + LCD_MESSAGEPGM("Extruder Cooling"); lcd_return_to_status(); } @@ -381,10 +377,12 @@ static void lcd_main_menu() if ((extrude_status & ES_ENABLE_SET) >0) { + #ifdef FILAMENT_SENSOR if((extrude_status & ES_AUTO_SET) >0) MENU_ITEM(function,MSG_MAN_EXTRUDER,lcd_extruder_manual); else MENU_ITEM(function,MSG_AUTO_EXTRUDER,lcd_extruder_automatic); + #endif MENU_ITEM(function, MSG_PAUSE_EXTRUDER, lcd_extruder_pause); } else @@ -525,13 +523,12 @@ static void lcd_tune_menu() #if TEMP_SENSOR_BED != 0 MENU_ITEM_EDIT(int3, MSG_BED, &target_temperature_bed, 0, BED_MAXTEMP - 15); #endif +#ifdef FILAMENT_SENSOR MENU_ITEM_EDIT(float22,MSG_FILAMENT, &filament_width_desired,1.0,3.0); +#endif MENU_ITEM_EDIT(float6,MSG_LENGTH_CUTOFF, &fil_length_cutoff,1000,999000); -#if KEEP_WINDER_ON MENU_ITEM_EDIT(int3, MSG_WINDER_SPEED, &default_winder_speed, 0, DEFAULT_WINDER_RPM_FACTOR); -#else - MENU_ITEM_EDIT(int3, MSG_WINDER_SPEED, &winderSpeed, 0, 255); -#endif + // MENU_ITEM_EDIT(int3, MSG_FLOW, &extrudemultiply, 10, 999); // MENU_ITEM_EDIT(int3, MSG_FLOW0, &extruder_multiply[0], 10, 999); @@ -706,7 +703,9 @@ static void lcd_prepare_menu() MENU_ITEM(back, MSG_MAIN, lcd_main_menu); MENU_ITEM_EDIT(float22, MSG_EXT_RPM, &extruder_rpm_set,EXTRUDER_RPM_MIN,EXTRUDER_RPM_MAX); MENU_ITEM_EDIT(float22, MSG_SPEED, &puller_feedrate_default, PULLER_FEEDRATE_MIN, PULLER_FEEDRATE_MAX); +#ifdef FILAMENT_SENSOR MENU_ITEM_EDIT(float22,MSG_FILAMENT, &filament_width_desired,1.0,3.0); +#endif MENU_ITEM_EDIT(float6,MSG_LENGTH_CUTOFF, &fil_length_cutoff,1000,999000); MENU_ITEM_EDIT(int3, MSG_WINDER_SPEED, &default_winder_speed, 0, DEFAULT_WINDER_RPM_FACTOR); #ifdef SDSUPPORT @@ -948,7 +947,9 @@ static void lcd_control_menu() MENU_ITEM(back, MSG_MAIN, lcd_main_menu); MENU_ITEM(submenu, MSG_TEMPERATURE, lcd_control_temperature_menu); MENU_ITEM(submenu, MSG_MOTION, lcd_control_motion_menu); +#ifdef FILAMENT_SENSOR MENU_ITEM(submenu,MSG_FILAMENT_PID, lcd_control_Filament_PID_menu); +#endif #ifdef DOGLCD // MENU_ITEM_EDIT(int3, MSG_CONTRAST, &lcd_contrast, 0, 63); MENU_ITEM(submenu, MSG_CONTRAST, lcd_set_contrast); diff --git a/Mackerel/ultralcd_implementation_hitachi_HD44780.h b/Mackerel/ultralcd_implementation_hitachi_HD44780.h index 673ffca..016157c 100644 --- a/Mackerel/ultralcd_implementation_hitachi_HD44780.h +++ b/Mackerel/ultralcd_implementation_hitachi_HD44780.h @@ -483,9 +483,9 @@ static void lcd_implementation_status_screen() lcd.print(' '); # else + lcd.setCursor(0, 1); //Check for filament sensor and show width - #if (FILWIDTH_PIN > -1) - lcd.setCursor(0, 1); + #ifdef FILAMENT_SENSOR lcd.print('d'); //lcd.print(ftostr12(analog2widthFil())); lcd.print(ftostr12(current_filwidth));