Jump to content

StrideMax Dual FD v2 - TMC SPI errors


Methos

Recommended Posts

Hi All

I have a couple of StrideMax Dual FD v2, but they always get an error "Unable to write TMC spi 'stepper_y' register GLOBALSCALER"

I've tried steps using information from

https://github.com/FYSETC/Stridemax_Dual_FD

https://github.com/emebecnc/3DPrintingTutorials/tree/main/StrideMax Dual FD v2 USB %26 CanBUS Mode

The issues in the first link mention SPI pin issues from the non-released units; the change was made to allow hardware SPI for RRP firmware.

I've cut and pasted the examples, re-typed them, swapped SPI pins, and tried hardware SPI. The example image has hardware spi configured.

Does anyone have experience with these units and know what I should try next?

Not getting any help from FYSETC.

Cheers

Screenshot 2025-01-27 at 8.25.18 AM.png

Screenshot 2025-01-27 at 8.23.29 AM.png

Link to comment
Share on other sites

Make sure that you have all the power supplies to the board. I had the same issue with my VzBot. I had wired the 48v to the the TMC5160s, but I had not wired the High driver power on the board (not the same board as yours).

Link to comment
Share on other sites

  • 1 month later...
1 minute ago, Michel said:

Did you end up finding a solution? I have the same issue now and nobody seems to have this board. 

No, I did not. I've given up and trying to arrange a refund via Aliexpress.

Link to comment
Share on other sites

What a pity, the board is awesome on paper. I’ll try to get help on their discord, maybe it’s just wrong motor wiring which is the only thing I didn’t try to change yet. Took so much to even get to this point, I am not giving up yet 🤞🏼

Link to comment
Share on other sites

1 hour ago, Methos said:

The wrong wiring would not give an SPI error, If you call INIT_TMC do you get an error?

I haven’t tried to run INIT_TMC manually yet but I see the below error for both drivers in the klippy log after Klipper start and any attempted move command results in immediate Klipper shutdown.

Unable to write TMC spi 'stepper_y' register GLOBALSCALER

I agree, SPI should work with and without correct motor wiring and I am actually pretty certain I have them correctly wired but I am out of ideas otherwise.
In my head, SPI control just got a big red flag for any future hardware running Klipper. 

When not defining the TMC sections at all, nothing happens. No Klipper crash but also no movement.

found the fystec discord channel, he refers to the video when you asked for help, he implied that you need to have the motors installed for proper SPI init and refers to the video where wiring isn’t a topic at all 🥱

 

Edited by Michel
Link to comment
Share on other sites

28 minutes ago, Wesley said:

I was searching for info on the Stridemax and found this topic, it didn't contain the info i was searching for so i continued searching and found the following.

https://github.com/FYSETC/Stridemax_Dual_FD/issues/2

Maybe this is your solution?

I was hopeful when seeing the topic but no, unfortunately my pins are set correctly and flipping the config didn’t do anything. Thanks for the link tho. I have literally read every piece of info, bug report or discussion on public internet that is related to the board, TMC 5160, Klipper SPI issues etc.

I am pretty certain that there’s a simple solution to this unless the board is broken

Link to comment
Share on other sites

Too bad it wasn't this simple solution, it did generate a similar error though. Good luck on your journey, i hope you'll find a solution to the problem soon or get a replacement if it is a faulty board.

Link to comment
Share on other sites

29 minutes ago, Wesley said:

Too bad it wasn't this simple solution, it did generate a similar error though. Good luck on your journey, i hope you'll find a solution to the problem soon or get a replacement if it is a faulty board.

Thanks. I'll keep updating this thread with thoughts and findings I have, just in case somebody else has the same problem in the future, hopefully this will lead to a solution 🙂

One thing that makes me wonder, DUMP_TMC will report lots of errors that would point at motor wiring issues in my opinion, I've so far ignored them believing they're probably just random bits set because SPI doesn't work properly. The list of errors also isn't consistent through restarts and current values are completely wrong also.

The board seems to be primarily designed to work in the Duet3D sphere with RepRap firmware and klipper was an afterthought. That said, RRF uses hardware SPI
Might try hardware SPI in klipper


DUMP_TMC stepper_y
========== Write-only registers ==========
GLOBALSCALER: 0000006f globalscaler=111
IHOLD_IRUN: 00061f0f ihold=15 irun=31 iholddelay=6
MSLUT0:     aaaab554 mslut0=2863314260
MSLUT1:     4a9554aa mslut1=1251300522
MSLUT2:     24492929 mslut2=608774441
MSLUT3:     10104222 mslut3=269500962
MSLUT4:     fbffffff mslut4=4227858431
MSLUT5:     b5bb777d mslut5=3048961917
MSLUT6:     49295556 mslut6=1227445590
MSLUT7:     00404222 mslut7=4211234
MSLUTSEL:   ffff8056 w0=2 w1=1 w2=1 w3=1 x1=128 x2=255 x3=255
MSLUTSTART: 00f70000 start_sin90=247
TPWMTHRS:   000fffff tpwmthrs=1048575
TCOOLTHRS:  00000000
THIGH:      00000000
COOLCONF:   00000000
DRV_CONF:   00000400 bbmclks=4
PWMCONF:    c40c001e pwm_ofs=30 pwm_autoscale=1 pwm_autograd=1 pwm_reg=4 pwm_lim=12
TPOWERDOWN: 0000000a tpowerdown=10
========== Queried registers ==========
GCONF:      00000000
CHOPCONF:   000002f0 hstrt=7 hend=5 mres=0(256usteps)
GSTAT:      007c0000
DRV_STATUS: 1b000000 cs_actual=0(Reset?) stallguard=1 ot=1(OvertempError!) s2ga=1(ShortToGND_A!) s2gb=1(ShortToGND_B!)
FACTORY_CONF: 00000000
IOIN:       00000000 version=0x0
LOST_STEPS: 00480000 lost_steps=524288
MSCNT:      a0000000
MSCURACT:   00007e80 cur_a=128
OTP_READ:   00000003 otp_fclktrim=3
PWM_SCALE:  00c10000 pwm_scale_auto=193
PWM_AUTO:   00060000 pwm_grad_auto=6
TSTEP:      10000000

Link to comment
Share on other sites

Good news: I've solved the riddle. The board isn't burned. Fystec, please make better guides, that was a horrible user experience

Obstacles I had following the Fystec "Instructions"

1. Flashing katapult via DFU mode

I had a bad USB cable which failed to connect to the board, this was the reason it never showed up in the usb device list (lsusb)
If you have trouble connecting to the board, make sure your USB cable is good. I ended up connecting it to my MacBook and it shows up as removable mass storage which you can copy the katapult file into.

2. Building Klipper for flashing via katapult

The guide had a wrong setting for the bootloader offset, katapult wasn't able to start klipper
Nothing happened until rapid doubleclick of the reset button, then canboot shows up in the list of devices on the can bus.
The correct setting for Klipper (make menuconfig) is 16KB offset for bootloader

3. Motor wiring

Since this is the first time I've cut a motor wire, I had a hard time understanding how to write the motors correctly.
It's actually quite simple - cut the wire and use a multimeter in lowest Ohm mode to measure coil pairs. When you measure less than infinite e.g. 1.8 (varies depending on the motor), you have the leads for one coil which go together into a pair on the connector

4. SPI configuration

The SPI config from the github repo didn't work for me (see errors in the thread above)
Thankfully, I had the idea to try hardware SPI, which this board is designed for in the first place. Software SPI emulates the bus behaviour in software and "hammers" the bits into the GPIO ports, this is more flexible but apparently, in my case at least, doesnt work always 😄

What works for me, make sure to remove any software_spi options

[tmc5160 stepper_x]
spi_bus: spi0_gpio4_gpio3_gpio2
cs_pin: stridemax_dual: gpio21
diag1_pin: stridemax_dual: gpio14    # optional, to be honest, I don't know yet what this can be used for

# that's tmc5160 specific
sense_resistor: 0.05

# depends on motor and requirements
interpolate: true
run_current: 2
hold_current: 1

[tmc5160 stepper_y]
spi_bus: spi0_gpio4_gpio3_gpio2
cs_pin: stridemax_dual: gpio1
diag1_pin: stridemax_dual: gpio14    # optional

# that's tmc5160 specific
sense_resistor: 0.05

# depends on motor and requirements
interpolate: true
run_current: 2
hold_current: 1

 

  • Like 1
Link to comment
Share on other sites

Posted (edited)

I'm not going to claim you are wrong, as you have yours working, but here is my file with the different settings I tried, including the hardware settings I found by reading the newer Klipper source.
 

[tmc5160 stepper_x]
spi_software_sclk_pin: stridemax_dual:gpio2
spi_software_mosi_pin: stridemax_dual:gpio3
spi_software_miso_pin: stridemax_dual:gpio4
#spi_bus: spi0_gpio4_gpio3_gpio2
cs_pin: stridemax_dual:gpio21
interpolate: False
run_current: 1.0
hold_current: 0.500
##stealthchop_threshold: 0
sense_resistor: 0.05


[tmc5160 stepper_y] 
## Soft SPI
spi_software_sclk_pin: stridemax_dual:gpio2
spi_software_mosi_pin: stridemax_dual:gpio3
spi_software_miso_pin: stridemax_dual:gpio4
#spi_bus: spi0_gpio4_gpio3_gpio2
cs_pin: stridemax_dual:gpio1
interpolate: False 
run_current: 1.0
hold_current: 0.5
##stealthchop_threshold: 0
sense_resistor: 0.05

So maybe I'll try again, and see.

Could you try the init tmc without the stepper wires connected? I was wondering if that could have been my issue.


 

Edited by Methos
Link to comment
Share on other sites

1 hour ago, Methos said:

I'm not going to claim you are wrong, as you have yours working, but here is my file with the different settings I tried, including the hardware settings I found by reading the newer Klipper source.
 

[tmc5160 stepper_x]
spi_software_sclk_pin: stridemax_dual:gpio2
spi_software_mosi_pin: stridemax_dual:gpio3
spi_software_miso_pin: stridemax_dual:gpio4
#spi_bus: spi0_gpio4_gpio3_gpio2
cs_pin: stridemax_dual:gpio21
interpolate: False
run_current: 1.0
hold_current: 0.500
##stealthchop_threshold: 0
sense_resistor: 0.05


[tmc5160 stepper_y] 
## Soft SPI
spi_software_sclk_pin: stridemax_dual:gpio2
spi_software_mosi_pin: stridemax_dual:gpio3
spi_software_miso_pin: stridemax_dual:gpio4
#spi_bus: spi0_gpio4_gpio3_gpio2
cs_pin: stridemax_dual:gpio1
interpolate: False 
run_current: 1.0
hold_current: 0.5
##stealthchop_threshold: 0
sense_resistor: 0.05

So maybe I'll try again, and see.

Could you try the init tmc without the stepper wires connected? I was wondering if that could have been my issue.


 

yes, your commented spi_bus config actually got me into investigating hardware SPI
can confirm, TMC_INIT works with both motors unplugged, klipper also starts just fine with TMC autotune active

That's the dump with both motors unplugged, the only thing I am a bit surprised to see is the undervoltage flag - I'm feeding 48V and it actually measures 48.4V through the ADC.

DUMP_TMC stepper_x (unplugged stepper motor)
========== Write-only registers ==========
GLOBALSCALER: 0000006f globalscaler=111
IHOLD_IRUN: 000c1f0f ihold=15 irun=31 iholddelay=12
MSLUT0:     aaaab554 mslut0=2863314260
MSLUT1:     4a9554aa mslut1=1251300522
MSLUT2:     24492929 mslut2=608774441
MSLUT3:     10104222 mslut3=269500962
MSLUT4:     fbffffff mslut4=4227858431
MSLUT5:     b5bb777d mslut5=3048961917
MSLUT6:     49295556 mslut6=1227445590
MSLUT7:     00404222 mslut7=4211234
MSLUTSEL:   ffff8056 w0=2 w1=1 w2=1 w3=1 x1=128 x2=255 x3=255
MSLUTSTART: 00f70000 start_sin90=247
TPWMTHRS:   000fffff tpwmthrs=1048575
TCOOLTHRS:  00000139 tcoolthrs=313
THIGH:      0000001d thigh=29
COOLCONF:   0001c462 semin=2 seup=3 semax=4 sedn=2 seimin=1 sgt=1
DRV_CONF:   00000400 bbmclks=4
PWMCONF:    4f0e0513 pwm_ofs=19 pwm_grad=5 pwm_freq=2 pwm_autoscale=1 pwm_autograd=1 pwm_reg=15 pwm_lim=4
TPOWERDOWN: 0000000a tpowerdown=10
========== Queried registers ==========
GCONF:      00000008 multistep_filt=1
CHOPCONF:   341083f1 toff=1 hstrt=7 hend=7 tbl=1 tpfd=1 mres=4(16usteps) intpol=1 dedge=1
GSTAT:      00000005 reset=1(Reset) uv_cp=1(Undervoltage!)
DRV_STATUS: 800f0000 cs_actual=15 stst=1
FACTORY_CONF: 0000000f factory_conf=15
IOIN:       30000050 drv_enn=1 sd_mode=1 version=0x30
LOST_STEPS: 00000000
MSCNT:      00000008 mscnt=8
MSCURACT:   00f7000c cur_a=12 cur_b=247
OTP_READ:   0000000f otp_fclktrim=15
PWM_SCALE:  0000000e pwm_scale_sum=14
PWM_AUTO:   0005001d pwm_ofs_auto=29 pwm_grad_auto=5
TSTEP:      000fffff tstep=1048575

DUMP_TMC stepper_y
========== Write-only registers ==========
GLOBALSCALER: 00000059 globalscaler=89
IHOLD_IRUN: 000c1f09 ihold=9 irun=31 iholddelay=12
MSLUT0:     aaaab554 mslut0=2863314260
MSLUT1:     4a9554aa mslut1=1251300522
MSLUT2:     24492929 mslut2=608774441
MSLUT3:     10104222 mslut3=269500962
MSLUT4:     fbffffff mslut4=4227858431
MSLUT5:     b5bb777d mslut5=3048961917
MSLUT6:     49295556 mslut6=1227445590
MSLUT7:     00404222 mslut7=4211234
MSLUTSEL:   ffff8056 w0=2 w1=1 w2=1 w3=1 x1=128 x2=255 x3=255
MSLUTSTART: 00f70000 start_sin90=247
TPWMTHRS:   000fffff tpwmthrs=1048575
TCOOLTHRS:  00000139 tcoolthrs=313
THIGH:      0000001c thigh=28
COOLCONF:   0001c462 semin=2 seup=3 semax=4 sedn=2 seimin=1 sgt=1
DRV_CONF:   00000400 bbmclks=4
PWMCONF:    4f0e050f pwm_ofs=15 pwm_grad=5 pwm_freq=2 pwm_autoscale=1 pwm_autograd=1 pwm_reg=15 pwm_lim=4
TPOWERDOWN: 0000000a tpowerdown=10
========== Queried registers ==========
GCONF:      00000008 multistep_filt=1
CHOPCONF:   341084f1 toff=1 hstrt=7 hend=9 tbl=1 tpfd=1 mres=4(16usteps) intpol=1 dedge=1
GSTAT:      00000005 reset=1(Reset) uv_cp=1(Undervoltage!)
DRV_STATUS: 80090000 cs_actual=9 stst=1
FACTORY_CONF: 0000000f factory_conf=15
IOIN:       30000050 drv_enn=1 sd_mode=1 version=0x30
LOST_STEPS: 00000000
MSCNT:      00000008 mscnt=8
MSCURACT:   00f7000c cur_a=12 cur_b=247
OTP_READ:   0000000f otp_fclktrim=15
PWM_SCALE:  00000009 pwm_scale_sum=9
PWM_AUTO:   0005001d pwm_ofs_auto=29 pwm_grad_auto=5
TSTEP:      000fffff tstep=1048575

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...