janelia-arduino / TMC2209

The TMC2209 is an ultra-silent motor driver IC for two phase stepper motors with both UART serial and step and direction interfaces.
Other
186 stars 30 forks source link

Arduino Due - examples don’t work #51

Open Sommjo11 opened 10 months ago

Sommjo11 commented 10 months ago

After loading TestCommunication on Arduino Due the script does not compile.

SoftwareSerial.h missing.

if I modify the .h file at line 13 to force SOFTWARE_SERIAL_IMPLEMENTED to false the software compiles but nothing is printed to screen.

The processor hangs during setup.

Any tips on how to workaround would be much appreciated .

peterpolidoro commented 10 months ago

Interesting. I will add Arduino Due to the list of boards that do not have Software Serial.

Have you tried any other examples? I am seeing some warnings about "constrain" when I use an older Arduino IDE, but I do not know if that could cause the processor to hang up. Which version of the IDE are you using?

peterpolidoro commented 10 months ago

I created a new version, 9.0.9, which adds Arduino Due to the list of boards without Software Serial and I also created a function to replace constrain to fix compiler warnings. These changes will probably not fix your issue, but can you try the new version and see what happens with several examples? Thanks!

Sommjo11 commented 10 months ago

Thanks. Will do so soon.Joseph On Jan 9, 2024, at 4:22 PM, Peter Polidoro @.***> wrote: I created a new version, 9.0.9, which adds Arduino Due to the list of boards without Software Serial and I also created a function to replace constrain to fix compiler warnings. These changes will probably not fix your issue, but can you try the new version and see what happens with several examples? Thanks!

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

Schweyher commented 4 months ago

Hello Peter,

I am trying to set up TMC2209 on Arduino DUE. Therefore I have chosen Bidirectional Communication examples and found that the Arduino DUE freezes after: stepper_driver.setup(serial_stream); is put into the code - control LED is not blinking, Serial Monitor has no communication. I have also tried the other setup examples, which do not work.

Is there any solution to run multiple TMC2209 on the Arduino DUE hardware?

Kind Regards Holger Schweyher

peterpolidoro commented 4 months ago

I have never tried an Arduino DUE, but I do not know of any reason why it should not work. It has multiple UART outputs so you should be able to easily run multiple TMC2209 chips.

How do you have it wired? Which TMC2209 board are you using? Can you send an example of the code you are testing?

Schweyher @.***> writes:

Hello Peter,

I am trying to set up TMC2209 on Arduino DUE. Therefore I have chosen Bidirectional Communication examples and found that the Arduino DUE freezes after: stepper_driver.setup(serial_stream); is put into the code - control LED is not blinking, Serial Monitor has no communication. I have also tried the other setup examples, which do not work.

Is there any solution to run multiple TMC2209 on the Arduino DUE hardware?

Kind Regards Holger Schweyher

Schweyher commented 4 months ago

Hello Peter,

I am using: 3D Printer Accessories TMC2209 V4.0 Quiet Stepping Motor Driver 5.5-28V, purchased on Ebay. The Arduino Due was in my stock and could be of Chinese origin. The wiring is okay, I think the problem is in the UART communication during setup.

I have put a LED blinking command and text into the code to check the functionality visually and in the Serial Monitor. It works until the command: stepper_driver.setup(serial_stream); is put into the code, thereafter the LED stays on and no message on the Serial Monitor.

Can you recommend another TMC2209 breakout board, which usually works?

Kind Regards Holger Schweyher

peterpolidoro commented 4 months ago

There may be some issue with the Due. Do you have another board you can try like a Teensy or Raspberry Pi Pico? There are several TMC2209 breakout boards. I do not know how big your motor is, but the SilentStepStick may work for you.

ThorsAvenger commented 3 months ago

I have a Due as well, and have the same issues. I think the problem lies within the constructor for the Serial object. The controller freezes during setup if you try to pass the HardwareSerial &Serial object, but it will continue if you create the serial object first using Serial.begin(BAUD_RATE); and then pas the Serial object in the setup. (In my case I use Serial1)

Then the driver will communicate, but won't be able to properly setup. getSettings() gives back 1 on communication but 0 on setup. Hope this sheds some light on the situation, I don't really know how to fix it from here...