Skip to content

Commit

Permalink
bring up to date
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Aug 26, 2022
1 parent 525648d commit 6c232ef
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 41 deletions.
51 changes: 33 additions & 18 deletions config/examples/Elegoo/Neptune 2/Configuration.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
Expand All @@ -20,7 +19,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/

#pragma once
#error "Don't build with import-2.1.x configurations!"
#error "Use the 'bugfix...' or 'release...' configurations matching your Marlin version."
Expand Down Expand Up @@ -139,15 +137,15 @@
* :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000]
*/
#define BAUDRATE 115200
// #define BAUD_RATE_GCODE // Enable G-code M575 to set the baud rate
//#define BAUD_RATE_GCODE // Enable G-code M575 to set the baud rate

/**
* Select a secondary serial port on the board to use for communication with the host.
* Currently Ethernet (-2) is only supported on Teensy 4.1 boards.
* :[-2, -1, 0, 1, 2, 3, 4, 5, 6, 7]
*/
// #define SERIAL_PORT_2 1
// #define BAUDRATE_2 115200 // :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] Enable to override BAUDRATE
//#define SERIAL_PORT_2 1
//#define BAUDRATE_2 115200 // :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] Enable to override BAUDRATE

/**
* Select a third serial port on the board to use for communication with the host.
Expand Down Expand Up @@ -259,7 +257,6 @@
// :[0, 1, 2, 3, 4, 5, 6, 7, 8]
#ifdef IS_2D
#define EXTRUDERS 2
#define SINGLENOZZLE
#else
#define EXTRUDERS 1
#endif
Expand All @@ -268,7 +265,9 @@
#define DEFAULT_NOMINAL_FILAMENT_DIA 1.75

// For Cyclops or any "multi-extruder" that shares a single nozzle.
//#define SINGLENOZZLE
#ifdef IS_2D
#define SINGLENOZZLE
#endif

// Save and restore temperature and fan speed on tool-change.
// Set standby for the unselected tool with M104/106/109 T...
Expand Down Expand Up @@ -1263,6 +1262,10 @@
#define DEFAULT_ACCELERATION 1000 // X, Y, Z ... and E acceleration for printing moves
#define DEFAULT_RETRACT_ACCELERATION 1000 // E acceleration for retracts
#define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z ... acceleration for travel (non printing) moves
#if ENABLED(AXIS4_ROTATES)
#define DEFAULT_ANGULAR_ACCELERATION 3000 // I, J, K acceleration for rotational-only printing moves
#define DEFAULT_ANGULAR_TRAVEL_ACCELERATION 3000 // I, J, K acceleration for rotational-only travel (non printing) moves
#endif

/**
* Default Jerk limits (mm/s)
Expand Down Expand Up @@ -1331,7 +1334,8 @@
* The probe replaces the Z-MIN endstop and is used for Z homing.
* (Automatically enables USE_PROBE_FOR_Z_HOMING.)
*/
// #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
//#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN

// Force the use of the probe for Z-axis homing
//#define USE_PROBE_FOR_Z_HOMING

Expand Down Expand Up @@ -1730,7 +1734,7 @@
*/
//#define Z_IDLE_HEIGHT Z_HOME_POS

#define Z_HOMING_HEIGHT 5 // (mm) Minimal Z height before homing (G28) for Z clearance above the bed, clamps, ...
#define Z_HOMING_HEIGHT 5 // (mm) Minimal Z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure to have this much clearance over your Z_MAX_POS to prevent grinding.

//#define Z_AFTER_HOMING 10 // (mm) Height to move to after homing Z
Expand Down Expand Up @@ -1811,7 +1815,7 @@
#endif

#if EITHER(MIN_SOFTWARE_ENDSTOPS, MAX_SOFTWARE_ENDSTOPS)
#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD
#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD
#endif

/**
Expand Down Expand Up @@ -2050,7 +2054,7 @@
//#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh

#define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed
#define GRID_MAX_POINTS_X 5 // Don't use more than 15 points per axis, implementation limited.
#define GRID_MAX_POINTS_X 5 // Don't use more than 15 points per axis, implementation limited.
#define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X

//#define UBL_HILBERT_CURVE // Use Hilbert distribution for less travel when probing multiple points
Expand All @@ -2061,7 +2065,7 @@
//#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used
// as the Z-Height correction value.

#define UBL_MESH_WIZARD // Run several commands in a row to get a complete mesh
#define UBL_MESH_WIZARD // Run several commands in a row to get a complete mesh

#elif ENABLED(MESH_BED_LEVELING)

Expand Down Expand Up @@ -2094,9 +2098,9 @@

#if ENABLED(LCD_BED_TRAMMING)
#define BED_TRAMMING_INSET_LFRB { 33, 33, 33, 33 } // (mm) Left, Front, Right, Back insets
#define BED_TRAMMING_HEIGHT 0.2 // (mm) Z height of nozzle at leveling points
#define BED_TRAMMING_Z_HOP 2 // (mm) Z height of nozzle between leveling points
#define BED_TRAMMING_INCLUDE_CENTER // Move to the center after the last corner
#define BED_TRAMMING_HEIGHT 0.2 // (mm) Z height of nozzle at leveling points
#define BED_TRAMMING_Z_HOP 2 // (mm) Z height of nozzle between leveling points
#define BED_TRAMMING_INCLUDE_CENTER // Move to the center after the last corner
//#define BED_TRAMMING_USE_PROBE
#if ENABLED(BED_TRAMMING_USE_PROBE)
#define BED_TRAMMING_PROBE_TOLERANCE 0.1 // (mm)
Expand Down Expand Up @@ -2243,12 +2247,12 @@
* M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.)
*/
#define EEPROM_SETTINGS // Persistent storage with M500 and M501
#define DISABLE_M503 // Saves ~2700 bytes of flash. Disable for release!
#define DISABLE_M503 // Saves ~2700 bytes of flash. Disable for release!
#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM.
#define EEPROM_BOOT_SILENT // Keep M503 quiet and only give errors during first load
#if ENABLED(EEPROM_SETTINGS)
//#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors.
// #define EEPROM_INIT_NOW // Init EEPROM on first boot after a new build.
//#define EEPROM_INIT_NOW // Init EEPROM on first boot after a new build.
#endif

// @section host
Expand Down Expand Up @@ -3050,6 +3054,11 @@
#define USE_MKS_GREEN_UI
#endif

//
// CR-6 OEM touch screen. A DWIN display with touch.
//
//#define DWIN_CREALITY_TOUCHLCD

//
// Touch-screen LCD for Malyan M200/M300 printers
//
Expand All @@ -3075,6 +3084,12 @@
//
//#define NEXTION_TFT

//
// PanelDue touch controller by Escher3D
// http://escher3d.com/pages/order/products/product2.php
//
//#define PANELDUE

//
// Third-party or vendor-customized controller interfaces.
// Sources should be installed in 'src/lcd/extui'.
Expand Down Expand Up @@ -3238,7 +3253,7 @@
#define BUTTON_DELAY_EDIT 50 // (ms) Button repeat delay for edit screens
#define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus

#define DISABLE_ENCODER // Disable the click encoder, if any
#define DISABLE_ENCODER // Disable the click encoder, if any
//#define TOUCH_IDLE_SLEEP_MINS 5 // (minutes) Display Sleep after a period of inactivity. Set with M255 S.

#define TOUCH_SCREEN_CALIBRATION
Expand Down
55 changes: 38 additions & 17 deletions config/examples/Elegoo/Neptune 2/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
* 3 = schema.json - The entire configuration schema. (13 = pattern groups)
* 4 = schema.yml - The entire configuration schema.
*/
//#define CONFIG_EXPORT // :[1:'JSON', 2:'config.ini', 3:'schema.json', 4:'schema.yml']
//#define CONFIG_EXPORT 2 // :[1:'JSON', 2:'config.ini', 3:'schema.json', 4:'schema.yml']

//===========================================================================
//============================= Thermal Settings ============================
Expand Down Expand Up @@ -1030,7 +1030,7 @@
#define RESTORE_LEVELING_AFTER_G35 // Enable to restore leveling setup after operation
//#define REPORT_TRAMMING_MM // Report Z deviation (mm) for each point relative to the first

#define ASSISTED_TRAMMING_WIZARD // Add a Tramming Wizard to the LCD menu
#define ASSISTED_TRAMMING_WIZARD // Add a Tramming Wizard to the LCD menu

//#define ASSISTED_TRAMMING_WAIT_POSITION { X_CENTER, Y_CENTER, 30 } // Move the nozzle out of the way for adjustment

Expand Down Expand Up @@ -1081,8 +1081,12 @@
#define DISABLE_INACTIVE_E true

// Default Minimum Feedrates for printing and travel moves
#define DEFAULT_MINIMUMFEEDRATE 0.0 // (mm/s. °/s for rotational-only moves) Minimum feedrate. Set with M205 S.
#define DEFAULT_MINTRAVELFEEDRATE 0.0 // (mm/s. °/s for rotational-only moves) Minimum travel feedrate. Set with M205 T.
#define DEFAULT_MINIMUMFEEDRATE 0.0 // (mm/s) Minimum feedrate. Set with M205 S.
#define DEFAULT_MINTRAVELFEEDRATE 0.0 // (mm/s) Minimum travel feedrate. Set with M205 T.
#if HAS_ROTATIONAL_AXES
#define DEFAULT_ANGULAR_MINIMUMFEEDRATE 0.0 // (°/s) Minimum feedrate for rotational-only moves. Set with M205 P.
#define DEFAULT_ANGULAR_MINTRAVELFEEDRATE 0.0 // (°/s) Minimum travel feedrate for rotational-only moves. Set with M205 Q.
#endif

// Minimum time that a segment needs to take as the buffer gets emptied
#define DEFAULT_MINSEGMENTTIME 20000 // (µs) Set with M205 B.
Expand Down Expand Up @@ -1321,8 +1325,7 @@
//
// LCD Backlight Timeout
//

//#define LCD_BACKLIGHT_TIMEOUT_MINS 1 // (minutes) Timeout before turning off the backlight
//#define LCD_BACKLIGHT_TIMEOUT_MINS 5 // (minutes) Timeout before turning off the backlight

#if HAS_BED_PROBE && EITHER(HAS_MARLINUI_MENU, HAS_TFT_LVGL_UI)
//#define PROBE_OFFSET_WIZARD // Add a Probe Z Offset calibration option to the LCD menu
Expand Down Expand Up @@ -1707,6 +1710,15 @@
*/
//#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security).

/**
* By default the framework is responsible for the shared media I/O.
* Enable this if you need Marlin to take care of the shared media I/O.
* Useful if shared media isn't working properly on some boards.
*/
#if ENABLED(SDSUPPORT) && DISABLED(NO_SD_HOST_DRIVE)
//#define DISKIO_HOST_DRIVE
#endif

/**
* Additional options for Graphical Displays
*
Expand Down Expand Up @@ -1741,7 +1753,6 @@
* Adds the menu item Configuration > LCD Timeout (m) to set a wait period
* from 0 (disabled) to 99 minutes.
*/
//#define DISPLAY_SLEEP_MINUTES 2 // (minutes) Timeout before turning off the screen. Set with M255 S.
/**
Expand Down Expand Up @@ -2014,20 +2025,20 @@
*/
#define BABYSTEPPING
#if ENABLED(BABYSTEPPING)
#define INTEGRATED_BABYSTEPPING // EXPERIMENTAL integration of babystepping into the Stepper ISR
#define INTEGRATED_BABYSTEPPING // EXPERIMENTAL integration of babystepping into the Stepper ISR
//#define BABYSTEP_WITHOUT_HOMING
//#define BABYSTEP_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement).
//#define BABYSTEP_XY // Also enable X/Y Babystepping. Not supported on DELTA!
#define BABYSTEP_INVERT_Z false // Change if Z babysteps should go the other way
#define BABYSTEP_MILLIMETER_UNITS // Specify BABYSTEP_MULTIPLICATOR_(XY|Z) in mm instead of micro-steps
#define BABYSTEP_MULTIPLICATOR_Z 0.01 // (steps or mm) Steps or millimeter distance for each Z babystep
#define BABYSTEP_MILLIMETER_UNITS // Specify BABYSTEP_MULTIPLICATOR_(XY|Z) in mm instead of micro-steps
#define BABYSTEP_MULTIPLICATOR_Z 0.01 // (steps or mm) Steps or millimeter distance for each Z babystep
#define BABYSTEP_MULTIPLICATOR_XY 1 // (steps or mm) Steps or millimeter distance for each XY babystep

//#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping.
#if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING)
#define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds.
// Note: Extra time may be added to mitigate controller latency.
#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle.
#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle.
#if ENABLED(MOVE_Z_WHEN_IDLE)
#define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size.
#endif
Expand Down Expand Up @@ -2066,8 +2077,8 @@
//#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants
#define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed
//#define LA_DEBUG // If enabled, this will generate debug information output over USB.
#define EXPERIMENTAL_SCURVE // Enable this option to permit S-Curve Acceleration
#define ALLOW_LOW_EJERK // Allow a DEFAULT_EJERK value of <10. Recommended for direct drive hotends.
#define EXPERIMENTAL_SCURVE // Enable this option to permit S-Curve Acceleration
#define ALLOW_LOW_EJERK // Allow a DEFAULT_EJERK value of <10. Recommended for direct drive hotends.
#endif

// @section leveling
Expand Down Expand Up @@ -2359,7 +2370,7 @@
// Without XON/XOFF flow control (see SERIAL_XON_XOFF below) 32 bytes should be enough.
// To use flow control, set this buffer size to at least 1024 bytes.
// :[0, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048]
#define RX_BUFFER_SIZE 1024
#define RX_BUFFER_SIZE 1024

#if RX_BUFFER_SIZE >= 1024
// Enable to have the controller send XON/XOFF control characters to
Expand Down Expand Up @@ -3669,6 +3680,14 @@
*/
//#define CNC_COORDINATE_SYSTEMS

/**
* CNC Drilling Cycle - UNDER DEVELOPMENT
*
* Enables G81 to perform a drilling cycle.
* Currently only supports a single cycle, no G-code chaining.
*/
//#define CNC_DRILLING_CYCLE

// @section reporting

/**
Expand Down Expand Up @@ -3934,10 +3953,10 @@
#define HOST_PAUSE_M76 // Tell the host to pause in response to M76
#define HOST_PROMPT_SUPPORT // Initiate host prompts to get user feedback
#if ENABLED(HOST_PROMPT_SUPPORT)
#define HOST_STATUS_NOTIFICATIONS // Send some status messages to the host as notifications
#define HOST_STATUS_NOTIFICATIONS // Send some status messages to the host as notifications
#endif
#define HOST_START_MENU_ITEM // Add a menu item that tells the host to start
#define HOST_SHUTDOWN_MENU_ITEM // Add a menu item that tells the host to shut down
#define HOST_START_MENU_ITEM // Add a menu item that tells the host to start
#define HOST_SHUTDOWN_MENU_ITEM // Add a menu item that tells the host to shut down
#endif

// @section extras
Expand Down Expand Up @@ -4248,6 +4267,8 @@
#define MMU2_CAN_LOAD_INCREMENT_SEQUENCE \
{ -MMU2_CAN_LOAD_INCREMENT, MMU2_CAN_LOAD_FEEDRATE }

// Continue unloading if sensor detects filament after the initial unload move
//#define MMU_IR_UNLOAD_MOVE
#else

/**
Expand Down
12 changes: 6 additions & 6 deletions config/examples/Elegoo/Neptune 2/Native_USB_modification.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
### How to modify ZNP Nano v1.x board for native USB.
### Modifying ZNP Nano v1.x for Native USB

#### Why?

STM32F103/F407 have native USB capabilities, but this board use CH340 USB-serial chip, which greatly limits communication speed (realistucally, no more than 250kbps) and raise the chance of communucation error and missing data. This is most critical in case you use Octoprint or other host software. Native USB-CDC mode communicate at much greater speeds (in our case it'll be around 1.5Mbps) which drastically lowers chance of communication timeout and/or buffer overrruns.
STM32F103/F407 have native USB capabilities, but this board uses a CH340 USB-serial bridge that greatly limits communication speed (realistically, no more than 250kbps), increasing the chance of communication errors and dropped bytes. This is most critical when using Octoprint or other host software. Native USB-CDC mode communicates at much greater speeds (in our case around 1.5Mbps), drastically reducing the chance of communication timeout and/or buffer overrun.

#### How?

1. Cut two traces near CH340 chip (1), two going to endtops (2) and remove two resistors (3) as shown. Scratch off some of the mask from traces on the microcontroller side (2). Optionally you can remove CH340 chip too.
1. Cut two traces near the CH340 chip (1), two going to endstops (2) and remove two resistors (3) as shown. Scratch off some of the mask from the traces on the microcontroller side (2). You can also remove the CH340 if you want.

![](images/1cut.jpg)

2. Solder wires as shown, make new USB wires (under) are exact same length and stick together closely. Use thinnest insulated wires you can (photo show thickest possible). Great choice are wires from laptop screen cable, or good lacqered wire.
2. Solder wires as shown, making sure the new USB wires (below) are exactly the same length and group closely together. Use the thinnest insulated / lacquered wires you can find (the photo shows the thickest possible). The wires used in laptop screens are ideal.

![](images/2wire.jpg)

3. Add 1.5kΩ pullup resistor for D+ signal as shown:
3. Add a 1.5kΩ pullup resistor for the D+ signal as shown:

![](images/3pullup.jpg)

4. Set `default_envs = mks_robin_nano_v1v2_usbmod` or `default_envs = mks_robin_nano_v1_3_f4_usbmod` in platformio.ini, add/uncomment `USB_MOD` in `Configuration.h` and build Marlin.
4. Set `default_envs` to `mks_robin_nano_v1v2_usbmod` or `mks_robin_nano_v1_3_f4_usbmod` in `platformio.ini`. Add/uncomment `USB_MOD` in `Configuration.h` and build Marlin.

0 comments on commit 6c232ef

Please sign in to comment.