Giter Club home page Giter Club logo

Comments (7)

StBe121 avatar StBe121 commented on June 8, 2024 1

Thanks a lot for your time there were different fault yesterday I was able to recreate them
TMC2209: did not get the expected 4 data bytes. Instead got 0 Bytes
TMC2209: did not get the expected 4 data bytes. Instead got 0 Bytes
TMC2209: did not get the expected 4 data bytes. Instead got 0 Bytes
TMC2209: did not get the expected 4 data bytes. Instead got 0 Bytes
TMC2209: did not get the expected 4 data bytes. Instead got 0 Bytes
TMC2209: did not get the expected 4 data bytes. Instead got 0 Bytes
TMC2209: did not get the expected 4 data bytes. Instead got 0 Bytes
TMC2209: did not get the expected 4 data bytes. Instead got 0 Bytes
TMC2209: did not get the expected 4 data bytes. Instead got 0 Bytes
TMC2209: did not get the expected 4 data bytes. Instead got 0 Bytes
TMC2209: after 10 tries not valid answer. exiting
TMC2209: is Stepper Powersupply switched on ?
I think my old breadboard is worn out, I just touhced one wire and it happend again.
As I said thanks for your support and for the lib it helps a lot also the documentations makes it easier to work with. Maybe I misinterpreted the print statements from today. Reread it again and yes I didnt understood them.

I think the 5-6 steppers are for the ESP32 the RPI was only to test it in generell. Should be able to use a secound of the UARTs if the adress exceeds 3. the other lib from you and kjk25 uses at the moment hardcoded UART 2 right?

from tmc2209_raspberry_pi.

Chr157i4n avatar Chr157i4n commented on June 8, 2024

Hello,

yes, the library should also work with other TMC2209 boards like yours.

Could you please share some more information?

Do you have the SilentStepStick TMC2209 v2?
https://github.com/watterott/SilentStepStick/blob/master/hardware/SilentStepStick-TMC2209_v20.pdf

What is the output of the demo/debug_script_01_uart_connection.py script?

Can you please share a sketch or photo of your wiring.

from tmc2209_raspberry_pi.

StBe121 avatar StBe121 commented on June 8, 2024

Thanks for the reply
the output the script is

---
SCRIPT START
---
TMC2209 0: Init
TMC2209 0: GPIO Init finished
TMC2209 0: Init finished
---
---
TMC2209 0: ---
TMC2209 0: TEST UART
TMC2209 0: received 12 bytes; 96 bits
TMC2209 0: hex: 550006e805ff0621000041c6
TMC2209 0: bin: 010101010000000000000110111010000000010111111111000001100010000100000000000000000100000111000110
TMC2209 0: length snd: 4
TMC2209 0: length rtn: 12
TMC2209 0: the Raspberry Pi received the sended
                            bits and the answer from the TMC
TMC2209 0: the Raspberry Pi received exactly the bits it has send.
                    the first 4 bits are the same
TMC2209 0: complete
TMC2209 0: 550006e8
TMC2209 0: 550006e805ff0621000041c6
TMC2209 0: just the first 4 bits
TMC2209 0: 550006e8
TMC2209 0: 550006e8
TMC2209 0: ---
---
---
TMC2209 0: Deinit
TMC2209 0: Motor output active: False
TMC2209 0: GPIO cleanup
TMC2209 0: Deinit finished
---
SCRIPT FINISHED
---

Yes i can confirm that that is the right stepper modul.
I soldered the jumper pads together and checked the connection by resistence
The only two requirements for the UART connection that I found was the solder connection to at least 2 of the pads(see picture) and an 1k resistor in TX wire

Another qustion where can I set which UART channel the PI is using I would need to use 5-6 stepper and I want to use sensorless homing on all of them
IMG_0335
IMG_0338
IMG_0339
TMC solder Uart

from tmc2209_raspberry_pi.

StBe121 avatar StBe121 commented on June 8, 2024

Ok made some more tests the output from the answer above is done without the external powersupply(PC power supply with 12/5/3.3V) as soon as its activ I get no connection
th eoutput from your debuggfile is

---
SCRIPT START
---
TMC2209 0: Init
TMC2209 0: GPIO Init finished
TMC2209 0: Init finished
---
---
TMC2209 0: ---
TMC2209 0: TEST UART
TMC2209 0: received 12 bytes; 96 bits
TMC2209 0: hex: 550006e805ff0621000041c6
TMC2209 0: bin: 010101010000000000000110111010000000010111111111000001100010000100000000000000000100000111000110
TMC2209 0: length snd: 4
TMC2209 0: length rtn: 12
TMC2209 0: the Raspberry Pi received the sended
                            bits and the answer from the TMC
TMC2209 0: the Raspberry Pi received exactly the bits it has send.
                    the first 4 bits are the same
TMC2209 0: complete
TMC2209 0: 550006e8
TMC2209 0: 550006e805ff0621000041c6
TMC2209 0: just the first 4 bits
TMC2209 0: 550006e8
TMC2209 0: 550006e8
TMC2209 0: ---
---
---
TMC2209 0: Deinit
TMC2209 0: Motor output active: False
TMC2209 0: GPIO cleanup
TMC2209 0: Deinit finished
---
SCRIPT FINISHED
---

thats a little weird at least for me all devices share a common ground

from tmc2209_raspberry_pi.

Chr157i4n avatar Chr157i4n commented on June 8, 2024

Regarding your connection problem

I dont understand what exactly you mean with "cannot get a working connection", because in both cases your script output show the correct answer from the TMC (4 send + 8 received bytes = total 12 bytes) and the connection seems to work correctly.
TMC2209 0: received 12 bytes; 96 bits

what exactly does your power supply work in both cases? Normally you dont need the Vio Voltage, because the drivers should have internal voltage regulator, but i am not sure whether this is the case for every TMC2209 board.

Connecting 5-6 drivers via UART

connecting up to 5-6 drivers via UART to use StallGuard on each motor is tricky, because the addressing on one UART line support only 4 drivers:
grafik

As you can use the DIAG pin on the TMC as StallGuard Output, you could connect the DIAG of each driver to different pins of the RPi/ESP and use the "write only access" configuration:
grafik

If you want to have write and read access on each driver individually, you either need to use different UART port (for example SoftwareSerial on the ESP, on the RPi this is a bit harder and i have not tried that)
Or you use analog switches for the UART connection:
grafik

from tmc2209_raspberry_pi.

Chr157i4n avatar Chr157i4n commented on June 8, 2024

Thank you very much. I try to improve the documentation with every feedback i get.

TMC2209: did not get the expected 4 data bytes. Instead got 0 Bytes
If you get 0 bytes, there is a problem with your wiring.
Because of the shared RX and TX line, the RPi/ESP should always at least receive the 4 bytes it has send to the TMC.

On the RPi you can set the SerialPort in the constructor with serialport="/dev/serial0"

On the ESP it seems you can use serialport=2 in the constructor of kjk25 lib.

from tmc2209_raspberry_pi.

Chr157i4n avatar Chr157i4n commented on June 8, 2024

I will close this issue now. If you still have questions feel free to reopen this issue or open a new one.

from tmc2209_raspberry_pi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.