Skip to content

Commit

Permalink
Clean up configuration file. Add option to run without filament sensor.
Browse files Browse the repository at this point in the history
Clean up Configuration.  Added option to run without filament sensor.
  • Loading branch information
Filip Mulier committed Jun 30, 2014
1 parent 60155e3 commit 4c7e7b5
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 26 deletions.
32 changes: 21 additions & 11 deletions Mackerel/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Mackerel/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Mackerel/Mackerel_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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




Expand Down
21 changes: 11 additions & 10 deletions Mackerel/ultralcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
}
Expand All @@ -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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions Mackerel/ultralcd_implementation_hitachi_HD44780.h
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 4c7e7b5

Please sign in to comment.