Hi!
Im facing a hot as hell issue which I wish you can help me with.
Im using an arduino uno r4 wifi, two simplefoc minis 1.1 and a nema 17 pipolar stepper motor.
I can get the open loop example code to spin the stepper both ways as expected. But it only takes seconds for the minis to get super hot, melting cable plastic hot. Really, the plastic in the breadboard melts. When I connect power and have a finger on the driver chip, I can only keep it there for 2-3 seconds.
As you can see in the code I have tried to set different voltage limits but it does not make any difference. I wonder if there is a short somewhere. I have a BLDC motor so I can try that one and see if the drivers get equally super hot then (using one at a time).
In general the “limit” settings should at least make some difference?
Bear in mind Im a bit of a beginner, and I hope I have done some really basic error, else Im very confused. I have read about hot motors and hot drivers but I thought the limit setting should at least do something? ![]()
Code:
#include <SimpleFOC.h>
StepperMotor motor = StepperMotor(50);
StepperDriver4PWM driver = StepperDriver4PWM(5, 6, 9, 10, 7, 12);
float target_velocity = 2;
Commander command = Commander(Serial);
void doTarget(char* cmd) { command.scalar(&target_velocity, cmd); }
void doLimit(char* cmd) { command.scalar(&motor.voltage_limit, cmd); }
void setup() {
driver.voltage_power_supply = 12;
driver.voltage_limit = 0.05f;
driver.pwm_frequency = 32000;
driver.init();
driver.enable();
motor.linkDriver(&driver);
motor.voltage_limit = 0.05f;
motor.controller = MotionControlType::velocity_openloop;
motor.foc_modulation = FOCModulationType::SinePWM;
motor.init();
command.add('T', doTarget, "target velocity");
Serial.begin(115200);
Serial.println("Motor ready!");
Serial.println("Set target velocity [rad/s]");
_delay(1000);
}
void loop() {
motor.move(target_velocity);
command.run();
}
