Comments (6)
I am unable to reproduce the issue on Arduino Uno (it is at loop 90 and still going). I am using Arduino 1.8.5 and StepperDriver 1.1.3 (please check your code with latest versions).
The exact code I ran is below (the only change I've made is to print loop number to serial). It is possible that some other part left out of the original code is causing the problem.
#include <Arduino.h>
#include "BasicStepperDriver.h"
#define MOTOR_STEPS 1080
#define RPM 20
#define MICROSTEPS 1
#define DIR 1
#define STEP01 13
#define SECOND 1000L
#define MINUTE (60*SECOND)
#define HOUR (60*MINUTE)
BasicStepperDriver stepper01(MOTOR_STEPS, DIR, STEP01);
int x = 0;
void setup(void) {
Serial.begin(115200);
stepper01.begin(RPM, MICROSTEPS);
pinMode(A2, OUTPUT); // Set pin A0 as output for relay
digitalWrite(A2, LOW); // De-energize relay
}
void loop(void) {
digitalWrite(A2, HIGH); // Energize motor power relay
delay(200); // Make sure relay is energized
Serial.println(x);
stepper01.rotate(360); // Run stepper --> SKETCH HANGS RIGHT HERE
Serial.println(x++);
delay(750); // Wait until stepper is done
digitalWrite(A2, LOW); // De-energize relay
delay(MINUTE); // Wait for 1 minute
}
from stepperdriver.
Why do you use a relay? The DRV8834 offers sleep and enable pins.
from stepperdriver.
Thanks for the prompt reply. The problem was the version of the library. I was using version 1.1.2 (latest version of the library from within the 1.8.5 IDE). I had this issue consistently in 2 different Arduino Uno boards without having any pins connected to anything, just the USB cable from the PC and the board.
After updating manually the library to the 1.1.3 version from GitHub, the problem disappeared.
Thymjan, I am using a relay because the all the other pins are taken, I have 10 steppers (10 pins for STEP), one bluetooth module (2 pins), 1 buzzer (1 pin), 1 RTC DS3231 module (2 pins) and an IIC oled screen (2 pins). The relay needs only 1 pin and I am able to toggle power ON and OFF to all 10 drivers/steppers together for the length of time I need them to spin (around 600-700 ms every minute). The code snippet I sent earlier is a test code with one stepper only just to verify the problem I was having.
In any case, thank again for taking time to test my code and helping with the tip to update the library.
from stepperdriver.
Thanks for confirming. The issue you reported is then most likely same as #36 which was indeed fixed in 1.1.3.
from stepperdriver.
Instead of the relay you could use the relay pin for all enable pins, couldn‘t you?
from stepperdriver.
You are absolutely correct. To be honest, I did not think about it at all. In any case, it would have added 10 more wires on top of what I already have and I also would have had to solder 10 more pins to the DRD8834 drivers. On top of this, I am using 3-wire plugs to connect to the steppers, like the ones that are usually used for servo motors (red/black/white) for 5VDC, ground and STEP signal. A fourth wire for the ENABLE signal would have complicated my design. I have connected all 10 5V red wires to a connector block that takes the 5VDC from the relay contacts. It may not be the most elegant solution but it works perfectly for my purpose.
from stepperdriver.
Related Issues (20)
- Code Analysis HOT 3
- Position drifts over many cycles HOT 18
- support TB6600
- Bug. Two motors nema 17 do not rotate at the same time. HOT 2
- Changing speed
- Motor Status HOT 1
- Not smooth movement HOT 5
- Please advice on constant rotation HOT 2
- Smooth transition between movements in LINEAR_SPEED Profile HOT 2
- Using two steppers - seems that they only can use a single rpm value!! HOT 2
- Stepper.Disable() Issue HOT 2
- Stepper scaling HOT 3
- What is the RPM? HOT 2
- What should be set for the "microstep" value? HOT 2
- No sync move at step_high_min = 30 HOT 1
- Please add non 2^n microstep support for close loop stepper. HOT 2
- TMC HOT 1
- Support non-blocking nextAction()
- compatibility with grbl shield HOT 1
- Sketch didn't work on Apple M1 Pro Sonoma v14.1.2 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stepperdriver.