Trinamic TMC2300-IOT-REF Stepper Driver + Motor - Review

Table of contents

RoadTest: Trinamic TMC2300-IOT-REF Stepper Driver + Motor

Author: navadeepganeshu

Creation date:

Evaluation Type: Development Boards & Tools

Did you receive all parts the manufacturer stated would be included in the package?: True

What other parts do you consider comparable to this product?: DRV8825 by Texas Instruments, A4998 Pololu stepper drivers, TMC2208 by Trinamic.

What were the biggest problems encountered?: Motor connector pin mismatch with board connector(resolution provided, thanks), Irregularity in the power supply circuitry of the board letting it to overheat.

Detailed Review:

From the RoadTest posting, Trinamic TMC2300-IoT-REF Stepper Driver + Motor looked excellent making it ideal for electromechanical remote control applications. With an interest in evaluating its features and building a disco lamp project, I applied for this RoadTest and here I am presenting those. Before applying for the hardware, I went through the documents put up regarding the TMC2300 and was verbose and very informative. All of the technologies utilised in TMC2300 are well explained with block diagrams, waveforms and were very interesting. Hence I thought it's a good opportunity to learn and get hands-on to work on some cool motor on...off....on....off...stuff.

 

1] What? Why? Where?

 

TMC2300 is a low voltage driver for upto 2-phase stepper motors with a maximum of 1.2A RMS, StealthChop technology for quiet movement, StallGuard sensorless homing, CoolStep energy saving and all comes with a UART interface option.

imageimage

This is TMC2300-IoT-REF, an ESP32-PICO-D4 based IoT enabled board with WiFi and Bluetooth capabilities for evaluating the TMC2300 driver IC and is best suitable for IoT and Handheld devices, Battery operated equipment, Toys, Home Automation or infact any battery-powered electromechanical IoT applications!

 

The EVAL Kit comes with:

• Stepper motor connector - a 4-pin connector that connects the TMC2300 motor driver outputs to the motor phases.

• USB-C Connector - for programming the microcontroller and charging the battery.

• 2 Pin battery connector - for an external battery to power the TMC2300 chip.

• 4 pin and 10 pin headers - for GPIOs.

 

 

2] First Look!

 

The package reached me tip-top and well enclosed. Was good to see a USB-C cable included in it. Here are some pictures just out of the box and after being powered up. Somehow, the motor connectors in the board did not match with a given motor and so I soldered a female header set onto the board. Modified the battery connector too as I didn't have a matching one.

 

 

{gallery}

image

image

image

image

(the board connectors are modified for coupling and are not as in the new package)

 

3] Concepts and Specs

 

image

Stepper motors rotate their shaft in steps, that is, by moving in a fixed amount of degrees. This is obtained by the internal configuration of the motor and sequence of firing the coils to magnetize/demagnetize enabling precise sensorless operation of this motor. The below image shows different positions in the driving mode based on the direction of flow of current and also, a motor can be driven in many modes like half-stepping, full-stepping, wave-mode, micro-stepping etc based on the application and driver unit employed.

image

 

This is a block diagram of TMC2300-IOT-REF Kit with the external motor, PC interface using USB-C, external battery for driving the TMC2300 chip and inturn the stepper motor. The ESP32 Pico is the ultimate IoT enabler with BLE and WiFi interfacing features. Starting from the left, PC communicates with the board through a USB interface via a CH340C serial convertor chip availing linkage with an onboard ESP32 PICO microcontroller. Hence, firmware can directly be flashed to the microcontroller.

 

TMC2300 uses a single-wire UART interface with the microcontroller for advanced configuration options. The steps and direction of the motor are directly controlled from the microcontroller through  STEP and DIR pins at its GPIOs IO21 and IO22 respectively. This is how the TMC2300-IOT-REF enables remote controlling operation via inbuilt WiFi and BLE features of ESP32 PICO by taking rights over STEP and DIR. The motor is wired with a 4-pin interface namely A1, A2, B1, B2 coming out of the TMC2300 driver chip and a dedicated connector is available onboard.

 

StealthChop2™ for silent motor operation, StallGuard4™ for stall detection and CoolStep™ for smart current control are TMC2300's highlighted features of TMC2300 and can be lively monitored with debugger board and GUI (not included here) had worked on one of these in his earlier RoadTest and here is his nice report on CoolStep.

 

 

4] Getting Started

 

Getting up and running with TMC2300-IOT-REF is quite easy with the hardware manual and GitHub page by Trinamic. I had faced some overheating issues with the charger IC, unrecognised USB COM port etc and I will discuss more of these while testing.

 

All needed to get started is the TMC2300-IOT-REF module, any stepper motor with a 4-pin JST-PH connector(rated value) and a USB-C cable to interface with the PC. Thanks that all of them came with the RodTest kit. Oh, an additional Li-Ion battery is also needed without which the motor cannot be driven.

 

Some of the precautions mentioned in the manual are that do not exceed the maximum rated supply voltage(standard 5V USB and 3.7V Li-Ion) and not to use other battery types than Li-Ion with the board. It is also advised to start with the power supply off(i think this is only while flashing firmware to the board)

 

imageimage

 

First thing first, I tried the onboard LED blink and it all worked fine. This functionality has nothing to do with the TMC2300 IC and its all with ESP32's GPIO toggling. Hence there is no necessity to plug in a Li-Ion battery, yet plugging the battery once the firmware is loaded would also make the LED blink.

 

image

 

Below is the full code compiled for ESP32 PICO and loaded for blinking LED with a 1000ms interval.

 

/*Program to blink onboard LED18 in TMC2300-IOT-REF */

#define LED_STATUS 18                 // IO pin18 is connected to onboard LED
  
// the setup function runs once when you press reset or power the board  
void setup() 
{  
// initialize digital pin LED_STATUS as an output.  
  pinMode(LED_STATUS, OUTPUT);  
}   
  
// this loop function runs over and over again forever  
void loop() 
{  
  digitalWrite(LED_STATUS, HIGH);    // turn the LED on by making voltage HIGH
  delay(1000);                       // wait for a second  
  digitalWrite(LED_STATUS, LOW);     // turn the LED off by making the voltage LOW  
  delay(1000);                       // wait for a second  
}

 

 

5] Testing

 

Here comes the real motor driver testing! First, I plugged in USB to the board and followed through Blynk example. I downloaded the Blynk app and started off. Flashed the firmware and,.......nothing ran. Guess what? The motor was buzzing and had only USB power plugged in. Thereafter, as the manual told, I plugged in a 3.7V Li-Ion battery and still, nothing started. I felt the heat waves coming from the TP4054 charger IC and this component was getting extremely hot.

image

Just before the magic smoke started, I unplugged the external battery and USB. Trying the next power-up, nothing happened with only USB and only battery, but the charger IC was overheating when both were connected together. With the motor,...still no luck. Just a buzzing sound(it was getting some power, probably not enough current to drive the motor)

 

I thought it had something to do with the Blynk connectivity and max current settings when controlling remotely. So, I tried to bypass the Blynk connectivity by removing all Blynk sections from the code. made a test code by simplifying the main example and trying that indeed worked! Using STEP and DIR signals from ESP32, motor control was enabled.

 

//-------------TMC2300 Motor Control---------------------------

#include "include/Functions.h"  
#include "include/TMC2300.h"  
#include "include/CRC.h"  

int  tmc_current = 20;  
unsigned long memoMillis = 0; 

int pin_enable = 32;  
int pin_step = 21;  
int pin_dir = 22;  
int pin_led = 18;  
int sec = 0;  
    
void TMC2300_current(int currentInt) 
{  
  Serial.print("New MaxCurrent set: ");  
  Serial.println(currentInt);  
  uint32_t value = 1 << TMC2300_IHOLDDELAY_SHIFT  
                 | ((currentInt << TMC2300_IRUN_SHIFT) & TMC2300_IRUN_MASK)  
                 | 8 << TMC2300_IHOLD_SHIFT;  
  tmc2300_writeInt(TMC2300_IHOLD_IRUN, value);
}  

void setup()
{  
  Serial.begin(115200);     // Debug console  
  Serial1.begin(115200);    // TMC2300 IC UART connection  
  
  pinMode(pin_enable, OUTPUT);  
  digitalWrite(pin_enable,LOW); 
    
  pinMode(pin_step  , OUTPUT);  
  digitalWrite(pin_step,LOW); 
    
  pinMode(pin_dir   , OUTPUT);  
  digitalWrite(pin_dir,LOW);   
  
  pinMode(pin_led   , OUTPUT);  
  digitalWrite(pin_led,HIGH);   
  
  tmc_fillCRC8Table(0x07, true, 0);     // Initialize CRC calculation for TMC2300
  TMC2300_current(tmc_current);  
  
  delay(1000); 
  Serial.println("GO!");  
  digitalWrite(32,HIGH);  
}  

void loop()
{  
   if ((millis() - memoMillis) > 1000) 
      { 
         memoMillis = millis();   
         Serial.println("LED");   
         digitalWrite(pin_led,!digitalRead(pin_led));   
         tmc2300_writeInt(TMC2300_CHOPCONF, 0x14008001);     // Re-write the CHOPCONF register periodically  
         sec += 1;
            
         if (sec > 5)                                       //direction changing time interval
         { 
          sec = 0 ; 
          digitalWrite(pin_dir,!digitalRead(pin_dir)); 
         }
      }  
   delay(1);   
   digitalWrite(pin_step, HIGH);   
   
   delay(1);   
   digitalWrite(pin_step, LOW);   
}

 

Here it is in action!

 

 

Now, after fully charging the battery, I tried the Blynk sketch back and it worked!

But, the ESP32 was resetting continuously from the program mode and this showed up "USB device not recognized" while plugging in for flashing firmware. After trying it a couple of times and holding the BOOT button made it come back to the program state and worked fine.

 

 

6] Disco Lamp - Project

 

All set now, my project plan is to convert an old LED lamp to a disco light by attaching an RGB LED and light dispersing cap which would rotate with a stepper motor. Having remote speed and direction control over the motor will make beautiful patters of RGB light. Let's feel it!

 

image

 

Flashed in is the Blynk firmware and respective configuration, setups are done in the mobile app. This is how the UI looks with control over Enable/Disable motor, Motor direction, Maximum current delivered and stepper motor speed.

imageimage

 

 

{gallery} Disco Lamp Project

image

image

image

image

 

 

 

 

7] Summary

 

Honestly, roadtesting with TMC2300-IoT-REF was an amazing experience and I got to learn a lot. TMC2300 datasheet is the most understandable datasheet I have ever read having things written at the user level with nice block diagrams. Well structured documentation with examples were also available from Trinamic for getting started.

 

Regarding motor control with the board, it should have supported both USB and battery together(now, the charger IC gets overheated and eventually burns). Because users tend to upload program via USB and thereby see the motor in motion to modify parameters like direction, steps, speed etc rater than plugging out of USB, powering back with an external battery, check, and then plug back via USB to modify firmware settings(this was true at least in my case). The rest was all good and I was able to build the expected Disco Lamp project with TMC2300-IoT-REF.

 

Thanks to Element14, Trinamic, RoadTest program for giving me this opportunity to RoadTest and the community members who always helped and stood supportive.

 

 

Links and References

TMC2300-IoT-REF Product Page

https://www.trinamic.com/support/eval-kits/details/tmc2300-iot-ref/

TMC2300 Datasheet

https://www.trinamic.com/fileadmin/assets/Products/ICs_Documents/TMC2300_Datasheet_V104.pdf

TMC2300-IoT-REF Hardware Manual

https://www.trinamic.com/fileadmin/assets/Products/Eval_Documents/TMC2300-IOT-REF_hardware_manual_hw4.0_rev1.2.pdf

Trinamic PM25S-048-314 Stepper Motor

https://www.trinamic.com/products/drives/stepper-motors-details/goot-motors/

Trinamic's GitHub page with Blynk Example

https://github.com/trinamic/TMC2300-IOT-REF

Stepper Motor Fundamentals

https://www.monolithicpower.com/stepper-motors-basics-types-uses

Anonymous