www.photomacrography.net :: View topic - TMC5130A-TA BOB & ARDUINO UNO
www.photomacrography.net Forum Index
An online community dedicated to the practices of photomacrography, close-up and macro photography, and photomicrography.
Photomacrography Front Page Amateurmicrography Front Page
Old Forums/Galleries
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TMC5130A-TA BOB & ARDUINO UNO
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    www.photomacrography.net Forum Index -> Equipment Discussions
View previous topic :: View next topic  
Author Message
mawyatt



Joined: 22 Aug 2013
Posts: 2324
Location: Clearwater

PostPosted: Fri Jun 28, 2019 7:00 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
mawyatt



Joined: 22 Aug 2013
Posts: 2324
Location: Clearwater

PostPosted: Fri Jun 28, 2019 7:32 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Adalbert



Joined: 30 Nov 2015
Posts: 884

PostPosted: Mon Jul 08, 2019 8:02 am    Post subject: Reply with quote

Hello everybody,
The parts needed have been completed.

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 Sad
I only would like to test the BOB and build the system as small as possible.
BR, ADi
Back to top
View user's profile Send private message
mawyatt



Joined: 22 Aug 2013
Posts: 2324
Location: Clearwater

PostPosted: Mon Jul 08, 2019 12:02 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Adalbert



Joined: 30 Nov 2015
Posts: 884

PostPosted: Tue Jul 09, 2019 5:21 am    Post subject: Reply with quote

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/internet-of-moving-things-tmc5130-raspberry-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
Back to top
View user's profile Send private message
mawyatt



Joined: 22 Aug 2013
Posts: 2324
Location: Clearwater

PostPosted: Tue Jul 09, 2019 6:46 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Adalbert



Joined: 30 Nov 2015
Posts: 884

PostPosted: Tue Jul 09, 2019 11:29 am    Post subject: Reply with quote

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

BR, ADi
Back to top
View user's profile Send private message
mawyatt



Joined: 22 Aug 2013
Posts: 2324
Location: Clearwater

PostPosted: Tue Jul 09, 2019 12:51 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Adalbert



Joined: 30 Nov 2015
Posts: 884

PostPosted: Wed Jul 10, 2019 2:18 am    Post subject: Reply with quote

Hello Mike,

Many thanks for your hints!

So, I would change it as follows:


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
Back to top
View user's profile Send private message
mawyatt



Joined: 22 Aug 2013
Posts: 2324
Location: Clearwater

PostPosted: Wed Jul 10, 2019 7:08 am    Post subject: Reply with quote

Adalbert wrote:
Hello Mike,

Many thanks for your hints!

So, I would change it as follows:


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-Adjustable-Variable-Digital-DC-Regulated-Power-Supply-Lab-Grade-TN/163763734153?hash=item2621144689:g:ykIAAOSwAy9dHV15

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,
_________________
Research is like a treasure hunt, you don't know where to look or what you'll find!
~Mike


Last edited by mawyatt on Wed Jul 10, 2019 8:49 am; edited 1 time in total
Back to top
View user's profile Send private message
mawyatt



Joined: 22 Aug 2013
Posts: 2324
Location: Clearwater

PostPosted: Wed Jul 10, 2019 7:39 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Adalbert



Joined: 30 Nov 2015
Posts: 884

PostPosted: Thu Jul 18, 2019 9:07 am    Post subject: Reply with quote

Hello everybody,
Unfortunately UNO doesn’t have enough digital outputs Sad
So only can build the controller in this way:

BTW, I know the problem with the pin0 and 1.
BR, ADi
Back to top
View user's profile Send private message
kaleun96



Joined: 20 Oct 2018
Posts: 157
Location: Stockholm, Sweden

PostPosted: Thu Jul 18, 2019 11:03 am    Post subject: Reply with quote

Adalbert wrote:
Hello everybody,
Unfortunately UNO doesn’t have enough digital outputs Sad

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.

Quote:
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.
Back to top
View user's profile Send private message
elf



Joined: 18 Nov 2007
Posts: 1386

PostPosted: Thu Jul 18, 2019 10:34 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Adalbert



Joined: 30 Nov 2015
Posts: 884

PostPosted: Fri Jul 19, 2019 12:21 am    Post subject: Reply with quote

Hello Kaleun96,
Unfortunately only green marked pins are free Sad
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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    www.photomacrography.net Forum Index -> Equipment Discussions All times are GMT - 7 Hours
Goto page Previous  1, 2, 3, 4  Next
Page 2 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group