5
votes
Accepted
A4988 and capacitors
There are two purposes of such capacitor:
first it supply power for short peaks in demand, so effectively enabling the 12V power source supply much more current for short time, than it can support ...
5
votes
Where am I going wrong in modifying Timer0 and the ISR interrupts in this example?
Don't do serial prints inside an ISR. Ever. They require interrupts to work, and inside the ISR interrupts are off. For a while the attempts to print will fill up a buffer which is emptied by another ...
4
votes
Accepted
How to calculate step delay?
Convert the RPM of the motor to RPS.
Take reciprocal to get seconds per revolution.
Divide it by 360 to get seconds per degree.
Multiply by 1.8 to get seconds per step.
4
votes
Accepted
How to randomize the delay in Arduino Stepper code?
In setup(), add
randomSeed(analogRead(0));
This reads the value of an analog input pin, which if not connected, will float to relatively random values between 0 and 1023. This "seeds" the random ...
4
votes
Accepted
Stepper Motor is not working with A4988 board
You have to connect the sleep and reset pin together. I assume that you took this schema on how to mechatronics. In his video you see that the sleep and reset pins are connected. I don't know why but ...
3
votes
Accepted
Run two stepper at same time
When using a normal stepper driver, you say the driver to do one step, by sending him one pulse. The length of these pulses does not have a meaning. they are constructed, so that the driver can sense ...
3
votes
Stepper Motor won't reverse/turn CCW
I had this issue myself, when I tried to use these stepper motors (which are to be honest really crappy ones, but very cheap). Vibrating mostly means, that the phases of the motor are not activated in ...
3
votes
Accepted
Why is my CNC shield smoking? Is it safe to keep on for long periods of time?
Those NEMAs are big ones - i suspect too big for the little A4988 chips - which can only provide 2A when actively cooled and generally only for short periods. I wouldn't try to push more than 1.7ish ...
3
votes
Accepted
2 stepper drivers speed control
Changing the duty cycle does not change the frequency of the PWM signal.
The tb6000 needs a pulse to trigger a step of the motor. If the frequency does not change the pulses per second do not change ...
3
votes
Accepted
AMIS30543 | Data-Sheet understanding Status register
Most of the data is duplicated between the registers. Both registers contain MSP[6:2].
If MSP contains 111001001 the registers (ignoring the MSB "PAR" bit) would look like:
SR3: 1110010
SR4: ...
3
votes
How to control speed of 28BYJ-48 stepper motor without using library?
A stepper motor always needs a driver. As the ULN2003 (or similar) driver is normally shipped together with the 28byj-48 motor, I will assume, that you have this driver.
The ULN2003 has 6 pins:
Vcc ...
3
votes
How to change the direction of a stepper motor using the AccelStepper library?
The moveTo() function takes absolute positions, so if you want to move in both directions, you should adjust the target positions accordingly.
You can modify your loop() function as follows:
void loop(...
3
votes
Accepted
How do I find the whole number (n) that when multiplied by (m) will be closest to (x)?
First, I'll show you the "manual" way.
You can divide the resulting steps by the number they should be divisible by, round to the next integer, and multiply that again by the number. I'll ...
2
votes
How to calculate step delay?
How to calculate exact step delay for 1.8deg/step stepper motor?
each rpm = 360 degrees * rpm / 60 second.
So the time, between each step, is resolution / (60 * rpm), where resolution = 1.8deg/step ...
2
votes
Arduino code is not working for unipolar stepper motor
I have mentioned in the comments that you should read the buttons with analogRead(). But you can do it other way by simply connecting the button pin to digital inputs on arduino(any from 0-13). Analog ...
2
votes
Need help with my urgent problem
The step function from the Stepper library is blocking. So it can only run one motor at a time. You need a different stepper library that is non-blocking. Try AccelStepper.
2
votes
Arduino Uno + MSD-11-EM stepdriver + NEMA 17
In loop add flag to change after what you desired plus a statement to check the flag.
Code below (assuming what is in for() being enough to do 4 revolutions):
#include <Stepper.h>
const int ...
2
votes
Detecting step motor effort
I suggest that if the answer involves the Arduino, the question might be appropriate to this forum.
If you can mount your stepper motor in such a manner as to apply pressure to a force sensor, you ...
2
votes
Arduino Uno + MSD-11-EM stepdriver + NEMA 17
I still wonder how code which I have posted earlier worked but no worries code below is working as expected.
int dirpin_T1 = 7;
int dirH_T1 = 8;
int steppin_T1 = 9;
void setup() {
pinMode(dirpin_T1,...
2
votes
Accepted
Question about Variables
Based on your description, the program needs to know only the new target setting and the current position. That means you need two variables. Algorithmically, it would look as follows (written in C-...
2
votes
Run two stepper at same time
The method to produce simultaneous pulses is simple, but requires a different approach similar to Direct Digital Synthesis (DDS).
Keep one counter variable per motor
Increment each counter variable ...
2
votes
I want to make my stepper motor work for 1 hour
The problem you have is you are treating minutes and hours separately. That won't work - they need to be combined. As it stands your "on" time is:
Minutes greater than W, and
Hours greater than X, ...
2
votes
Accepted
Problem in reading data from encoder with arduino
In my experience (industrial encoders and PLCs) when the output don't change when the motor shaft is rotated its usually one of the following:
The set screw connecting the motor shaft to the encoder ...
2
votes
Arduino Clock Speed effect on Stepper Speed
Without seeing the rest of your code, the best guess - and I think it is quite likely - is the use of delay() and printing within the stepper function. With 2 motors running, and even ignoring the ...
2
votes
Accepted
Can you drive a stepper motor without the L293D
Depending on the type of stepper motor the answer can be "Yes" or "No".
There are two types of stepper motor: Unipolar and Bipolar. Bipolar motors typically have 4 wires and require a H-bridge to ...
2
votes
Execute code only once
If you have any code you want to run only once at the beggining of your program you can use the setup() method. It can actually do much more than just setting up pins and default values.
The code of ...
2
votes
Accepted
Can I control a 28BYJ-48 5V stepper with a DVR8825 driver?
Stepper motors are rated in two different ways. Some provide a "rated voltage" in combination with a "DC resistance", others provide a "phase current" and a "phase resistance". The way they operate is ...
2
votes
Arduino doesnt seem to be reading my pin states
Thanks all of you,
Indeed there is nothing wrong with my code. The problem is indeed in the pull-down resistors, I rebuild the connection on a breadboard and works perfectly. I will have to check my ...
2
votes
Accepted
Stepper motor driver not working properly
The "metal screw" is a "trim potentiometer" that is used to set the current used to drive the motor. It sounds like you may be altering the current when you push against it. Try ...
2
votes
Accepted
Serial Communication to Control Stepper
You have 2 problems, which are already mentioned in the comments:
You call Serial.end() after you received one line. That will stop the Serial hardware. Thus the code will only receive one line and ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
stepper × 202arduino-uno × 88
motor × 53
stepper-motor × 28
arduino-mega × 21
programming × 13
a4988 × 10
servo × 9
button × 9
arduino-motor-shield × 8
arduino-nano × 7
l298n × 7
library × 6
power × 5
adafruit × 5
sensors × 4
shields × 4
code-review × 4
electronics × 4
c++ × 3
i2c × 3
timers × 3
loop × 3
hc-sr04 × 3
esp8266 × 2