For some unknown reason when I try to run 3+ motors with TeensyStep they simply make static-ish noise and don't move (or possibly M3 does poorly). I have tried the example Array but also run into the same issue.
I have tested:
Greatly appreciate any input. Thanks
2x LINKS: DRV8825 + Datasheet
I have tested:
- each of the drivers individually
- all of the drivers as sets of 2
- powering teensy via 5V2.4A wall adapter (in case the PC USB was the issue)
- unplugging any individual (while unpowered) and the other 2 work and Noise is gone
- disconnecting the 3 Drivers on the right (even though there shouldn't draw much if not being utilized)
Greatly appreciate any input. Thanks
2x LINKS: DRV8825 + Datasheet
Code:
#include <StepControl.h>
Stepper M1(23, 22), M2(21, 20), M3(17, 16); // create 6 motors
StepControl<> controller;
void setup()
{
pinMode(LED_BUILTIN,OUTPUT);
delay(100);
Stepper* motorSet_A[] = {&M1, &M2, &M3 }; // define an array of pointers to motors 1,2,5 and 6
M1.setTargetAbs(200); // set targets for the motors
M2.setTargetAbs(-500);
M3.setTargetAbs(-100);
// M4.setTargetAbs(30);
controller.move(motorSet_A); // move all motors in the array to their targets
delay(500); // just to generate a nice output on the logic analyzer
Stepper* motorSet_B[] = {&M1, &M3}; // another set of motors;
M1.setTargetAbs(-110);
M3.setTargetAbs(50);
controller.move(motorSet_B); // move set B to target
delay(500); // just to generate a nice output on the logic analyzer
for (int i = 0; i < 4; i++) { // loop through all motors in motorSet_A...
motorSet_A[i]->setTargetAbs(0); // ... set targets to 0...
}
controller.move(motorSet_A); // ... and move home
}
void loop(){
digitalWriteFast(LED_BUILTIN,!digitalReadFast(LED_BUILTIN));
delay(100);
}