Skip to content

Commit

Permalink
Update pressure with 5Hz
Browse files Browse the repository at this point in the history
  • Loading branch information
shohei committed Oct 29, 2018
1 parent 6a8b3e5 commit 86aee22
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 7 deletions.
Binary file modified arduino_zsprinter/Debug/arduino_zsprinter.bin
Binary file not shown.
Binary file modified arduino_zsprinter/Debug/arduino_zsprinter.elf
Binary file not shown.
2 changes: 1 addition & 1 deletion arduino_zsprinter/Debug/arduino_zsprinter.elf.size
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
text data bss dec hex filename
234428 4216 7428 246072 3c138 arduino_zsprinter.elf
234424 4216 7424 246064 3c130 arduino_zsprinter.elf
Binary file modified arduino_zsprinter/Debug/src/arduino_zsprinter.o
Binary file not shown.
Binary file modified arduino_zsprinter/Debug/src/heater.o
Binary file not shown.
5 changes: 5 additions & 0 deletions arduino_zsprinter/src/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,11 @@ const int dropsegments=5; //everything with less than this number of steps will
//every Digital output for it, main usage for Sanguinololu
#define FAN_SOFT_PWM


// Make fan current 0 while not using (Avoid short circuit risk)
#define FAN0_CURRENT 0 //0-255
#define FAN1_CURRENT 0 //0-255

//-----------------------------------------------------------------------
//// MINIMUM START SPEED FOR FAN
//-----------------------------------------------------------------------
Expand Down
16 changes: 10 additions & 6 deletions arduino_zsprinter/src/arduino_zsprinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,8 @@ uint8_t last_tool_number;

#define DISPENSER_BASE_PRESSURE 2000 // 200.0[kPa] as F=600 (10[mm/s])
#define DISPENSER_BASE_SPEED 10.0 // [mm/s] = F600 [mm/min]
#define DISPENSER_PRESSURE_MAX 8000
#define DISPENSER_PRESSURE_MIN 200
float extruder_base_ratio = 0.14; // When F=1200 (20[mm/s]), delta_E/delta_r = 0.14 (calculated from reference G-code from KJ)
int current_dispenser_pressure = DISPENSER_BASE_PRESSURE;
int last_dispenser_pressure = DISPENSER_BASE_PRESSURE;
Expand Down Expand Up @@ -2507,8 +2509,8 @@ void process_commands() {

} else {
#if defined(FAN_SOFT_PWM) && (FAN_PIN > -1)
g_fan_pwm_val = 255;
g_fan_pwm_val2 = 255;
g_fan_pwm_val = FAN0_CURRENT;
g_fan_pwm_val2 = FAN1_CURRENT;
#else
//WRITE(FAN_PIN, HIGH);
//analogWrite_check(FAN_PIN, 255 );
Expand Down Expand Up @@ -5224,8 +5226,8 @@ else if (e_steps > 0) {
current_dispenser_pressure = ceil(DISPENSER_BASE_PRESSURE
* current_block->dispenser_multiplier
* current_block->dispenser_pressure_gain);
if(current_dispenser_pressure>7500) current_dispenser_pressure = 7500;
if(current_dispenser_pressure<200) current_dispenser_pressure = 200;
if(current_dispenser_pressure>DISPENSER_PRESSURE_MAX) current_dispenser_pressure = DISPENSER_PRESSURE_MAX;
if(current_dispenser_pressure<DISPENSER_PRESSURE_MIN) current_dispenser_pressure = DISPENSER_PRESSURE_MIN;

is_first_block_element = false;
}
Expand Down Expand Up @@ -6072,8 +6074,10 @@ else if (e_steps > 0) {
0, //Channel 0
// 0x1dcd6500); //0.2Hz
// 0x4c4b40); //20Hz
0x5f5e100); //1Hz -> for debug
// 0x1312d00);//5Hz
// 0x5f5e100); //1Hz -> for debug
// 0x3b9aca00); //10Hz
0x1312d00);//5Hz
//0x2faf0800); //8Hz

XTmrCtr_SetOptions(&TimerInstancePtr4,
0, //Channel 0
Expand Down

0 comments on commit 86aee22

Please sign in to comment.