Flashing Micro board power light

Hi y'all,

I'm hoping I placed this post in the correct place. For my first arduino project I'm driving a NEMA17 stepper motor with the TMC2100 "silent stepper" driver. I'm using a 12v 2250 milliampere adapter to power the driver and put a 47 microfarad capacitor between the + and - alas I just noticed it is 10V. The Arduino board is powered using a "powerbar" with two usb ports.

Sorry for my failed attempt to create a clear electronic scheme.

I'm not the most fervent programmer, but I've been trying to get the board to bootup when powered and to tell the stepperdriver to accelerate smoothly from stillness, rotate very slowly and come to a full stop with a chance of slowly accelerating in the opposite direction. Repeat. I'm using an inverted and offset cosine to fade in the speed when it gets to it's minimum and maximum. There's probably a much more efficient and consistent way of getting this program to work, but here's my attempt:

#include "AccelStepper.h"

// Define a stepper and the pins it will use
AccelStepper stepper(4,5);
int StepSpeed;      // scaled version of stepper speed in steps per second(?)), uses a cosine to vary in speed
int Counter;    // counts the amount of updates before adding to the index of the cosine; The time it takes to progress the cosine
int Index;      // drives the cosine that varies the stepperspeed (Scale)
int WavDir;     // direction of rotation
int Mod;        // introduces an extra modulation in speed for extra unpredictability 
int ModCounter; // counts amount of updates before adding to the index of the extra mod
int ModIndex;   // index that in turn drives another cosine to extra modulate the speed, maybe this should be a sine wave instead, 

bool WavDirEva;

void setup()
{  

  int speed = 1000;
  
  stepper.setMaxSpeed(speed);
  stepper.setAcceleration(100);
  stepper.setSpeed(1000);
  Serial.begin(9600);
  Counter = 0;
  StepSpeed = 0;
  Index = 0;
  Mod = 0;
  ModIndex = random(0,628);
  WavDir = random(-1,1);
  if (WavDir== 0) {WavDir = 1;}
  WavDirEva = false;

}

void loop()
{


Counter = Counter + 1;
if  (Counter >= Mod) // after this many updates changes speed by adding 1 index
    {
    StepSpeed = ((( cos ( Index / 100.0 ) * -0.5 ) + 0.5 ) * 1000 ) * WavDir; // cosine because it starts at the most outward amplitude, making it more smooth around both extremes
    // the * -1 + 1 makes the cos start at 0 and climb up to, perhaps better to multiply the StepSpeed with the mod rather than add it. So that the mod can have a random beginning point without losing the "fade in"
    Index = Index + 1;
    Counter = 0; 
    if  (Index == 628){ //6,28 = (2*pi) almost a full cos cycle.
        Index = 0;
        
        }
      // Serial.println(StepSpeed);
    }


ModCounter = ModCounter + 1; //introduces an extra modulation for stepperspeed.
if (ModCounter == 10000)
  {
  ModIndex = ModIndex + 1;
  Mod = (((cos(ModIndex/100.0)*-0.5)+0.5)*1000)+1500; // Maximum should be 1000 steps p/s. So compensate in StepSpeed
  ModCounter = 0;
  if(ModIndex == 628)
  {
    ModIndex = 0;
  }
 // Serial.println(Mod);
 
  if  (StepSpeed != 0 && WavDirEva == true)
      { 
      WavDirEva = false;
      }
  
  if  (StepSpeed == 0 && WavDirEva == false) // somewhere here something is still wrong, causing too often a negative stepspeed
      {
      WavDir = random(-1,1);
      if  (WavDir== 0) 
          {
          WavDir = 1;
          }
 //     Serial.println(WavDir);
      WavDirEva = true;
      }
      Serial.println(StepSpeed);
      Serial.println(Mod);
      Serial.println(WavDirEva);
  }

stepper.move(StepSpeed);
stepper.run();
}

Here's what I'm trying to achieve: it worked for a while, but after connecting 3 times or so the board started only flashing the blue power light causing the motor to only pulse a bit synchronous to the power light. This happened with two different boards. Did I fry them? They don't show up in the serial ports anymore.

Help is very much appreciated!

Jorick

Yes you may have fried it, probably the on board 5V regulator. Start by using a 12 Volt power supply and see if that solves the problem. Use your 10V power supply to power the arduino via the Vin or power jack. This response is to help you get started in solving your problem, not solve it for you.
Good Luck & Have Fun!
Gil

From Trinamic's webpage:

The TMC2100 is capable of driving up to 2.5A of current from each output (with proper heatsinking).

How much current does your "NEMA 17" require? Is your TMC2100 board "properly heatsinked"?

the board started only flashing the blue power light

Which board, Arduino or motor board or ?

Hi, and thanks for you responses.

It’s the arduino board’s blue power indicator flashing.
The motor seems to need 1.7A.
The driver is heatsinked.

How come the 5v regulator of the arduino micro would be overloaded, are you saying the logic of the driver needs 10v? I only have a 12v supply and the usb power-port atm. Is there no way I can make that work?

gilshultz:
Yes you may have fried it, probably the on board 5V regulator. Start by using a 12 Volt power supply and see if that solves the problem. Use your 10V power supply to power the arduino via the Vin or power jack. This response is to help you get started in solving your problem, not solve it for you.
Good Luck & Have Fun!
Gil

I am already using 12V to drive the motor. The arduino board is powered by the USB port of the powerbar, and the logic of the stepper-driver is powered by the 5V output(is this a thing) of the Arduino board. Do you think the latter was the problem?

I appreciate you think I deserve the adventure of letting me solve this problem myself, but I am really afraid to fry more components and am in need of help.

Is the 10V capacitor a problem since I use a 12V adapter?

Can I use the 12V power supply through VIN instead of the usb or is it this a too strong voltage for the arduino board?

A 10V capacitor will probably explode if you give it 12V.

So long as there isn't a lot of load on the 5V bus, powering the Arduino from 12V is ok. But many "12V" adapters are unregulated so they may go as high as 15V with a light load like a single Arduino.

Thanks MorganS! So if I would have the same 12 V transformer power both the motor and the arduino, while powering the drivers logic from the arduino’s 5v output, it should be safe? Or will it be tricky/edgy?

That sounds good.

I'm hoping I placed this post in the correct place. For my first arduino project I'm driving a NEMA17 stepper motor with the TMC2100 "silent stepper" driver. I'm using a 12v 2250 milliampere adapter to power the driver and put a 47 microfarad capacitor between the + and - alas I just noticed it is 10V. The Arduino board is powered using a "powerbar" with two usb ports.

Sorry for my failed attempt to create a clear electronic scheme.

I'm not the most fervent programmer, but I've been trying to get the board to bootup when powered and to tell the stepperdriver to accelerate smoothly from stillness, rotate very slowly and come to a full stop with a chance of slowly accelerating in the opposite direction. Repeat. I'm using an inverted and offset cosine to fade in the speed when it gets to it's minimum and maximum. There's probably a much more efficient and consistent way of getting this program to work, but here's my attempt:

#include "AccelStepper.h"

// Define a stepper and the pins it will use
AccelStepper stepper(4,5);
int StepSpeed;      // scaled version of stepper speed in steps per second(?)), uses a cosine to vary in speed
int Counter;    // counts the amount of updates before adding to the index of the cosine; The time it takes to progress the cosine
int Index;      // drives the cosine that varies the stepperspeed (Scale)
int WavDir;     // direction of rotation
int Mod;        // introduces an extra modulation in speed for extra unpredictability 
int ModCounter; // counts amount of updates before adding to the index of the extra mod
int ModIndex;   // index that in turn drives another cosine to extra modulate the speed, maybe this should be a sine wave instead, 

bool WavDirEva;

void setup()
{  

  int speed = 1000;
  
  stepper.setMaxSpeed(speed);
  stepper.setAcceleration(100);
  stepper.setSpeed(1000);
  Serial.begin(9600);
  Counter = 0;
  StepSpeed = 0;
  Index = 0;
  Mod = 0;
  ModIndex = random(0,628);
  WavDir = random(-1,1);
  if (WavDir== 0) {WavDir = 1;}
  WavDirEva = false;

}

void loop()
{


Counter = Counter + 1;
if  (Counter >= Mod) // after this many updates changes speed by adding 1 index
    {
    StepSpeed = ((( cos ( Index / 100.0 ) * -0.5 ) + 0.5 ) * 1000 ) * WavDir; // cosine because it starts at the most outward amplitude, making it more smooth around both extremes
    // the * -1 + 1 makes the cos start at 0 and climb up to, perhaps better to multiply the StepSpeed with the mod rather than add it. So that the mod can have a random beginning point without losing the "fade in"
    Index = Index + 1;
    Counter = 0; 
    if  (Index == 628){ //6,28 = (2*pi) almost a full cos cycle.
        Index = 0;
        
        }
      // Serial.println(StepSpeed);
    }


ModCounter = ModCounter + 1; //introduces an extra modulation for stepperspeed.
if (ModCounter == 10000)
  {
  ModIndex = ModIndex + 1;
  Mod = (((cos(ModIndex/100.0)*-0.5)+0.5)*1000)+1500; // Maximum should be 1000 steps p/s. So compensate in StepSpeed
  ModCounter = 0;
  if(ModIndex == 628)
  {
    ModIndex = 0;
  }
 // Serial.println(Mod);
 
  if  (StepSpeed != 0 && WavDirEva == true)
      { 
      WavDirEva = false;
      }
  
  if  (StepSpeed == 0 && WavDirEva == false) // somewhere here something is still wrong, causing too often a negative stepspeed
      {
      WavDir = random(-1,1);
      if  (WavDir== 0) 
          {
          WavDir = 1;
          }
 //     Serial.println(WavDir);
      WavDirEva = true;
      }
      Serial.println(StepSpeed);
      Serial.println(Mod);
      Serial.println(WavDirEva);
  }

stepper.move(StepSpeed);
stepper.run();
}

Here's what I'm trying to achieve, it worked for a while, but after connecting 3 times or so the board started only flashing the blue power light causing the motor to only pulse a bit synchronous to the power light. This happened with two different boards. Did I fry them? They don't show up in the serial ports anymore. Are they "just" bricked, but salvageable? When I USB connect the boards only the power led goes on, nothing else. There's no visual damage to the components, but the boards get quite warm.

I want to prevent me from doing more damage since I might have already destroyed the Arduinos, I have two more knock-off Pro Micro's that look very similar to the ones from Sparkfun, although I obviously hope I can still use the arduinos.

I've been told that I can also power both the arduino and the stepper-driver with the same 12V adapter. Also the 10V Capacitor should be at least 12. Is the capacitor important for this to work? I only have 470 mF or 4.7 mF capacitors.

Help is very much appreciated, since I'm quite in the dark of what I'm really doing. Please check out the attachments that show my setup.

Jorick

I've merged your other cross-post @DoesThisCompute.

Cross-posting is against the rules of the forum. The reason is that duplicate posts can waste the time of the people trying to help. Someone might spend 15 minutes (or more) writing a detailed answer on this topic, without knowing that someone else already did the same in the other topic.

Repeated cross-posting will result in a suspension from the forum.

In the future, please take some time to pick the forum board that best suits the topic of your question and then only post once to that forum board. This is basic forum etiquette, as explained in the sticky "How to use this forum - please read." post you will find at the top of every forum board. It contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

Note that @DoesThisCompute also has posted this in the Nederlands board:
https://forum.arduino.cc/index.php?topic=654553
I'm going to leave that unmerged, since I don't want to mix the languages, but you should be aware that posting to two different language boards is still cross-posting, and is against the rules.

I apologize for breaking forum etiquette.

I was not getting the help I needed over the timespan of several weeks. I figured maybe my post was in the wrong segment. Also the symptoms are now different and the problem is also a different one, the powerlight doesn’t flash so I thought it would become confusing to put it in the same initial entry.
I will supplement both the titles with [SOLVED] once my problem is fixed.

Well I did not fix the initial problem, yet. :-\

Among many other problems apparently I overloaded the driver, and, possibly, the first two Arduino Micros. I have faint hope they are "merely" bricked and that perhaps they can be revived. No idea how yet, I'll do some more research. Meanwhile I was able to finish the project, using a new arduino and a new driver. Rookie mistakes.

The driver did not have any visual damage and I also find it difficult to test if it works. During sloppy measuring I probably damaged the driver, and possibly the micros. Replacing both fixed the issue, for now.

Thanks for the help and direction, without it I wouldn't have been able to finish it and learned quite a lot. For those interested: the end result, minus a lick of paint.

I also made the code more easy to read and, hopefully, more efficient.

#include "AccelStepper.h"

// Define a stepper and the pins it will use
AccelStepper stepper(1,9,8); // the "1" tells the program we're using a driver, the 2nd arg is motorStepPin, the 3rd arg is motorDirPin
int stepSpeed;      // scaled version of stepper speed in steps per second(?)), uses a cosine to vary in speed
int unmodulatedSpeed;
int waveMillis;
int waveModMillis;
int speed;


float wavePhase;
float waveModPhase;
float modulator;

unsigned long currentMillis;
unsigned long previousMillis;
unsigned long interval;
unsigned long previousModMillis;
unsigned long intervalMod;


void setup()
{  
randomSeed(analogRead(0));


  speed = 1000;
  
  stepper.setMaxSpeed(speed);
  stepper.setAcceleration(100);
  stepper.setSpeed(700);
  Serial.begin(9600);
  stepSpeed = 0;
  interval = random(2380, 8000);
  intervalMod = random(2000,4000);
  previousMillis = 0;
  previousModMillis = 0;
  modulator = 0;
  wavePhase     = 0;
  waveModPhase     = 0;

}

void loop()
{
currentMillis = millis();
waveMillis    = currentMillis - previousMillis;
waveModMillis = currentMillis - previousModMillis;
wavePhase     = (float(waveMillis) / float(interval)) * 6.28 ;
waveModPhase  = (float(waveModMillis) /  float(intervalMod)) * 6.28;


if (currentMillis - previousMillis >= interval)
  {
    interval        = random(2380, 8000); // minimal and maximal length per wave in ms
    previousMillis  = currentMillis;
  }

if (currentMillis - previousModMillis >= intervalMod)
  {
    intervalMod       = random(2000,4000);
    previousModMillis = currentMillis;
  }

  modulator    = (cos( waveModPhase) * -0.2 ) + 0.8;

  unmodulatedSpeed = ( ( ( cos( wavePhase) * -0.5 ) + 0.5 ) * (speed - 25) + 25);
  stepSpeed    = unmodulatedSpeed * modulator;

/*  
  Serial.println(modulator);
  Serial.println(intervalMod);
  Serial.println(unmodulatedSpeed);
  Serial.println(stepSpeed);
  delay(30);
*/

stepper.move(stepSpeed);
stepper.run();
}

It is possible to "brick" Micros via software, and this is fairly easy to recover from. However, if you get these symptoms after subjecting the Micros to harmful conditions, it's likely they are permanently dead. I suspect the latter in this case.

If you disconnect all external wiring from the bricked Micros and plug them in to your computer do you still not get a port?

Which operating system are you using?

DoesThisCompute:
the end result, minus a lick of paint.

Very nice! If the Micros are dead, at least it was for a worthy cause.

re-opened to prevent double posting.

Appreciated, thanks for your patience with me learning Arduino, and forum etiquette. Over the course of a year, to me, this problem seems to branching out in multiple separate problems, hence my attempt of opening a separate thread. I see now this is not desirable from a moderator perspective.

So to recap: I have two Arduino Micro boards, that are potentially fried, or bricked, or maybe something else is wrong with them. No longer are the power lights constantly flashing though, I just can't get the boards to show up in the ports list.
I consider myself a beginner, so it might be very possible I caused irreparable damage to the boards(someone told me the micro can handle to be powered with a 12V adapter, this true right?), however, I am wondering if there is a way to make sure they are ready for the recycling bin or that there is perhaps still a way to revive them?
My previous post shows what I tried to do with them, which was simply driving a stepper motor with rather specific behaviour. It should be noted that I am not a very skilled solderer, let alone under Micro circumstances. :sweat_smile:

In an, as of yet unsuccessful, series of efforts to unbrick them I found out they become quite warm when hooked up to the programmer, but perhaps this is where the term "Burn bootloader" comes from. :man_shrugging:t3: :fire_extinguisher:Efforts regarding the burning bootloader attempts are logged here: Yikes! Invalid device signature (0xffffff/0x000000/0xff0000

Is there anything else that could be wrong with the boards? And if so, how do I make sure?
I'm sorry to say that as of yet, I still haven't quite figured out how to receive an e-mail when my posts receive a response, which is probably why I completely missed Pert's reply last year. I am back at another project for which I was hoping to use either of these boards. Which led me back at it, and finding out about the missed replies.

Does the code I used at the time look like something that could do such harm? Honest noob question.

I sure do hope not, but is there another way to check if there is indeed irreparable damage?

This is indeed the case.

Pretty sure that I was using Mojave at the time, right now however I'm still in Catalina, in an attempt to stretch the lifetime of some equipment that is rendered useless once I make the switch to Big Sur.

Your input is valued greatly!

good afternoon guys i would like to find out ii bought nema 23 steppers and pst4030 drivers which are 3A drivers 9-36v
the problem im having is that the fault light flashes 3 times even with just the power connected and i cant find ifo on what it means can anyone maybe assist please