MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.3k stars 19.25k forks source link

[BUG] Z2 current independent from Z1 with TMC2208 #13798

Closed sn4k3 closed 5 years ago

sn4k3 commented 5 years ago

Description

After install second Z on E1 with TMC2208 UART, it works, but current is independent from Z1. My test is:

  1. M906 Z10 ; Set to 10mAh
  2. Move Z by 50mm
  3. Touch or light grab Z1 skips step / stop motor but heavy grab Z2 shaft keeps rotating and skip my fingers, also can't rotate it when is holding while Z1 i can easy rotate just by touch with such current. I tried to send M906 I1 Z10 but nothing change. And i tried multiple configurations

My connections are like image below, except UART for E on that picture goes to Z2 driver: image

Board: MKS GEN L Drivers:

#define X_DRIVER_TYPE  TMC2208
#define Y_DRIVER_TYPE  TMC2208
#define Z_DRIVER_TYPE  TMC2208
//#define X2_DRIVER_TYPE TMC2208
//#define Y2_DRIVER_TYPE TMC2208
#define Z2_DRIVER_TYPE TMC2208
#define E0_DRIVER_TYPE LV8729
//#define E1_DRIVER_TYPE TMC2208
//#define E2_DRIVER_TYPE LV8729
//#define E3_DRIVER_TYPE LV8729
//#define E4_DRIVER_TYPE LV8729

Pins:

#define Z_SERIAL_TX_PIN    42
#define Z_SERIAL_RX_PIN    65
#define Z2_SERIAL_TX_PIN   44
#define Z2_SERIAL_RX_PIN   66

#define E0_SERIAL_TX_PIN   44
#define E0_SERIAL_RX_PIN   66
#define E1_SERIAL_TX_PIN   44
#define E1_SERIAL_RX_PIN   66

What i'm doing wrong?

teemuatlut commented 5 years ago

Have you verified you have successful communication with the drivers?

Paste the M906 output after sending a command.

sn4k3 commented 5 years ago

Send: M906 Recv: X driver current: 600 Recv: Y driver current: 600 Recv: Z driver current: 800 Recv: ok

Send: M906 Z10 Recv: ok Send: M906 Recv: X driver current: 600 Recv: Y driver current: 600 Recv: Z driver current: 10 Recv: ok

Send: M122 Recv: X Y Z Recv: Enabled false false false Recv: Set current 600 600 10 Recv: RMS current 1049 1049 55 Recv: MAX current 1479 1479 78 Recv: Run current 18/31 18/31 0/31 Recv: Hold current 9/31 9/31 0/31 Recv: CS actual 0/31 0/31 0/31 Recv: PWM scale 0 0 0 Recv: vsense 0=.325 0=.325 0=.325 Recv: stealthChop false false false Recv: msteps 256 256 256 Recv: tstep 0 0 0 Recv: pwm Recv: threshold 0 0 0 Recv: [mm/s] - - - Recv: OT prewarn false false false Recv: OT prewarn has Recv: been triggered false false false Recv: off time 0 0 0 Recv: blank time 16 16 16 Recv: hysteresis Recv: -end -3 -3 -3 Recv: -start 1 1 1 Recv: Stallguard thrs Recv: DRVSTATUS X Y Z Recv: stst Recv: olb Recv: ola Recv: s2gb Recv: s2ga Recv: otpw Recv: ot Recv: 157C Recv: 150C Recv: 143C Recv: 120C Recv: s2vsa Recv: s2vsb Recv: Driver registers: X = 0x00:00:00:00 Recv: Y = 0x00:00:00:00 Recv: Z = 0x00:00:00:00

Should Z2 show on that debug?

Configuration_adv.zip

teemuatlut commented 5 years ago

You have a connection issue that likely prevents your settings from applying. See the TMC troubleshooting section http://marlinfw.org/docs/hardware/tmc_drivers.html#troubleshooting

sn4k3 commented 5 years ago

You have a connection issue that likely prevents your settings from applying. See the TMC troubleshooting section http://marlinfw.org/docs/hardware/tmc_drivers.html#troubleshooting

Settings apply to all axis, except Z2. I will take a look at the link

teemuatlut commented 5 years ago

Have you enabled Z_DUAL_STEPPER_DRIVERS?

sn4k3 commented 5 years ago

Have you enabled Z_DUAL_STEPPER_DRIVERS?

Yes, i have attached my config files if anyone want take a look. As i said second Z motor works, but current not set equal like primary z

teemuatlut commented 5 years ago

Yes, i have attached my config files if anyone want take a look.

I'm checking now.

As i said second Z motor works, but current not set equal like primary z

TMC2208 has build in defaults that allow it to "work" even if you can't connect to it.

teemuatlut commented 5 years ago

I assume you're using 1.1.9? Try either one of the bugfix branches.

sn4k3 commented 5 years ago

I tried now to exchange cable, I move the jumpers 42/65 from Z1 to 44/66 pins, send M906 Z10, it still apply in debug but motor current not set, so not a cable problem nor driver, it look likes it's ignoring something... As i understand when you use Dual Motor and send X, Y or Z current marlin apply to both Z1 and Z2 motor without the need set current for 1 and 2 individual right?

I assume you're using 1.1.9? Try either one of the bugfix branches.

Yes' im using lastest release. I will look at branches and search for bugfixes or related notes

wesk-ms commented 5 years ago

@teemuatlut if it helps, I can repro this issue with TMC5160s connected over SPI. I'm using bugfix-2.0.x that I downloaded and built yesterday. M122 output shows a connection to all Trinamic drivers with no unexpected register values.

M906 Z2500 Z22500 results in only Z being set to 2.5A.

M906 Z2500 results in only Z being set to 2.5A.

The printer prints fine and both Z motors work correctly, just can't set the current on Z2 from the console.

teemuatlut commented 5 years ago

See the syntax for controlling secondary drivers on an axis. http://marlinfw.org/docs/gcode/M906.html

sn4k3 commented 5 years ago

@teemuatlut if it helps, I can repro this issue with TMC5160s connected over SPI. I'm using bugfix-2.0.x that I downloaded and built yesterday. M122 output shows a connection to all Trinamic drivers with no unexpected register values.

M906 Z2500 Z22500 results in only Z being set to 2.5A.

M906 Z2500 results in only Z being set to 2.5A.

The printer prints fine and both Z motors work correctly, just can't set the current on Z2 from the console.

Can you try with M906 I1 Z10 ? Mine doesn't work either Also does Z2 shows on console?

sn4k3 commented 5 years ago

After use bugfix2.0 it start work as expected

teemuatlut commented 5 years ago

Please always remember to close the issue when a successful solution has been found =)

github-actions[bot] commented 4 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.