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

Dynamically changing the mode of I2S #547

Merged
merged 9 commits into from
Aug 19, 2020

Conversation

odaki
Copy link
Contributor

@odaki odaki commented Aug 15, 2020

The I2S stepper has two modes.

  • I2S static Mode
    Short (4-8 μsec) delay, little jitter
  • I2S stream mode
    Long (10-12 millisec) delay, no jitter

This PR is a proposed change that takes advantage of the strengths of each mode of I2S and uses them to their advantage.

In homing and probing, synchronization of sensor input and motor movement is important. So be sure to use the I2S static mode.
Normal motor movement can generate perfectly precalculated steps in normal motor movement, so use the I2S stream mode for accurate movement.
However, it is now possible to fix it to I2S static mode in the machine configuration.
#define DEFAULT_STEPPER ST_I2S_STATIC

In my environment, it appears to be working as intended.

Please confirm.

ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:9720
ho 0 tail 12 room 4
load:0x40080400,len:6352
entry 0x400806b8

[MSG:Grbl_ESP32 Ver 1.3a Date 20200815]
[MSG:Compiled with ESP32 SDK:v3.2.3-14-gd3e562907]
[MSG:Using machine:ESP32 SPI 6 Axis Driver Board Trinamic Test]
[MSG:Axis count 6]
[MSG:I2S Steps, Stream]
[MSG:Init Motors]
[MSG:X  Axis Trinamic TMC2130 Step:I2SO(2) Dir:I2SO(1) CS:I2SO(3) Disable:I2SO(0) Index:-1]
[MSG:Y  Axis Trinamic TMC2130 Step:I2SO(5) Dir:I2SO(4) CS:I2SO(6) Disable:I2SO(7) Index:-1]
[MSG:Z  Axis Trinamic TMC2130 Step:I2SO(10) Dir:I2SO(9) CS:I2SO(11) Disable:I2SO(8) Index:-1]
[MSG:A  Axis Trinamic TMC2130 Step:I2SO(13) Dir:I2SO(12) CS:I2SO(14) Disable:I2SO(15) Index:-1]
[MSG:B  Axis Trinamic TMC2130 Step:I2SO(18) Dir:I2SO(17) CS:I2SO(19) Disable:I2SO(16) Index:-1]
[MSG:C  Axis Trinamic TMC2130 Step:I2SO(21) Dir:I2SO(20) CS:I2SO(22) Disable:I2SO(23) Index:-1]
[MSG:X  Trinamic driver test passed]
[MSG:Y  Trinamic driver test passed]
[MSG:Z  Trinamic driver test passed]
[MSG:A  Trinamic driver test passed]
[MSG:B  Trinamic driver test passed]
[MSG:C  Trinamic driver test passed]
[MSG:TMCStepper Library Ver. 0x000701]
[MSG:Relay spindle Output:GPIO(26), Enbl:None, Dir:None]

[MSG:Local access point GRBL_ESP started, 192.168.0.1]
[MSG:Captive Portal Started]
[MSG:HTTP Started]
[MSG:TELNET Started 23]
[MSG:Probe on pin GPIO(25) Inverted:Y]

Grbl 1.3a ['$' for help]
[MSG:'$H'|'$X' to unlock]
$H
ok
ok
g38.2 x10 f50
[PRB:-0.011,0.000,0.000,0.000,0.000,0.000:1]
ok
ok
g0x-3
ok
ok
g38.2 x10 f50
[PRB:-0.011,0.000,0.000,0.000,0.000,0.000:1]
ok
ok
g0x-3
ok
ok
g38.2 x10 f50
[PRB:-0.011,0.000,0.000,0.000,0.000,0.000:1]
ok
ok
$S
$Sta/SSID=GRBL_ESP
$Sta/Password=******
$Sta/IPMode=DHCP
$Sta/IP=0.0.0.0
$Sta/Gateway=0.0.0.0
$Sta/Netmask=0.0.0.0
$AP/SSID=GRBL_ESP
$AP/Password=******
$AP/IP=192.168.0.1
$AP/Channel=1
$System/Hostname=grblesp
$Http/Enable=ON
$Http/Port=80
$Telnet/Enable=ON
$Telnet/Port=23
$Radio/Mode=AP
$Bluetooth/Name=btgrblesp
$Notification/Type=NONE
$Notification/T1=
$Notification/T2=
$Notification/TS=
$Report/StallGuard=
$Spindle/Type=RELAY
$Stepper/Pulse=4
$Stepper/IdleTime=250
$Stepper/StepInvert=
$Stepper/DirInvert=Y
$Stepper/EnableInvert=Off
$Limits/Invert=On
$Probe/Invert=On
$Report/Status=1
$GCode/JunctionDeviation=0.010
$GCode/ArcTolerance=0.002
$Report/Inches=Off
$Limits/Soft=Off
$Limits/Hard=Off
$Homing/Enable=On
$Homing/DirInvert=
$Homing/Feed=200.000
$Homing/Seek=1000.000
$Homing/Debounce=250.000
$Homing/Pulloff=3.000
$GCode/MaxS=1000.000
$GCode/MinS=0.000
$GCode/LaserMode=Off
$GCode/Line1=
$GCode/Line0=
$Spindle/Enable/Invert=Off
$Spindle/Enable/OffWithSpeed=Off
$Spindle/Delay/SpinDown=0.000
$Spindle/Delay/SpinUp=0.000
$Spindle/PWM/Invert=Off
$Spindle/PWM/Frequency=5000.000
$Spindle/PWM/Off=0.000
$Spindle/PWM/Min=0.000
$Spindle/PWM/Max=100.000
$X/StepsPerMm=88.889
$Y/StepsPerMm=77.037
$Z/StepsPerMm=100.000
$A/StepsPerMm=100.000
$B/StepsPerMm=100.000
$C/StepsPerMm=100.000
$X/MaxRate=5000.000
$Y/MaxRate=15000.000
$Z/MaxRate=3000.000
$A/MaxRate=1000.000
$B/MaxRate=1000.000
$C/MaxRate=1000.000
$X/Acceleration=200.000
$Y/Acceleration=200.000
$Z/Acceleration=50.000
$A/Acceleration=200.000
$B/Acceleration=200.000
$C/Acceleration=200.000
$X/MaxTravel=50.000
$Y/MaxTravel=300.000
$Z/MaxTravel=100.000
$A/MaxTravel=300.000
$B/MaxTravel=300.000
$C/MaxTravel=300.000
$X/Current/Run=0.250
$Y/Current/Run=0.250
$Z/Current/Run=0.250
$A/Current/Run=0.250
$B/Current/Run=0.250
$C/Current/Run=0.250
$X/Current/Hold=0.125
$Y/Current/Hold=0.125
$Z/Current/Hold=0.125
$A/Current/Hold=0.125
$B/Current/Hold=0.125
$C/Current/Hold=0.125
$X/Microsteps=16
$Y/Microsteps=16
$Z/Microsteps=16
$A/Microsteps=16
$B/Microsteps=16
$C/Microsteps=16
$X/StallGuard=16
$Y/StallGuard=16
$Z/StallGuard=16
$A/StallGuard=16
$B/StallGuard=16
$C/StallGuard=16
ok
ok

@odaki
Copy link
Contributor Author

odaki commented Aug 15, 2020

The use of I2S as an expander requires a definition.

#define USE_I2S_OUT

The use of I2S as a stepper requires additional definitions.

#define USE_I2S_STEPS

If you want to always use I2S static, you need an additional define. (Optional.)

#define DEFAULT_STEPPER ST_I2S_STATIC

This is the machine file for my test environment:
i2s_out_xyzabc_trinamic_test.h

#pragma once
// clang-format off

/*
    i2s_out_xyzabc_trinamic_test.h
    Part of Grbl_ESP32
    Pin assignments for the ESP32 SPI 6-axis board
    2018    - Bart Dring
    2020    - Mitch Bradley
    2020    - Michiyasu Odaki
    Grbl_ESP32 is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
    Grbl is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    You should have received a copy of the GNU General Public License
    along with Grbl_ESP32.  If not, see <http://www.gnu.org/licenses/>.
*/
#define MACHINE_NAME            "ESP32 SPI 6 Axis Driver Board Trinamic Test"

#ifdef N_AXIS
        #undef N_AXIS
#endif
#define N_AXIS 6

// === Special Features

// I2S (steppers & other output-only pins)
#define USE_I2S_OUT
#define USE_I2S_STEPS
//#define DEFAULT_STEPPER ST_I2S_STATIC

#define I2S_OUT_BCK      GPIO_NUM_22
#define I2S_OUT_WS       GPIO_NUM_17
#define I2S_OUT_DATA     GPIO_NUM_21

#define TRINAMIC_RUN_MODE           TRINAMIC_MODE_COOLSTEP
#define TRINAMIC_HOMING_MODE        TRINAMIC_MODE_COOLSTEP

#define X_TRINAMIC_DRIVER       2130
#define X_DISABLE_PIN           I2SO(0)
#define X_DIRECTION_PIN         I2SO(1)
#define X_STEP_PIN              I2SO(2)
#define X_CS_PIN                I2SO(3)
#define X_RSENSE                TMC2130_RSENSE_DEFAULT

#define Y_TRINAMIC_DRIVER       2130
#define Y_DIRECTION_PIN         I2SO(4)
#define Y_STEP_PIN              I2SO(5)
#define Y_DISABLE_PIN           I2SO(7)
#define Y_CS_PIN                I2SO(6)
#define Y_RSENSE                X_RSENSE

#define Z_TRINAMIC_DRIVER       2130
#define Z_DISABLE_PIN           I2SO(8)
#define Z_DIRECTION_PIN         I2SO(9)
#define Z_STEP_PIN              I2SO(10)
#define Z_CS_PIN                I2SO(11)
#define Z_RSENSE                X_RSENSE

#define A_TRINAMIC_DRIVER       2130
#define A_DIRECTION_PIN         I2SO(12)
#define A_STEP_PIN              I2SO(13)
#define A_DISABLE_PIN           I2SO(15)
#define A_CS_PIN                I2SO(14)
#define A_RSENSE                X_RSENSE

#define B_TRINAMIC_DRIVER       2130
#define B_DISABLE_PIN           I2SO(16)
#define B_DIRECTION_PIN         I2SO(17)
#define B_STEP_PIN              I2SO(18)
#define B_CS_PIN                I2SO(19)
#define B_RSENSE                X_RSENSE

#define C_TRINAMIC_DRIVER       2130
#define C_DIRECTION_PIN         I2SO(20)
#define C_STEP_PIN              I2SO(21)
#define C_DISABLE_PIN           I2SO(23)
#define C_CS_PIN                I2SO(22)
#define C_RSENSE                X_RSENSE

/*
#define SPINDLE_TYPE            SPINDLE_TYPE_PWM // only one spindle at a time
#define SPINDLE_OUTPUT_PIN      GPIO_NUM_26
#define SPINDLE_ENABLE_PIN      GPIO_NUM_4
#define SPINDLE_DIR_PIN         GPIO_NUM_16
*/
#define X_LIMIT_PIN             GPIO_NUM_33
#define Y_LIMIT_PIN             GPIO_NUM_32
#define Z_LIMIT_PIN             GPIO_NUM_35
#define A_LIMIT_PIN             GPIO_NUM_34
#define B_LIMIT_PIN             GPIO_NUM_39
#define C_LIMIT_PIN             GPIO_NUM_36

#define SPINDLE_TYPE SPINDLE_TYPE_RELAY
#define SPINDLE_OUTPUT_PIN GPIO_NUM_26

#define PROBE_PIN               GPIO_NUM_25

#define COOLANT_MIST_PIN        GPIO_NUM_2

// === Default settings
#define DEFAULT_STEP_PULSE_MICROSECONDS I2S_OUT_USEC_PER_PULSE

// redefine some stuff from config.h
#ifdef HOMING_CYCLE_0
    #undef HOMING_CYCLE_0
#endif
#define HOMING_CYCLE_0 bit(X_AXIS) // this 'bot only homes the X axis
#ifdef HOMING_CYCLE_1
    #undef HOMING_CYCLE_1
#endif
#ifdef HOMING_CYCLE_2
    #undef HOMING_CYCLE_2
#endif

#define DEFAULT_STEPPING_INVERT_MASK 0 // uint8_t
#define DEFAULT_DIRECTION_INVERT_MASK 2 // uint8_t
#define DEFAULT_INVERT_ST_ENABLE 0 // boolean
#define DEFAULT_INVERT_LIMIT_PINS 1 // boolean
#define DEFAULT_INVERT_PROBE_PIN 1 // boolean

#define DEFAULT_HOMING_ENABLE 1
#define DEFAULT_HOMING_DIR_MASK 0 // move positive dir Z, negative X,Y
#define DEFAULT_HOMING_FEED_RATE 200.0 // mm/min
#define DEFAULT_HOMING_SEEK_RATE 1000.0 // mm/min
#define DEFAULT_HOMING_DEBOUNCE_DELAY 250 // msec (0-65k)
#define DEFAULT_HOMING_PULLOFF 3.0 // mm

#define DEFAULT_X_STEPS_PER_MM 88.889
#define DEFAULT_Y_STEPS_PER_MM 77.037
#define DEFAULT_Z_STEPS_PER_MM 100.0 // This is percent in servo mode

#define DEFAULT_X_MAX_RATE 5000.0 // mm/min
#define DEFAULT_Y_MAX_RATE 15000.0 // mm/min
#define DEFAULT_Z_MAX_RATE 3000.0 // mm/min

#define DEFAULT_X_ACCELERATION 200.0 // mm/sec^2. 200 mm/sec^2 = 720000 mm/min^2
#define DEFAULT_Y_ACCELERATION 200.0 // mm/sec^2
#define DEFAULT_Z_ACCELERATION 50.0 // mm/sec^2

#define DEFAULT_X_MAX_TRAVEL 50.0 // mm NOTE: Must be a positive value.
#define DEFAULT_Y_MAX_TRAVEL 300.0 // mm NOTE: Must be a positive value.
#define DEFAULT_Z_MAX_TRAVEL 100.0 // This is percent in servo mode

@odaki
Copy link
Contributor Author

odaki commented Aug 15, 2020

Here's a video recording of the $HX test.
https://www.youtube.com/watch?v=rzMAQWMS4AI

@odaki
Copy link
Contributor Author

odaki commented Aug 16, 2020

I'm experimenting with the limitations of I2S static.
For I2S streams, 25,000 steps/s is no problem.
But with I2S static, the limit is about 8,333 steps/s, and at 10,000 steps/s the motor seems to stall.
I will investigate a little more.

I2S stream
https://www.youtube.com/watch?v=yy8S3oZfGkk

I2S static
https://www.youtube.com/watch?v=4on43IB1uCM

@odaki
Copy link
Contributor Author

odaki commented Aug 16, 2020

Sorry, the problem with the wrong high-rate step in I2S static was a bug specific to this PR.
In I2S static, the processing of pulse off was disabled by a wrong ifdef.
(The duration of the pulse is unreasonably long.)

Before fix:
I2S_static_bug

After fix:
I2S_static_fix

@odaki
Copy link
Contributor Author

odaki commented Aug 16, 2020

Test results:

Video
https://www.youtube.com/watch?v=NO93sZcL4aY

Log

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:9720
ho 0 tail 12 room 4
load:0x40080400,len:6352
entry 0x400806b8

[MSG:Grbl_ESP32 Ver 1.3a Date 20200815]
[MSG:Compiled with ESP32 SDK:v3.2.3-14-gd3e562907]
[MSG:Using machine:ESP32 SPI 6 Axis Driver Board Trinamic Test]
[MSG:Axis count 6]
[MSG:I2S Steps, Static]
[MSG:Init Motors]
[MSG:X  Axis Trinamic TMC2130 Step:I2SO(2) Dir:I2SO(1) CS:I2SO(3) Disable:I2SO(0) Index:-1]
[MSG:Y  Axis Trinamic TMC2130 Step:I2SO(5) Dir:I2SO(4) CS:I2SO(6) Disable:I2SO(7) Index:-1]
[MSG:Z  Axis Trinamic TMC2130 Step:I2SO(10) Dir:I2SO(9) CS:I2SO(11) Disable:I2SO(8) Index:-1]
[MSG:A  Axis Trinamic TMC2130 Step:I2SO(13) Dir:I2SO(12) CS:I2SO(14) Disable:I2SO(15) Index:-1]
[MSG:B  Axis Trinamic TMC2130 Step:I2SO(18) Dir:I2SO(17) CS:I2SO(19) Disable:I2SO(16) Index:-1]
[MSG:C  Axis Trinamic TMC2130 Step:I2SO(21) Dir:I2SO(20) CS:I2SO(22) Disable:I2SO(23) Index:-1]
[MSG:X  Trinamic driver test passed]
[MSG:Y  Trinamic driver test passed]
[MSG:Z  Trinamic driver test passed]
[MSG:A  Trinamic driver test passed]
[MSG:B  Trinamic driver test passed]
[MSG:C  Trinamic driver test passed]
[MSG:TMCStepper Library Ver. 0x000701]
[MSG:Relay spindle Output:GPIO(26), Enbl:None, Dir:None]

[MSG:Local access point GRBL_ESP started, 192.168.0.1]
[MSG:Captive Portal Started]
[MSG:HTTP Started]
[MSG:TELNET Started 23]
[MSG:Probe on pin GPIO(25) Inverted:Y]

Grbl 1.3a ['$' for help]
[MSG:'$H'|'$X' to unlock]
$X
[MSG:Caution: Unlocked]
ok
ok
g0x1000
ok
ok
$X/MaxRate
$X/MaxRate=15000.000
ok
ok

Logic analyzer
スクリーンショット 2020-08-16 12 11 44

@odaki
Copy link
Contributor Author

odaki commented Aug 16, 2020

The current pulse interval of the I2S stream is adjusted using the adhoc value so that the timing is similar to that of a normal interrupt processing stepper.
To take full advantage of the benefits of I2S stream, the compatibility adjustment value for the overhead of a few microseconds each present in the timer interrupt has been removed and modified to accurately time the steps.
The I2S stream has no overhead related to timer processing, so the overall step time is a bit shorter.

Settings:

$X/StepsPerMm=100.000
$X/MaxRate=15000.000
$X/Acceleration=200.000

G-Code:
G0 X500 (50,000 steps)

Overall:
スクリーンショット 2020-08-16 15 38 20

Zoom:
I2S_timing_compare

@odaki
Copy link
Contributor Author

odaki commented Aug 16, 2020

Homing and Probing test results. It appears to be normal.

I2S stream (dynamic switching)

ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:9720
ho 0 tail 12 room 4
load:0x40080400,len:6352
entry 0x400806b8

[MSG:Grbl_ESP32 Ver 1.3a Date 20200815]
[MSG:Compiled with ESP32 SDK:v3.2.3-14-gd3e562907]
[MSG:Using machine:ESP32 SPI 6 Axis Driver Board Trinamic Test]
[MSG:Axis count 6]
[MSG:I2S Steps, Stream]
[MSG:Init Motors]
[MSG:X  Axis Trinamic TMC2130 Step:I2SO(2) Dir:I2SO(1) CS:I2SO(3) Disable:I2SO(0) Index:-1]
[MSG:Y  Axis Trinamic TMC2130 Step:I2SO(5) Dir:I2SO(4) CS:I2SO(6) Disable:I2SO(7) Index:-1]
[MSG:Z  Axis Trinamic TMC2130 Step:I2SO(10) Dir:I2SO(9) CS:I2SO(11) Disable:I2SO(8) Index:-1]
[MSG:A  Axis Trinamic TMC2130 Step:I2SO(13) Dir:I2SO(12) CS:I2SO(14) Disable:I2SO(15) Index:-1]
[MSG:B  Axis Trinamic TMC2130 Step:I2SO(18) Dir:I2SO(17) CS:I2SO(19) Disable:I2SO(16) Index:-1]
[MSG:C  Axis Trinamic TMC2130 Step:I2SO(21) Dir:I2SO(20) CS:I2SO(22) Disable:I2SO(23) Index:-1]
[MSG:X  Trinamic driver test passed]
[MSG:Y  Trinamic driver test passed]
[MSG:Z  Trinamic driver test passed]
[MSG:A  Trinamic driver test passed]
[MSG:B  Trinamic driver test passed]
[MSG:C  Trinamic driver test passed]
[MSG:TMCStepper Library Ver. 0x000701]
[MSG:Relay spindle Output:GPIO(26), Enbl:None, Dir:None]

[MSG:Local access point GRBL_ESP started, 192.168.0.1]
[MSG:Captive Portal Started]
[MSG:HTTP Started]
[MSG:TELNET Started 23]
[MSG:Probe on pin GPIO(25) Inverted:Y]

Grbl 1.3a ['$' for help]
[MSG:'$H'|'$X' to unlock]
$H
ok
ok
$H
ok
ok
g38.2 x10 f50
[PRB:-0.010,0.000,0.000,0.000,0.000,0.000:1]
ok
ok
g0x-3
ok
ok
g38.2 x10 f50
[PRB:-0.020,0.000,0.000,0.000,0.000,0.000:1]
ok
ok
g0x-3
ok
ok
g38.2 x10 f50
[PRB:-0.020,0.000,0.000,0.000,0.000,0.000:1]
ok
ok
g0x-3
ok
ok
g38.2 x10 f50
[PRB:-0.010,0.000,0.000,0.000,0.000,0.000:1]
ok
ok
g0x-3
ok
ok
g38.2 x10 f50
[PRB:-0.010,0.000,0.000,0.000,0.000,0.000:1]
ok
ok
g0x-3
ok
ok
g38.2 x10 f50
[PRB:-0.010,0.000,0.000,0.000,0.000,0.000:1]
ok
ok
g0x-3
ok
ok
g38.2 x10 f50
[PRB:-0.010,0.000,0.000,0.000,0.000,0.000:1]
ok
ok
g0x-3
ok
ok
g38.2 x10 f50
[PRB:-0.010,0.000,0.000,0.000,0.000,0.000:1]
ok
ok

I2S static (always static):

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:9720
ho 0 tail 12 room 4
load:0x40080400,len:6352
entry 0x400806b8

[MSG:Grbl_ESP32 Ver 1.3a Date 20200815]
[MSG:Compiled with ESP32 SDK:v3.2.3-14-gd3e562907]
[MSG:Using machine:ESP32 SPI 6 Axis Driver Board Trinamic Test]
[MSG:Axis count 6]
[MSG:I2S Steps, Static]
[MSG:Init Motors]
[MSG:X  Axis Trinamic TMC2130 Step:I2SO(2) Dir:I2SO(1) CS:I2SO(3) Disable:I2SO(0) Index:-1]
[MSG:Y  Axis Trinamic TMC2130 Step:I2SO(5) Dir:I2SO(4) CS:I2SO(6) Disable:I2SO(7) Index:-1]
[MSG:Z  Axis Trinamic TMC2130 Step:I2SO(10) Dir:I2SO(9) CS:I2SO(11) Disable:I2SO(8) Index:-1]
[MSG:A  Axis Trinamic TMC2130 Step:I2SO(13) Dir:I2SO(12) CS:I2SO(14) Disable:I2SO(15) Index:-1]
[MSG:B  Axis Trinamic TMC2130 Step:I2SO(18) Dir:I2SO(17) CS:I2SO(19) Disable:I2SO(16) Index:-1]
[MSG:C  Axis Trinamic TMC2130 Step:I2SO(21) Dir:I2SO(20) CS:I2SO(22) Disable:I2SO(23) Index:-1]
[MSG:X  Trinamic driver test passed]
[MSG:Y  Trinamic driver test passed]
[MSG:Z  Trinamic driver test passed]
[MSG:A  Trinamic driver test passed]
[MSG:B  Trinamic driver test passed]
[MSG:C  Trinamic driver test passed]
[MSG:TMCStepper Library Ver. 0x000701]
[MSG:Relay spindle Output:GPIO(26), Enbl:None, Dir:None]

[MSG:Local access point GRBL_ESP started, 192.168.0.1]
[MSG:Captive Portal Started]
[MSG:HTTP Started]
[MSG:TELNET Started 23]
[MSG:Probe on pin GPIO(25) Inverted:Y]

Grbl 1.3a ['$' for help]
[MSG:'$H'|'$X' to unlock]
$H
ok
ok
?<Idle|MPos:-3.000,0.000,0.000,0.000,0.000,0.000|FS:0,0|WCO:0.000,0.000,0.000,0.000,0.000,0.000>
g38.2 x10 f50
[PRB:-0.010,0.000,0.000,0.000,0.000,0.000:1]
ok
ok
g0x-3
ok
ok
g38.2 x10 f50
[PRB:-0.010,0.000,0.000,0.000,0.000,0.000:1]
ok
ok
g0x-3
ok
ok
g38.2 x10 f50
[PRB:-0.010,0.000,0.000,0.000,0.000,0.000:1]
ok
ok
g0x-3
ok
ok
?<Idle|MPos:-3.000,0.000,0.000,0.000,0.000,0.000|FS:0,0|Ov:100,100,100>
g38.2 x10 f50
[PRB:-0.010,0.000,0.000,0.000,0.000,0.000:1]
ok
ok

Copy link
Collaborator

@MitchBradley MitchBradley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the long term, we should move to a class structure so we do not need enumerations of stepper types and name lists. But that can wait for another day.

@bdring bdring merged commit 7bc59aa into bdring:Devt Aug 19, 2020
@odaki odaki deleted the dynamic_switching_i2s_modes branch August 19, 2020 23:03
@odaki
Copy link
Contributor Author

odaki commented Sep 20, 2020

A bug found.
Please refer to the PR 608
#608

atlaste pushed a commit to atlaste/Grbl_Esp32 that referenced this pull request Oct 13, 2020
* Dynamically changing the mode of I2S

* Fix invalid step pulse width in I2S static

* More accurate I2S stream stepping

Co-authored-by: bdring <barton.dring@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants