TMC5130A-TA BOB & ARDUINO UNO

Have questions about the equipment used for macro- or micro- photography? Post those questions in this forum.

Moderators: rjlittlefield, ChrisR, Chris S., Pau

mawyatt
Posts: 2497
Joined: Thu Aug 22, 2013 6:54 pm
Location: Clearwater, Florida

Post by mawyatt »

ADi,

Yes what was recommended by kaleun96.

BTW you can get the TMC5130 BOB from DigiKey.

Best,
Research is like a treasure hunt, you don't know where to look or what you'll find!
~Mike

mawyatt
Posts: 2497
Joined: Thu Aug 22, 2013 6:54 pm
Location: Clearwater, Florida

Post by mawyatt »

Adi,

What I've tried to do is make the development of the Trinamic based controllers a little easier for folks. With a custom PCB in place, one can focus (pun intended) on developing the code rather than having to debug and worry about the hardware nuances.

Also to provide some basic code for motor/rail/controller testing, stacking and full S&S sessions. With all the Trinamic register details, addresses, drivers, SPI interface in place, and the "hooks" for motor activation, camera and strobe interface in place, one can relatively easily develop custom stacking and S&S code per there own preferences rather than having to adapt to the predefined controller parameters.

However, this is only available for the RPi and not the Arduino.

Anyway, I have custom PCBs available (a few left) for the TMC 5130, 5160, 5161, 5072, 5130 & 5072, and dual 5072, all BOBs. Parts are available as well.

Best,
Research is like a treasure hunt, you don't know where to look or what you'll find!
~Mike

Adalbert
Posts: 2426
Joined: Mon Nov 30, 2015 1:09 pm

Post by Adalbert »

Hello everybody,
The parts needed have been completed.
Image
Now, I would like to test the software but I’m not sure if I can connect the TMC to the Arduino without any capacitor, resistor, etc.
This BOB doesn’t have any radiator, so it seems that it is not ready to be used :-(
I only would like to test the BOB and build the system as small as possible.
BR, ADi

mawyatt
Posts: 2497
Joined: Thu Aug 22, 2013 6:54 pm
Location: Clearwater, Florida

Post by mawyatt »

The BOB boards are designed with a multilayer, usually 4 or more, PCB, unlike many of the cheaper boards which use only 2 layers. If designed properly these extra layers help with chip heat dissipation. If you want a heatsink, then you can get them from eBay. Remember the heat comes for the BOB bottom and top, one reason I raise the BOB in my PCB design.

Be sure a place a large, quality, high frequency decoupling capacitor near the BOB motor supply terminals.

Good luck with your testing.

Best,
Research is like a treasure hunt, you don't know where to look or what you'll find!
~Mike

Adalbert
Posts: 2426
Joined: Mon Nov 30, 2015 1:09 pm

Post by Adalbert »

Hello Mike,
Thank you for the hints!
In the solution with the Raspberry TMC5130 BOB gets the power from the Raspberry ( 3,3V ).
https://blog.trinamic.com/2019/03/29/in ... rry-pi-3b/

So, I could make the same with Arduino 3,3V or 5V ( what is better ?)

The power for the Arduino and motor could be delivered by the same power supply 12V.
But where should be connected the recommended capacitors?
BR, ADi

mawyatt
Posts: 2497
Joined: Thu Aug 22, 2013 6:54 pm
Location: Clearwater, Florida

Post by mawyatt »

I power the TMC5130 BOB Vcc_I/O from a RPi GPIO pin, this is a 3.3V logic pin that can be set to deliver a modest amount of current. This arrangement allows the BOB to be reset from the RPi, and makes the BOB I/O 3.3V compatible.

Also derive RPi 5V power from a DC to DC converter that converts the motor supply VS (anywhere from ~10 to 25 volts) to 5 volts. The setup is arranged to automatically switch between the normal RPi power via USB over to the VS supply and back again. So the design kind of picks whichever supply is present for the RPI and if both are present the normal USB RPi power is used. You could probably do the same with the Arduino, but I don't know which is the better voltage.

As I've mentioned I have no experience with the Arduino, so can't advise on the power, voltage or where the caps for it are required, however since I have experience with the TMC5130 BOB, be sure to use a high quality, low ESR, high frequency, large decoupling cap located as close as possible for the TMC 5130 BOB motor supply pins.

Good luck with your project.

Best,
Research is like a treasure hunt, you don't know where to look or what you'll find!
~Mike

Adalbert
Posts: 2426
Joined: Mon Nov 30, 2015 1:09 pm

Post by Adalbert »

Hello Mike,
Thx, so the final version could see as follows:
Image
BR, ADi

mawyatt
Posts: 2497
Joined: Thu Aug 22, 2013 6:54 pm
Location: Clearwater, Florida

Post by mawyatt »

1st) I would not use the 5 volts for the BOB VCC_IO, this will force you to have to remove power from everything to reset the BOB, very reason I used a configured GPIO pin on the RPi.

2nd) You also should not ground the motor enable DRV_ENN, in this mode you can't disconnect the motor from the H Bridge with software, and the motor will be enabled & engaged as soon as you power up which may create a problem. There are cases where you want to "float" the motor, like long term standstill, or motor removal, and so on, reasons I used a GPIO for this to allow software control.

3rd) I used the precise RPi clock, rather than the internal TMC clock. With the internal TMC clock it can vary significantly over temperature, time and device to device. With the precise RPi clock (15.000MHz) you have a stable, precise time base to work from for current waveform manipulation and control.

4th) Use all the BOB grounds available and use good grounding techniques.

5th) Add additional decoupling to the +12 volt power on the Arduino side. Under motor power recycling the energy is exchanged with the motor VS capacitor (reason you don't want to use a run-of-the-mill cheap capacitor here) and creates ripple.

6th) For code development use a quality lab supply so you can monitor the motor current and voltage and use a current limit. You will likely lock up things and the motor will get shorted between the supply and ground, drawing excessive current. After you've got the code working and things are behaving well you can switch to a quality power supply. Don't use the cheap eBay types with high resistance cables and low output capability, these are almost guaranteed to cause you to replace the BOB!! Especially so with sub-par capacitors!!

I grabbed the wrong power cable and turned on the power strip, the controller glitched at startup, more heavily than normal but everything came up OK, so I continued. Later my code crashed and caused a big supply glitch which locked up the controller with the motor shorted to ground, luckily I caught this right away and unplugged the power supply, NOT THE MOTOR. If I had unplugged the motor I'm sure the BOB would have been fried from the over voltage kick back. I thought I was using the lab supply and not the cheap eBay 12V that I use for the HDMI monitor! Won't make that mistake again!!

If you are using a good stepper with your THK KR20, they are likely 1~3 ohm motors. If you short them from VS to ground...do the math!!! You don't want this to happen and if it does (almost guaranteed it will during code development) you want to know this and gets things shut down orderly ASAP!!

Good luck.

Best,
Research is like a treasure hunt, you don't know where to look or what you'll find!
~Mike

Adalbert
Posts: 2426
Joined: Mon Nov 30, 2015 1:09 pm

Post by Adalbert »

Hello Mike,

Many thanks for your hints!

So, I would change it as follows:
Image

1st) Arduino Uno delivers 3.3V supply generated by on-board voltage regulator. Maximum current draw is 50mA.

2nd) OK, DRV_ENN controlled by Arduino

3rd) OK, CLK16 taken from Arduino (16MHz)

4th) OK, all grounds connected ( what is good grounding techniques ? )

5th) I would like to use only one power supply 12V ( for the motor and for the Arduino )
Do you mean the cap 220uF ?

6th) Which power supply would you recommend? May I use batteries?

BR, ADi

mawyatt
Posts: 2497
Joined: Thu Aug 22, 2013 6:54 pm
Location: Clearwater, Florida

Post by mawyatt »

Adalbert wrote:Hello Mike,

Many thanks for your hints!

So, I would change it as follows:
Image

1st) Arduino Uno delivers 3.3V supply generated by on-board voltage regulator. Maximum current draw is 50mA.

I power the TMC5130 BOB Vcc_I/O from a RPi GPIO pin, this is a 3.3V logic pin that can be set to deliver a modest amount of current. This arrangement allows the BOB to be reset from the RPi, and makes the BOB I/O 3.3V compatible.

1st) I would not use the 5 volts for the BOB VCC_IO, this will force you to have to remove power from everything to reset the BOB, very reason I used a configured GPIO pin on the RPi.

As before and mentioned again above, this is why you don't want to use a fixed supply voltage, 5V or 3.3V, you need to be able to reset the BOB from this pin.

2nd) OK, DRV_ENN controlled by Arduino

3rd) OK, CLK16 taken from Arduino (16MHz)

4th) OK, all grounds connected ( what is good grounding techniques ? )
Short low resistance & inductance connections, limit daisy chaining (ground currents should not loop from one component to next, but flow from main ground to component, use Google for research).

5th) I would like to use only one power supply 12V ( for the motor and for the Arduino )
Do you mean the cap 220uF ?
Yes, or another 470uF.

6th) Which power supply would you recommend? May I use batteries?
Would not recommend batteries as they can deliver very high currents without a settable current limit. You want a proper lab supply with a settable current limit that will indicate an over current condition. A quick look on eBay and you will find many "Lab Supplies", look for something with a minimum of 30 volts and 6 amps, with current limit and Constant Current (this is your Over Current indicator) LEDs. Also look to see if they show the interior circuit boards and wiring, there's a reason if they don't show this!!

Here's a lab supply that seems just OK (this seller has a low rating tho), although I would look for a higher voltage maybe 50~60V.


https://www.ebay.com/itm/30V-10A-Adjust ... SwAy9dHV15

Remember you are using this supply to assist in developing your system, and it must be able to handle the extra voltage and current required, and provide settable limits to help protect your circuits as well as indicate a problem condition. Going cheap here will likely cost you later!!

BR, ADi


Not trying to be critical, only helpful and helping you avoid future frustration and additional cost. Please spend some serious time carefully studying the Trinamic data sheet on the TMC5130 and BOB board. This is a complex chip and you need to understand how it's architected, the interfaces, and the important control parameters otherwise you will be in for a very difficult time trying to develop code and likely cause damage to the chip and/or motors. Also, carefully study the code that Trinamic uses in their demo videos.

Might be worthwhile to study up on these new stepper motor controllers using PWM to control the motor currents and create the sine and cosine waveforms, micro-stepping and why the motor supply circuit parameters are important for proper operation.

Good luck on your project.


Edit: Can the Arduino handle above 12 volts for the supply? If not, you might consider using a DC to DC converter for the Arduino supply like I've done with the RPi based system. This allows you to use various motor supply voltages without being limited by the Arduino supply requirements.

I've found certain motors benefit from a larger supply voltage with the Trinamic controllers. The supply voltage needs to be greater than the maximum PEAK motor current times the {H bridge FET "ON Resistance" times 2, plus the sense resistance, plus coil winding resistance, plus all wiring & connectors resistance times 2 (from chip to motor and back)}, and the inductive L di/dt voltage. Some of the motors I have with higher internal resistance worked better at ~16 volts rather than 12 volts, and some with a higher current & torque at 18~22 volts, this is why I developed the higher current and voltage controllers based upon the TMC5160 and TMC5161.

BTW this is another good reason for using a lab supply, so you can vary the supply voltage and observe how the motor/rail behaves with various control parameters, which is essential for optimizing the motor/rail behavior.

With this in mind 12 volts may not be enough voltage for certain motors and without DC to DC converter for the Arduino you will be required to use 2 supplies.

Best,
Last edited by mawyatt on Wed Jul 10, 2019 8:49 am, edited 1 time in total.
Research is like a treasure hunt, you don't know where to look or what you'll find!
~Mike

mawyatt
Posts: 2497
Joined: Thu Aug 22, 2013 6:54 pm
Location: Clearwater, Florida

Post by mawyatt »

ADi,

This is why I decided to offer the Raspberry Pi custom Trinamic based circuit boards, components, with testing, stacking and automated stack and stitch code available, so folks don't have to tread thru all this detail. I've already done all that and no need for others to have to suffer thru this as I did to utilize the features of these new Trinamic controllers.

All of the details mentioned and many more have been incorporated in the design and circuit boards, as well as the rudimentary testing code and stacking code. It should be relatively easy for folks to move forward from this baseline platform in creating their own customized protocols and setups. However, this is on the Raspberry Pi and not the Arduino. I would have liked to use the Arduino, certainly would have been much easier, but was not sure it would be up to the task for a full S&S System I had envisioned, so selected the RPi.

Best,
Research is like a treasure hunt, you don't know where to look or what you'll find!
~Mike

Adalbert
Posts: 2426
Joined: Mon Nov 30, 2015 1:09 pm

Post by Adalbert »

Hello everybody,
Unfortunately UNO doesn’t have enough digital outputs :-(
So only can build the controller in this way:
Image
BTW, I know the problem with the pin0 and 1.
BR, ADi

kaleun96
Posts: 270
Joined: Sat Oct 20, 2018 3:47 pm
Location: Stockholm, Sweden

Post by kaleun96 »

Adalbert wrote:Hello everybody,
Unfortunately UNO doesn’t have enough digital outputs :-(
You should have enough digital pins, no?

Four (10,11,12,13) for the SPI configuration, 3 for IR diode, relay, and flash, and then many more left over. Unless you haven't shown all components.

I'm not sure about that LCD shield but generally you don't want to wire anything to pins 0 and 1 as they are RX and TX pins required for UART serial interface. If you have anything connected to them you can't program the Arduino via USB, you have to disconnect the components first.

So assuming you use pins 10-13 and three other pins for the flash components, you would still have 5 other digital pins to choose from as well as the analog pins, which can be configured to work as digital pins too.
Can the Arduino handle above 12 volts for the supply?
It can but often not ideal. You can supply 12V via the VIN pin on Arduino boards, an internal regulator drops that down to 5V. But if your Arduino is supplying any current hungry devices via the 5V or 3.3V pins (or across all I/O pins combined), you can easily exceed 500mW people generally recommend for a continuous load.

On my setup, I feed the driver with 12V straight from the wallwart (incl. capacitors) and then have a voltage regulator to output 9V to the Arduino VIN pin. Without a heatsink the regulator gets a bit warm, much more so if I decide to use the 18V wallwart.

elf
Posts: 1416
Joined: Sun Nov 18, 2007 12:10 pm

Post by elf »

I'd recommend a 32bit microprocessor like the Teensy 3.2 or 3.5. They are Arduino compatible, have many more pins, and are quite a bit faster than an Uno.

A touchscreen like a Nextion is a lot more versatile than an lcd and buttons.

Adalbert
Posts: 2426
Joined: Mon Nov 30, 2015 1:09 pm

Post by Adalbert »

Hello Kaleun96,
Unfortunately only green marked pins are free :-(
The remaining digital pins are used by the keypad-shield.
The pin 10 too, so that I have to use pin3 for SS / CSN.
BR, ADi
Last edited by Adalbert on Fri Jul 19, 2019 12:23 am, edited 1 time in total.

Post Reply Previous topicNext topic