Notifications
Clear all

Power Down with TMC2208

9 Posts
4 Users
0 Reactions
152 Views
(@g000ze)
Member
Joined: 3 weeks ago
Posts: 6
Topic starter  

Hello everyone

I built my own Split Flap Display with 32 modules, each run by its own stepper motor. The stepper motor I have chose is the 17HS13-0404D and the driver is the TMC2208 on a breakout board from Watterott. Everything works perfect as you can seen in this video. On the Arduino Micro I use just one pin for each stepper motor, as the modules always run in the same direction. I configured the driver to 0.4 volts using the potentiometer. Also I soldered the jumper on the backside of the driver to the PDN_UART pin. I guess that I am running the driver in "Standalone STEP/DIR Driver" mode.

The only thing that I noticed is the fact, that the power supply and the stepper motors get pretty hot after a while of running. Luckily the TMC2208 has a built in "StandStill" function, which is capable of saving a lot of energy. In the datasheet on page 8 it says the following: 

An automatic current reduction drastically reduces application power dissipation and cooling requirements. Per default, the stand still current reduction is enabled by pulling PDN _UART input to GND. It reduces standstill power dissipation to less than 33% by going to slightly more than hal f o f the run current.

However, I am struggling with this. If I set GND to the PDN_UART, nothing at all happens and the power consumption remains the same. So obviously I am doing something wrong.

In case you are interested in how the code that runs the driver/motor looks like, this is the peace that does the job: 

void motor_run(){
  curr_time = micros();
  if((curr_time - prev_time) >= speed){
    prev_time = curr_time;
    for(byte module = 0; module < modules; module++){
      if(ms_to_go[module] > 0){
        digitalWrite(step_pin[module], HIGH);
        digitalWrite(step_pin[module], LOW);
        update_ms_pos(module);
      }
    }
  }
}

Any helps is very much appreciated. Many thanks, Stefan


   
Quote
Will
 Will
(@will)
Member
Joined: 4 years ago
Posts: 2603
 

@g000ze

IIRC, stepper motors draw some current even when they're not moving, so they're consuming power all the time and generally seem to become physically hot while operating. So, if you can still hold your hand on the hot stepper, it's probably operating within it's normal range.

 

If the stepper doesn't require any torque to hold its position after it's finished moving, then you can probably tell the driver to SLEEP or use the ENABLE pin to power the stepper down. This will require that you add a second pin per stepper driver and will also mean that the stepper can rotate freely. Thus, you can't use these techniques if the stepper needs to retain its position after moving.

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
(@g000ze)
Member
Joined: 3 weeks ago
Posts: 6
Topic starter  

Yes @Will, you are right. I forgot to mention what you wrote. The steppers consume slightly more power in torque than while moving. My goal is to use the "power down" feature of the driver while standing still and no power is needed. Completely powering off the driver seems no good solution to me, because I am afraid that if it powers back on the motor might jerk.

If I need to add one more pin per stepper, I could maybe use an ESP32 with more pins or by using a shift register. 

But I am really struggling with the PDN stuff of the driver. Does anybody has a good instruction on how to achieve that?

Thanks, Stefan


   
ReplyQuote
TFMcCarthy
(@tfmccarthy)
Member
Joined: 12 months ago
Posts: 354
 

Posted by: @g000ze

But I am really struggling with the PDN stuff of the driver. Does anybody has a good instruction on how to achieve that?

I have never used the board or driver. The following is based upon the datasheet and skimming the library code.

The links I used are:

TMC2208 Datasheet

TMC 2208 UART Arduino Code

github repository 1

github repository 2

 

The datasheet indicates that the Powerdown feature reduces the current draw after an idle period (or a stall, I think)

PowerDown

The feature is active when the PDN input is low. So, tying the pin to ground enables the default behavior. Again, note that the current is only reduced.

You can modify the TPOWERDOWN and IHOLDDELY values by changing the PDN to be an IO pin. To do that you have to close the jumper switch for the PDN pin and then tie the UART RX and TX signals to the pin (see the Arduino link for the description of this.) When that is done you can send the register commands to the board to set the TPOWERDOWN and IHOLDDELY values. The github library code has a function for the PowerDown. I didn't check if there was one for the hold delay value.

HTH

 

The one who has the most fun, wins!


   
ReplyQuote
(@aliarifat)
Member
Joined: 11 months ago
Posts: 99
 

Posted by: @g000ze

Hello everyone

I built my own Split Flap Display with 32 modules, each run by its own stepper motor. The stepper motor I have chose is the 17HS13-0404D and the driver is the TMC2208 on a breakout board from Watterott. Everything works perfect as you can seen in this video. On the Arduino Micro I use just one pin for each stepper motor, as the modules always run in the same direction. I configured the driver to 0.4 volts using the potentiometer. Also I soldered the jumper on the backside of the driver to the PDN_UART pin. I guess that I am running the driver in "Standalone STEP/DIR Driver" mode.

The only thing that I noticed is the fact, that the power supply and the stepper motors get pretty hot after a while of running. Luckily the TMC2208 has a built in "StandStill" function, which is capable of saving a lot of energy. In the datasheet on page 8 it says the following: 

An automatic current reduction drastically reduces application power dissipation and cooling requirements. Per default, the stand still current reduction is enabled by pulling PDN _UART input to GND. It reduces standstill power dissipation to less than 33% by going to slightly more than hal f o f the run current.

However, I am struggling with this. If I set GND to the PDN_UART, nothing at all happens and the power consumption remains the same. So obviously I am doing something wrong.

In case you are interested in how the code that runs the driver/motor looks like, this is the peace that does the job: 

void motor_run(){
  curr_time = micros();
  if((curr_time - prev_time) >= speed){
    prev_time = curr_time;
    for(byte module = 0; module < modules; module++){
      if(ms_to_go[module] > 0){
        digitalWrite(step_pin[module], HIGH);
        digitalWrite(step_pin[module], LOW);
        update_ms_pos(module);
      }
    }
  }
}

Any helps is very much appreciated. Many thanks, Stefan

On some breakout boards like Watterott’s SilentStepStick, the PDN_UART pin is connected to the microcontroller (or left floating) unless explicitly pulled low during operation.

If you just soldered the jumper, but the MCU pin isn't low, the driver may still detect it as high or floating, and the standstill current reduction won't activate.

If you are sending regular step pulses, the driver sees the motor as still active — standstill reduction will not engage.

Only after a timeout (~0.1s or so of inactivity) will it consider the motor “standing still”.

If you want fine-grained control over current and features like dynamic current scaling, stealthChop or spreadCycle config, setting exact standby current %. 

Then you can unsolder the PDN_UART jumper, connect PDN_UART to an MCU UART TX pin or use a library like TMCStepper to configure.

This gives you full control, but also increases complexity and pin usage.

driver.rms_current(500);         // run current
driver.standstill_current(100);  // lower idle current
driver.toff(5);                  // enable driver

 You can also make your own module like this.

https://www.pcbway.com/project/shareproject/Tmc2209_Stepper_Driver_With_Atmega2560_via_RS485.html

 

This post was modified 2 weeks ago by aliarifat

   
ReplyQuote
(@g000ze)
Member
Joined: 3 weeks ago
Posts: 6
Topic starter  

Many thanks @TFMcCarthy and @aliarifat, I think that this might help. As soon as I checked that I will come back with any results. 


   
ReplyQuote
(@g000ze)
Member
Joined: 3 weeks ago
Posts: 6
Topic starter  

I just checked everything again with a minimal setup. As for now I did not use the "fine-grained control" setup with the software library, as suggested by @aliarifat, I concentrated on the simple setup.

This is the wiring. 

image

 And here is the code I used:

const int step_pin = 15;
const int pdn_pin  = 14;
int steps          = 0;


void setup() {
  Serial.begin(9600);
  pinMode(step_pin, OUTPUT);
  pinMode(pdn_pin,  OUTPUT);
}

void loop() {
  steps = 2000;

  Serial.println("pdn pin to HIGH"); // amps do not change
  digitalWrite(pdn_pin, HIGH);       
  delay(5000);

  Serial.println("running motor");   // 256 mA
  while(steps > 0){
    digitalWrite(step_pin, HIGH); 
    delay(2); 
    digitalWrite(step_pin, LOW);
    steps--;
  }
  Serial.println("stopping motor");  // 275 mA
  delay(5000);
  Serial.println("pdn pin to LOW");  // amps do not change
  digitalWrite(pdn_pin, LOW);
  delay(5000);
}

 

I measure around 256 mA when the motor is running and slightly more (275 mA) when it is not running. So I was not able to manage the "standstill reduction" using this mode with either one of the TMC2208, the connected and the unconnected jumper. 

My question is. is it actually possible to power down using this method or do I have to use the more advanced method using the stealthChop or spreadCycle config and the library? 

Stefan


   
ReplyQuote
TFMcCarthy
(@tfmccarthy)
Member
Joined: 12 months ago
Posts: 354
 

Posted by: @g000ze

So I was not able to manage the "standstill reduction" using this mode with either one of the TMC2208, the connected and the unconnected jumper.

As I understand it, the jumper controls whether the PDN pin is an IO pin. The default is that it is not. The PDN pin must be LOW in order for the powerdown process to be active. This is why the default circuit grounded the pin. The motor is considered to be at "stand still" when it has not changed speed for the TPOWERDOWN period. The documentation indicates the maximum TPOWERDOWN period is 5.6 seconds, which I assume is the default. When that period has expired with the motor at "stand still" then the motor should powerdwon in steps over the IHOLDDELAY period until it reaches the minimum current. I can't find what the default IHOLDDELAY period is.

As I read the code provided, it waits for only 5 seconds, which is not long enough to start the powerdown process. The PDN pin isn't kept LOW for the IHOLDDELAY period. I'd just set the pin LOW and leave it.  

The one who has the most fun, wins!


   
ReplyQuote
(@g000ze)
Member
Joined: 3 weeks ago
Posts: 6
Topic starter  

Hi @TFMcCarthy, thank you for your hint. I just extended the delay time in the code from 5000 to 20000 ms, but I was not lucky. The current remains the same, around 275mA while torque (even after 20 seconds) and around 256mA while running. Obviously I am doing something wrong. Any help is appreciated!


   
ReplyQuote