Browse Source

Support for BariCUDA Paste Extruder derived from MakerBot Frostruder. Using Ultimachine RAMBo board. M126/M127 and M128/M129.

Jordan Miller 11 years ago
parent
commit
fbd899a37d
5 changed files with 61 additions and 1 deletions
  1. 2
    0
      Marlin/Marlin.h
  2. 37
    0
      Marlin/Marlin_main.cpp
  3. 1
    1
      Marlin/pins.h
  4. 19
    0
      Marlin/planner.cpp
  5. 2
    0
      Marlin/planner.h

+ 2
- 0
Marlin/Marlin.h View File

@@ -186,6 +186,8 @@ extern float add_homeing[3];
186 186
 extern float min_pos[3];
187 187
 extern float max_pos[3];
188 188
 extern int fanSpeed;
189
+extern int ValvePressure;
190
+extern int EtoPPressure;
189 191
 
190 192
 #ifdef FWRETRACT
191 193
 extern bool autoretract_enabled;

+ 37
- 0
Marlin/Marlin_main.cpp View File

@@ -101,6 +101,10 @@
101 101
 // M115	- Capabilities string
102 102
 // M117 - display message
103 103
 // M119 - Output Endstop status to serial port
104
+// M126 - Solenoid Air Valve Open (BariCUDA support by jmil)
105
+// M127 - Solenoid Air Valve Closed (BariCUDA vent to atmospheric pressure by jmil)
106
+// M128 - EtoP Open (BariCUDA EtoP = electricity to air pressure transducer by jmil)
107
+// M129 - EtoP Closed (BariCUDA EtoP = electricity to air pressure transducer by jmil)
104 108
 // M140 - Set bed target temp
105 109
 // M190 - Wait for bed current temp to reach target temp.
106 110
 // M200 - Set filament diameter
@@ -168,6 +172,8 @@ float extruder_offset[2][EXTRUDERS] = {
168 172
 #endif
169 173
 uint8_t active_extruder = 0;
170 174
 int fanSpeed=0;
175
+int ValvePressure=0;
176
+int EtoPPressure=0;
171 177
 
172 178
 #ifdef FWRETRACT
173 179
   bool autoretract_enabled=true;
@@ -1169,6 +1175,37 @@ void process_commands()
1169 1175
         break;
1170 1176
     #endif //FAN_PIN
1171 1177
 
1178
+	// PWM for HEATER_1_PIN
1179
+    #if HEATER_1_PIN > -1
1180
+      case 126: //M126 valve open
1181
+        if (code_seen('S')){
1182
+           ValvePressure=constrain(code_value(),0,255);
1183
+        }
1184
+        else {
1185
+          ValvePressure=255;			
1186
+        }
1187
+        break;
1188
+      case 127: //M127 valve closed
1189
+        ValvePressure = 0;
1190
+        break;
1191
+    #endif //HEATER_1_PIN
1192
+
1193
+	// PWM for HEATER_2_PIN
1194
+    #if HEATER_2_PIN > -1
1195
+      case 128: //M128 valve open
1196
+        if (code_seen('S')){
1197
+           EtoPPressure=constrain(code_value(),0,255);
1198
+        }
1199
+        else {
1200
+          EtoPPressure=255;			
1201
+        }
1202
+        break;
1203
+      case 129: //M129 valve closed
1204
+        EtoPPressure = 0;
1205
+        break;
1206
+    #endif //HEATER_2_PIN
1207
+
1208
+
1172 1209
     #if (PS_ON_PIN > -1)
1173 1210
       case 80: // M80 - ATX Power On
1174 1211
         SET_OUTPUT(PS_ON_PIN); //GND

+ 1
- 1
Marlin/pins.h View File

@@ -1474,7 +1474,7 @@
1474 1474
 #define HEATER_1_PIN 7
1475 1475
 #define TEMP_1_PIN 1
1476 1476
 
1477
-#define HEATER_2_PIN -1
1477
+#define HEATER_2_PIN 6
1478 1478
 #define TEMP_2_PIN -1
1479 1479
 
1480 1480
 #define E0_STEP_PIN         34

+ 19
- 0
Marlin/planner.cpp View File

@@ -439,12 +439,18 @@ void check_axes_activity()
439 439
   unsigned char z_active = 0;
440 440
   unsigned char e_active = 0;
441 441
   unsigned char tail_fan_speed = fanSpeed;
442
+  unsigned char valve_pressure = 0;
443
+  unsigned char e_to_p_pressure = 0;
444
+  unsigned char tail_valve_pressure = 0;
445
+  unsigned char tail_e_to_p_pressure = 0;
442 446
   block_t *block;
443 447
 
444 448
   if(block_buffer_tail != block_buffer_head)
445 449
   {
446 450
     uint8_t block_index = block_buffer_tail;
447 451
     tail_fan_speed = block_buffer[block_index].fan_speed;
452
+    tail_valve_pressure = block_buffer[block_index].valve_pressure;
453
+    tail_e_to_p_pressure = block_buffer[block_index].e_to_p_pressure;
448 454
     while(block_index != block_buffer_head)
449 455
     {
450 456
       block = &block_buffer[block_index];
@@ -486,6 +492,17 @@ void check_axes_activity()
486 492
 #ifdef AUTOTEMP
487 493
   getHighESpeed();
488 494
 #endif
495
+
496
+#if HEATER_1_PIN > -1
497
+    if (ValvePressure != 0){
498
+      analogWrite(HEATER_1_PIN,ValvePressure); // If buffer is empty use current fan speed
499
+    }
500
+#endif
501
+#if HEATER_2_PIN > -1
502
+    if (EtoPPressure != 0){
503
+      analogWrite(HEATER_2_PIN,EtoPPressure); // If buffer is empty use current fan speed
504
+    }
505
+#endif
489 506
 }
490 507
 
491 508
 
@@ -559,6 +576,8 @@ void plan_buffer_line(const float &x, const float &y, const float &z, const floa
559 576
   }
560 577
 
561 578
   block->fan_speed = fanSpeed;
579
+  block->valve_pressure = ValvePressure;
580
+  block->e_to_p_pressure = EtoPPressure;
562 581
 
563 582
   // Compute direction bits for this block 
564 583
   block->direction_bits = 0;

+ 2
- 0
Marlin/planner.h View File

@@ -60,6 +60,8 @@ typedef struct {
60 60
   unsigned long final_rate;                          // The minimal rate at exit
61 61
   unsigned long acceleration_st;                     // acceleration steps/sec^2
62 62
   unsigned long fan_speed;
63
+  unsigned long valve_pressure;
64
+  unsigned long e_to_p_pressure;
63 65
   volatile char busy;
64 66
 } block_t;
65 67
 

Loading…
Cancel
Save