Browse Source

Fixing Rigidbot LCD Panel Support

Ruwan J Egoda Gamage 9 years ago
parent
commit
5eeea2f611

+ 1
- 1
Marlin/cardreader.cpp View File

196
   if (root.isOpen()) root.close();
196
   if (root.isOpen()) root.close();
197
 
197
 
198
   #if ENABLED(SDEXTRASLOW)
198
   #if ENABLED(SDEXTRASLOW)
199
-    #define SPI_SPEED SPI_QUARTER_SPEED
199
+    #define SPI_SPEED SPI_SIXTEENTH_SPEED
200
   #elif ENABLED(SDSLOW)
200
   #elif ENABLED(SDSLOW)
201
     #define SPI_SPEED SPI_HALF_SPEED
201
     #define SPI_SPEED SPI_HALF_SPEED
202
   #else
202
   #else

+ 8
- 3
Marlin/example_configurations/RigidBot/Configuration.h View File

219
   //#define  DEFAULT_Ki 0.85
219
   //#define  DEFAULT_Ki 0.85
220
   //#define  DEFAULT_Kd 245
220
   //#define  DEFAULT_Kd 245
221
 
221
 
222
+  // E3D w/ rigidbot cartridge
223
+  //#define  DEFAULT_Kp 16.30
224
+  //#define  DEFAULT_Ki 0.95
225
+  //#define  DEFAULT_Kd 69.69
226
+
222
 #endif // PIDTEMP
227
 #endif // PIDTEMP
223
 
228
 
224
 //===========================================================================
229
 //===========================================================================
611
 // M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
616
 // M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
612
 // M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
617
 // M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
613
 //define this to enable EEPROM support
618
 //define this to enable EEPROM support
614
-//#define EEPROM_SETTINGS
619
+#define EEPROM_SETTINGS
615
 
620
 
616
 #if ENABLED(EEPROM_SETTINGS)
621
 #if ENABLED(EEPROM_SETTINGS)
617
   // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
622
   // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
651
 
656
 
652
 //#define ULTRA_LCD  //general LCD support, also 16x2
657
 //#define ULTRA_LCD  //general LCD support, also 16x2
653
 //#define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
658
 //#define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
654
-//#define SDSUPPORT // Enable SD Card Support in Hardware Console
659
+#define SDSUPPORT // Enable SD Card Support in Hardware Console
655
 // Changed behaviour! If you need SDSUPPORT uncomment it!
660
 // Changed behaviour! If you need SDSUPPORT uncomment it!
656
 //#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
661
 //#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
657
-//#define SDEXTRASLOW // Use even slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
662
+#define SDEXTRASLOW // Use even slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
658
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
663
 //#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
659
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
664
 //#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
660
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
665
 //#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking

+ 4
- 4
Marlin/example_configurations/RigidBot/Configuration_adv.h View File

279
 //=============================Additional Features===========================
279
 //=============================Additional Features===========================
280
 //===========================================================================
280
 //===========================================================================
281
 
281
 
282
-#define ENCODER_RATE_MULTIPLIER         // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
283
-#define ENCODER_10X_STEPS_PER_SEC 75    // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
284
-#define ENCODER_100X_STEPS_PER_SEC 160  // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
282
+//#define ENCODER_RATE_MULTIPLIER         // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
283
+//#define ENCODER_10X_STEPS_PER_SEC 75    // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
284
+//#define ENCODER_100X_STEPS_PER_SEC 160  // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
285
 
285
 
286
 //#define CHDK 4        //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
286
 //#define CHDK 4        //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
287
 #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again
287
 #define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again
414
 
414
 
415
 //The ASCII buffer for receiving from the serial:
415
 //The ASCII buffer for receiving from the serial:
416
 #define MAX_CMD_SIZE 96
416
 #define MAX_CMD_SIZE 96
417
-#define BUFSIZE 4
417
+#define BUFSIZE 8
418
 
418
 
419
 // Bad Serial-connections can miss a received command by sending an 'ok'
419
 // Bad Serial-connections can miss a received command by sending an 'ok'
420
 // Therefore some clients abort after 30 seconds in a timeout.
420
 // Therefore some clients abort after 30 seconds in a timeout.

+ 16
- 15
Marlin/pins_RIGIDBOARD.h View File

5
 #include "pins_RAMPS_13.h"
5
 #include "pins_RAMPS_13.h"
6
 
6
 
7
 #if ENABLED(Z_MIN_PROBE_ENDSTOP)
7
 #if ENABLED(Z_MIN_PROBE_ENDSTOP)
8
-  #define Z_MIN_PROBE_PIN  19
8
+  #undef Z_MAX_PIN
9
+  #define Z_MAX_PIN -1
10
+  #undef Z_MIN_PROBE_PIN
11
+  #define Z_MIN_PROBE_PIN  19    // Z-MAX pin J14 End Stops
9
 #endif
12
 #endif
10
 
13
 
11
 #undef HEATER_0_PIN
14
 #undef HEATER_0_PIN
25
   #undef BEEPER_PIN
28
   #undef BEEPER_PIN
26
   #define BEEPER_PIN -1
29
   #define BEEPER_PIN -1
27
 
30
 
28
-  #undef SD_DETECT_PIN
29
-  #define SD_DETECT_PIN 22
30
-
31
-  // Extra button definitions, substitute for EN1 / EN2
32
-  #define BTN_UP  37 // BTN_EN1
33
-  #define BTN_DWN 35 // BTN_EN2
34
-  #define BTN_LFT 33
35
-  #define BTN_RT  32
36
-
37
-  // Marlin can respond to UP/DOWN by default
38
-  // #undef  BTN_EN1
39
-  // #undef  BTN_EN2
40
-  //#define BTN_EN1 -1
41
-  //#define BTN_EN2 -1
31
+  // Direction buttons
32
+  #define BTN_UP           37
33
+  #define BTN_DWN          35
34
+  #define BTN_LFT          33
35
+  #define BTN_RT           32
42
 
36
 
37
+  // 'R' button
43
   #undef  BTN_ENC
38
   #undef  BTN_ENC
44
   #define BTN_ENC 31
39
   #define BTN_ENC 31
45
 
40
 
41
+  // Disable encoder
42
+  #undef  BTN_EN1
43
+  #define BTN_EN1 -1
44
+  #undef  BTN_EN2
45
+  #define BTN_EN2 -1
46
+
46
   #undef  SD_DETECT_PIN
47
   #undef  SD_DETECT_PIN
47
   #define SD_DETECT_PIN 22
48
   #define SD_DETECT_PIN 22
48
 
49
 

+ 45
- 6
Marlin/ultralcd.cpp View File

218
   #if ENABLED(REPRAPWORLD_KEYPAD)
218
   #if ENABLED(REPRAPWORLD_KEYPAD)
219
     volatile uint8_t buttons_reprapworld_keypad; // to store the keypad shift register values
219
     volatile uint8_t buttons_reprapworld_keypad; // to store the keypad shift register values
220
   #endif
220
   #endif
221
+  #if ENABLED(RIGIDBOT_PANEL)
222
+    volatile millis_t next_fake_encoder_update_ms;
223
+  #endif
221
 
224
 
222
   #if ENABLED(LCD_HAS_SLOW_BUTTONS)
225
   #if ENABLED(LCD_HAS_SLOW_BUTTONS)
223
     volatile uint8_t slow_buttons; // Bits of the pressed buttons.
226
     volatile uint8_t slow_buttons; // Bits of the pressed buttons.
1524
   lcd_implementation_init();
1527
   lcd_implementation_init();
1525
 
1528
 
1526
   #if ENABLED(NEWPANEL)
1529
   #if ENABLED(NEWPANEL)
1530
+    #if BTN_EN1 > 0
1531
+      SET_INPUT(BTN_EN1);
1532
+      WRITE(BTN_EN1, HIGH);
1533
+    #endif
1527
 
1534
 
1528
-    SET_INPUT(BTN_EN1);
1529
-    SET_INPUT(BTN_EN2);
1530
-    WRITE(BTN_EN1, HIGH);
1531
-    WRITE(BTN_EN2, HIGH);
1535
+    #if BTN_EN2 > 0
1536
+      SET_INPUT(BTN_EN2);
1537
+      WRITE(BTN_EN2, HIGH);
1538
+    #endif
1532
 
1539
 
1533
     #if BTN_ENC > 0
1540
     #if BTN_ENC > 0
1534
       SET_INPUT(BTN_ENC);
1541
       SET_INPUT(BTN_ENC);
1543
       WRITE(SHIFT_LD, HIGH);
1550
       WRITE(SHIFT_LD, HIGH);
1544
     #endif
1551
     #endif
1545
 
1552
 
1553
+    #ifdef RIGIDBOT_PANEL
1554
+      pinMode(BTN_UP,INPUT);
1555
+      pinMode(BTN_DWN,INPUT);
1556
+      pinMode(BTN_LFT,INPUT);
1557
+      pinMode(BTN_RT,INPUT);
1558
+      next_fake_encoder_update_ms = 0;
1559
+    #endif
1560
+
1546
   #else  // Not NEWPANEL
1561
   #else  // Not NEWPANEL
1547
 
1562
 
1548
     #if ENABLED(SR_LCD_2W_NL) // Non latching 2 wire shift register
1563
     #if ENABLED(SR_LCD_2W_NL) // Non latching 2 wire shift register
1843
   void lcd_buttons_update() {
1858
   void lcd_buttons_update() {
1844
     #if ENABLED(NEWPANEL)
1859
     #if ENABLED(NEWPANEL)
1845
       uint8_t newbutton = 0;
1860
       uint8_t newbutton = 0;
1846
-      if (READ(BTN_EN1) == 0) newbutton |= EN_A;
1847
-      if (READ(BTN_EN2) == 0) newbutton |= EN_B;
1861
+      #if BTN_EN1 > 0
1862
+        if (READ(BTN_EN1) == 0) newbutton |= EN_A;
1863
+      #endif
1864
+      #if BTN_EN2 > 0
1865
+        if (READ(BTN_EN2) == 0) newbutton |= EN_B;
1866
+      #endif
1867
+      #if ENABLED(RIGIDBOT_PANEL)
1868
+        if (millis() > next_fake_encoder_update_ms && READ(BTN_UP) == 0) {
1869
+          encoderDiff = -1 * ENCODER_STEPS_PER_MENU_ITEM;
1870
+          next_fake_encoder_update_ms = millis() + 300;
1871
+        }
1872
+        if (millis() > next_fake_encoder_update_ms && READ(BTN_DWN) == 0) {
1873
+          encoderDiff = ENCODER_STEPS_PER_MENU_ITEM;
1874
+          next_fake_encoder_update_ms = millis() + 300;
1875
+        }
1876
+        if (millis() > next_fake_encoder_update_ms && READ(BTN_LFT) == 0) {
1877
+          encoderDiff = -1 * ENCODER_PULSES_PER_STEP;
1878
+          next_fake_encoder_update_ms = millis() + 300;
1879
+        }
1880
+        if (millis() > next_fake_encoder_update_ms && READ(BTN_RT) == 0) {
1881
+          encoderDiff = ENCODER_PULSES_PER_STEP;
1882
+          next_fake_encoder_update_ms = millis() + 300;
1883
+        }
1884
+      #endif
1885
+
1886
+
1848
       #if BTN_ENC > 0
1887
       #if BTN_ENC > 0
1849
         if (millis() > next_button_update_ms && READ(BTN_ENC) == 0) newbutton |= EN_C;
1888
         if (millis() > next_button_update_ms && READ(BTN_ENC) == 0) newbutton |= EN_C;
1850
       #endif
1889
       #endif

+ 3
- 0
Marlin/ultralcd.h View File

41
     #if ENABLED(REPRAPWORLD_KEYPAD)
41
     #if ENABLED(REPRAPWORLD_KEYPAD)
42
       extern volatile uint8_t buttons_reprapworld_keypad; // to store the keypad shift register values
42
       extern volatile uint8_t buttons_reprapworld_keypad; // to store the keypad shift register values
43
     #endif
43
     #endif
44
+    #if ENABLED(RIGIDBOT_PANEL)
45
+      extern volatile millis_t next_fake_encoder_update_ms;
46
+    #endif
44
   #else
47
   #else
45
     FORCE_INLINE void lcd_buttons_update() {}
48
     FORCE_INLINE void lcd_buttons_update() {}
46
   #endif
49
   #endif

Loading…
Cancel
Save