I have tried stepper motor controling using [SpeedyStepper](https://github.com/Stan-Reifel/SpeedyStepper) with Protenta H7 breakout board, but it's not working properly. can some one help me.
The issue's are so wired. if I connect to BOB to power supply (5V out) with-out the power (230V in) the example work's work's ( with the USB power ). If I just use USB the code doesn't work.
only method of working : USB + Power Supply (Without Power)
The only thing that comes to mind is that powerful capacitors are usually installed at the output of power supplies. At the moment the motor starts, it consumes a lot, then capacitors can help the USB to supply a high current.
// Bounce.pde
// -*- mode: C++ -*-
//
// Make a single stepper bounce from one limit to another
//
// Copyright (C) 2012 Mike McCauley
// $Id: Random.pde,v 1.1 2011/01/05 01:51:01 mikem Exp mikem $
#include <AccelStepper.h>
#include <Arduino_PortentaBreakout.h>
const int Enable = PWM0; // ClearPath ~enable input; +enable = BLU wire; -enable = ORN wire
const int InputA = PWM1; // ClearPath Input A; +InputA = WHT wire; -InputA is BRN wire
const int InputB = PWM2; // ClearPath Input B; +InputB = BLK wire; -InputB = YEL wire
const int HLFB = PWM3; // ClearPath HLFB Output; +HLFB = GRN wire; -HLFB = RED wire
//AccelStepper stepper; // Defaults to AccelStepper::FULL4WIRE (4 pins) on 2, 3, 4, 5
AccelStepper stepper(1, InputA, InputB); // Defaults to AccelStepper::FULL4WIRE (4 pins) on 2, 3, 4, 5
void setup()
{
Serial.begin(9600);
pinMode(Enable, OUTPUT);
digitalWrite(Enable, HIGH);
// Change these to suit your stepper if you want
stepper.setMaxSpeed(800);
stepper.setAcceleration(200000);
stepper.moveTo(800);
}
void loop()
{
// If at the end of travel go to the other end
if (stepper.distanceToGo() == 0)
stepper.moveTo(-stepper.currentPosition());
Serial.println(stepper.currentPosition());
stepper.run();
}
Now I'm looking forward to connect the motor to Machine controller , Tried the same code with the correct pin Configuration, but cannot figure-it out yet !