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
Maximum Delay time
Note: there's an existing question here this should be closed as a duplicate of, but that is proving hard to find. So until someone does find it...
The arduino delay() function creates a blocking ...
4
votes
Accepted
How can I know if I can stack some shield on another shield?
First you have to compare the pinouts of the two shields. If the shields use completely different pins then yes, you can use them together.
However if they share pins then you need to look in more ...
4
votes
Accepted
How can I use stepper for specific degree?
stepper.step(num)is used to rotate your motor 'num'-step. i.e. num=25, then calling stepper.step will cause your motor do 25-step.
STEPS is number of steps per revolution for your motor. It will be ...
4
votes
HCSR04 Sensor without delay
Have you searched for other libraries or example code for this particular sensor?
I found this NewPing library that claims to have been developed to fix poor performance of such modules due to poor ...
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
Having some trouble incrementing counters
Make CTR static or place it in the global scope. As it stands you set it to 0 every time you go through loop.
The line:
int ctr = 0;
literally means "Create a new variable on the stack called 'ctr' ...
3
votes
Accepted
Arduino uno + cnc shield v3 + Stepper Motor Driver A4988 + AccelStepper?
Manually set the ENABLE pins as OUTPUTs, i.e. add in the setup() function:
pinMode(MOTOR_A_ENABLE_PIN, OUTPUT);
pinMode(MOTOR_B_ENABLE_PIN, OUTPUT);
3
votes
How to pull a pin low?
Connect it to an IO port and set it to OUTPUT and LOW. That's what it means to "pull low".
It helps if you understand how an IO port works. This may help you.
3
votes
Ensuring specific frequency at specific time?
As mentioned in comments and other answers, using timer 1 for hardware-timed bit toggling is likely to produce better results than code using delays based on calls like delayMicroseconds(), primarily ...
3
votes
Ensuring specific frequency at specific time?
Generating a linear frequency ramp with accurate timings is not an easy
task. I am providing here only a partial answer, where I first go
through the math of the problem, then give some ideas for the
...
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
Arduino - stepper motor wrong steps number
You're driving the stepper too fast, unintentionally though.
The while loop you use to delay is likely optimized out by the compiler:
while (tmp2++<Speed);
Easiest way to fix would be to declare ...
2
votes
Accepted
Most efficient method to turn a gear extremely slowly?
Steppers require current - and power, due to I^2*R losses) to hold a position. Power off, they free-wheel. What kind of efficiency do you need? A stepper might not be the most power efficient.
An ...
2
votes
Accepted
How to control a Nema 17 stepper motor with an arduino? (too much current / heat)
The stepper motor does not directly control or limit its own current. When using the L298n for stepper control, the motor current control is performed by a PWM signal to the L298n ENABLE pin. If you ...
2
votes
Which motors to choose?
You need to size your motors correctly depending on how much load they are expected to overcome. You first consideration should be how much maximum force would your robot need to exert at any given ...
2
votes
Which motors to choose?
A 12 volt DC motor is good for dragging items, but then again it depends on the items weight. Stepper is used for millimeter precision, like 3D printing. Servo is an DC motor with precision for 180 ...
2
votes
Stepper motor control
No, that will not do what you want. That will continuously rotate the stepper round and round and round.
The clue as to why is in the name of the function you put the myStepper.step call: "loop". ...
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
How can I swap a servo with a stepper motor?
Firstly, I'm going to assume that you got a ULN2003 Motor driver board something like this along with your 28-BYJ48 stepper motor.
Secondly, I would always recommend using a separate power supply for ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
stepper × 201arduino-uno × 88
motor × 54
stepper-motor × 31
arduino-mega × 22
programming × 12
a4988 × 10
servo × 9
button × 9
arduino-motor-shield × 8
power × 7
l298n × 7
arduino-nano × 6
library × 6
adafruit × 5
sensors × 4
shields × 4
electronics × 4
c++ × 3
i2c × 3
timers × 3
code-review × 3
loop × 3
hc-sr04 × 3
esp8266 × 2