Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.0.x] L6470 - add powerSTEP01 support #13053

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
ef80a51
Fix SERIAL_ECHOLNPAIR
thinkyhead Mar 9, 2019
5f3240c
Support powerSTEP01, L6480 (L64XX v0.7.0)
Bob-the-Kuhn Jan 25, 2019
ebdbb65
Update examples for L64XX 0.7.0
thinkyhead Mar 2, 2019
375dd39
misc bug fixes, external SPI linking doesn't work
Bob-the-Kuhn Mar 2, 2019
203f43f
Use 'default' to suppress enum warning
thinkyhead Mar 2, 2019
f1e4039
Pass by reference instead of copying
thinkyhead Mar 2, 2019
f2acb18
Set helper as a pointer instead of a reference
thinkyhead Mar 3, 2019
33affc4
fix formatting bugs and fix slew rate problem
Bob-the-Kuhn Mar 4, 2019
64676b9
axis_mon fix
Bob-the-Kuhn Mar 10, 2019
74a87f1
remove unintended changes
Bob-the-Kuhn Mar 10, 2019
ef4df66
Merge branch 'bugfix-2.0.x' into powerSTEP01-PR
Bob-the-Kuhn Mar 10, 2019
5449cfb
revert to handlers (pointers) method
Bob-the-Kuhn Mar 12, 2019
30b2768
Support powerSTEP01, L6480 (L64XX v0.7.0)
Bob-the-Kuhn Jan 25, 2019
e1c9f5a
Update examples for L64XX 0.7.0
thinkyhead Mar 2, 2019
9c4f849
misc bug fixes, external SPI linking doesn't work
Bob-the-Kuhn Mar 2, 2019
89ed68e
Use 'default' to suppress enum warning
thinkyhead Mar 2, 2019
3ed7030
Pass by reference instead of copying
thinkyhead Mar 2, 2019
d51b63d
Set helper as a pointer instead of a reference
thinkyhead Mar 3, 2019
0bfee43
fix formatting bugs and fix slew rate problem
Bob-the-Kuhn Mar 4, 2019
b4f90b3
axis_mon fix
Bob-the-Kuhn Mar 10, 2019
5964101
remove unintended changes
Bob-the-Kuhn Mar 10, 2019
9319859
revert to handlers (pointers) method
Bob-the-Kuhn Mar 12, 2019
391cba8
rebase
Bob-the-Kuhn Mar 12, 2019
e1d9628
Merge branch 'powerSTEP01-PR' of https://github.com/Bob-the-Kuhn/Marl…
Bob-the-Kuhn Mar 12, 2019
5276749
Merge branch 'bugfix-2.0.x' into powerSTEP01-PR
Bob-the-Kuhn Mar 18, 2019
ca8301e
fix bugs introduced in previous commit
Bob-the-Kuhn Mar 19, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -623,12 +623,11 @@
*
* A4988 is assumed for unspecified drivers.
*
* Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
* TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE,
* TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE,
* TMC2160, TMC2160_STANDALONE, TMC5130, TMC5130_STANDALONE,
* TMC5160, TMC5160_STANDALONE
* :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
* Options: A4988, A5984, DRV8825, LV8729, L6470, L6480, powerSTEP01, TB6560, TB6600,
* TMC2100, TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, TMC2208,
* TMC2208_STANDALONE, TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE,
* TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
* :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6480', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
*/
//#define X_DRIVER_TYPE A4988
//#define Y_DRIVER_TYPE A4988
Expand Down
217 changes: 115 additions & 102 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1682,12 +1682,12 @@

#endif // HAS_TRINAMIC

// @section L6470
// @section L64XX

/**
* L6470 Stepper Driver options
* L64XX Stepper Driver options
*
* Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver.
* Arduino-L6470 library (0.7.0 or higher) is required.
* https://github.com/ameyer/Arduino-L6470
*
* Requires the following to be defined in your pins_YOUR_BOARD file
Expand All @@ -1697,112 +1697,125 @@
* L6470_CHAIN_SS_PIN
* L6470_RESET_CHAIN_PIN (optional)
*/
#if HAS_DRIVER(L6470)
#if HAS_L64XX

//#define L6470_CHITCHAT // Display additional status info

#if AXIS_DRIVER_TYPE_X(L6470)
#if AXIS_IS_L64XX(X)
#define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128)
#define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
#define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down)
#define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper
#define X_CHAIN_POS 0 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
#endif

#if AXIS_DRIVER_TYPE_X2(L6470)
#define X2_MICROSTEPS 128
#define X2_OVERCURRENT 2000
#define X2_STALLCURRENT 1500
#define X2_MAX_VOLTAGE 127
#define X2_CHAIN_POS 0
#endif

#if AXIS_DRIVER_TYPE_Y(L6470)
#define Y_MICROSTEPS 128
#define Y_OVERCURRENT 2000
#define Y_STALLCURRENT 1500
#define Y_MAX_VOLTAGE 127
#define Y_CHAIN_POS 0
#endif

#if AXIS_DRIVER_TYPE_Y2(L6470)
#define Y2_MICROSTEPS 128
#define Y2_OVERCURRENT 2000
#define Y2_STALLCURRENT 1500
#define Y2_MAX_VOLTAGE 127
#define Y2_CHAIN_POS 0
#endif

#if AXIS_DRIVER_TYPE_Z(L6470)
#define Z_MICROSTEPS 128
#define Z_OVERCURRENT 2000
#define Z_STALLCURRENT 1500
#define Z_MAX_VOLTAGE 127
#define Z_CHAIN_POS 0
#endif

#if AXIS_DRIVER_TYPE_Z2(L6470)
#define Z2_MICROSTEPS 128
#define Z2_OVERCURRENT 2000
#define Z2_STALLCURRENT 1500
#define Z2_MAX_VOLTAGE 127
#define Z2_CHAIN_POS 0
#endif

#if AXIS_DRIVER_TYPE_Z3(L6470)
#define Z3_MICROSTEPS 128
#define Z3_OVERCURRENT 2000
#define Z3_STALLCURRENT 1500
#define Z3_MAX_VOLTAGE 127
#define Z3_CHAIN_POS 0
#endif

#if AXIS_DRIVER_TYPE_E0(L6470)
#define E0_MICROSTEPS 128
#define E0_OVERCURRENT 2000
#define E0_STALLCURRENT 1500
#define E0_MAX_VOLTAGE 127
#define E0_CHAIN_POS 0
#endif

#if AXIS_DRIVER_TYPE_E1(L6470)
#define E1_MICROSTEPS 128
#define E1_OVERCURRENT 2000
#define E1_STALLCURRENT 1500
#define E1_MAX_VOLTAGE 127
#define E1_CHAIN_POS 0
#endif

#if AXIS_DRIVER_TYPE_E2(L6470)
#define E2_MICROSTEPS 128
#define E2_OVERCURRENT 2000
#define E2_STALLCURRENT 1500
#define E2_MAX_VOLTAGE 127
#define E2_CHAIN_POS 0
#endif

#if AXIS_DRIVER_TYPE_E3(L6470)
#define E3_MICROSTEPS 128
#define E3_OVERCURRENT 2000
#define E3_STALLCURRENT 1500
#define E3_MAX_VOLTAGE 127
#define E3_CHAIN_POS 0
#endif

#if AXIS_DRIVER_TYPE_E4(L6470)
#define E4_MICROSTEPS 128
#define E4_OVERCURRENT 2000
#define E4_STALLCURRENT 1500
#define E4_MAX_VOLTAGE 127
#define E4_CHAIN_POS 0
#endif

#if AXIS_DRIVER_TYPE_E5(L6470)
#define E5_MICROSTEPS 128
#define E5_OVERCURRENT 2000
#define E5_STALLCURRENT 1500
#define E5_MAX_VOLTAGE 127
#define E5_CHAIN_POS 0
#define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest
#endif

#if AXIS_IS_L64XX(X2)
#define X2_MICROSTEPS 128
#define X2_OVERCURRENT 2000
#define X2_STALLCURRENT 1500
#define X2_MAX_VOLTAGE 127
#define X2_CHAIN_POS 0
#define X2_SLEW_RATE 1
#endif

#if AXIS_IS_L64XX(Y)
#define Y_MICROSTEPS 128
#define Y_OVERCURRENT 2000
#define Y_STALLCURRENT 1500
#define Y_MAX_VOLTAGE 127
#define Y_CHAIN_POS 0
#define Y_SLEW_RATE 1
#endif

#if AXIS_IS_L64XX(Y2)
#define Y2_MICROSTEPS 128
#define Y2_OVERCURRENT 2000
#define Y2_STALLCURRENT 1500
#define Y2_MAX_VOLTAGE 127
#define Y2_CHAIN_POS 0
#define Y2_SLEW_RATE 1
#endif

#if AXIS_IS_L64XX(Z)
#define Z_MICROSTEPS 128
#define Z_OVERCURRENT 2000
#define Z_STALLCURRENT 1500
#define Z_MAX_VOLTAGE 127
#define Z_CHAIN_POS 0
#define Z_SLEW_RATE 1
#endif

#if AXIS_IS_L64XX(Z2)
#define Z2_MICROSTEPS 128
#define Z2_OVERCURRENT 2000
#define Z2_STALLCURRENT 1500
#define Z2_MAX_VOLTAGE 127
#define Z2_CHAIN_POS 0
#define Z2_SLEW_RATE 1
#endif

#if AXIS_IS_L64XX(Z3)
#define Z3_MICROSTEPS 128
#define Z3_OVERCURRENT 2000
#define Z3_STALLCURRENT 1500
#define Z3_MAX_VOLTAGE 127
#define Z3_CHAIN_POS 0
#define Z3_SLEW_RATE 1
#endif

#if AXIS_IS_L64XX(E0)
#define E0_MICROSTEPS 128
#define E0_OVERCURRENT 2000
#define E0_STALLCURRENT 1500
#define E0_MAX_VOLTAGE 127
#define E0_CHAIN_POS 0
#define E0_SLEW_RATE 1
#endif

#if AXIS_IS_L64XX(E1)
#define E1_MICROSTEPS 128
#define E1_OVERCURRENT 2000
#define E1_STALLCURRENT 1500
#define E1_MAX_VOLTAGE 127
#define E1_CHAIN_POS 0
#define E1_SLEW_RATE 1
#endif

#if AXIS_IS_L64XX(E2)
#define E2_MICROSTEPS 128
#define E2_OVERCURRENT 2000
#define E2_STALLCURRENT 1500
#define E2_MAX_VOLTAGE 127
#define E2_CHAIN_POS 0
#define E2_SLEW_RATE 1
#endif

#if AXIS_IS_L64XX(E3)
#define E3_MICROSTEPS 128
#define E3_OVERCURRENT 2000
#define E3_STALLCURRENT 1500
#define E3_MAX_VOLTAGE 127
#define E3_CHAIN_POS 0
#define E3_SLEW_RATE 1
#endif

#if AXIS_IS_L64XX(E4)
#define E4_MICROSTEPS 128
#define E4_OVERCURRENT 2000
#define E4_STALLCURRENT 1500
#define E4_MAX_VOLTAGE 127
#define E4_CHAIN_POS 0
#define E4_SLEW_RATE 1
#endif

#if AXIS_IS_L64XX(E5)
#define E5_MICROSTEPS 128
#define E5_OVERCURRENT 2000
#define E5_STALLCURRENT 1500
#define E5_MAX_VOLTAGE 127
#define E5_CHAIN_POS 0
#define E5_SLEW_RATE 1
#endif

/**
Expand All @@ -1828,7 +1841,7 @@
//#define L6470_STOP_ON_ERROR
#endif

#endif // L6470
#endif // HAS_L64XX

/**
* TWI/I2C BUS
Expand Down
2 changes: 2 additions & 0 deletions Marlin/src/HAL/HAL_LINUX/include/serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ class HalSerial {
#define OCT 8
#define BIN 2

void print_bin(const uint16_t val);

void print_bin(uint32_t value, uint8_t num_digits) {
uint32_t mask = 1 << (num_digits -1);
for (uint8_t i = 0; i < num_digits; i++) {
Expand Down
Loading