Skip to main content
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 ...
gilhad's user avatar
  • 1,420
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 ...
Nick Gammon's user avatar
  • 38.7k
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 ...
Chris Stratton's user avatar
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 ...
Majenko's user avatar
  • 106k
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 ...
duck's user avatar
  • 1,258
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 ...
jose can u c's user avatar
  • 6,974
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.
Mitu Raj's user avatar
  • 424
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 ...
jose can u c's user avatar
  • 6,974
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 ...
user's user avatar
  • 56
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' ...
Majenko's user avatar
  • 106k
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);
Esteban Garcia-Gurtubay's user avatar
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.
Majenko's user avatar
  • 106k
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 ...
James Waldby - jwpat7's user avatar
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 ...
Edgar Bonet's user avatar
  • 44.3k
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 ...
chrisl's user avatar
  • 16.5k
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 ...
chrisl's user avatar
  • 16.5k
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 ...
Ozoid's user avatar
  • 101
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 ...
Peter Paul Kiefer's user avatar
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: ...
Majenko's user avatar
  • 106k
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 ...
chrisl's user avatar
  • 16.5k
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(...
liaifat85's user avatar
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 ...
the busybee's user avatar
  • 2,200
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 ...
lornix's user avatar
  • 141
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 ...
JRobert's user avatar
  • 15.3k
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 ...
Dave Johnson's user avatar
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 ...
vu2aeo's user avatar
  • 81
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 ...
Sigma's user avatar
  • 296
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". ...
Majenko's user avatar
  • 106k
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 ...
Sonali_B's user avatar
  • 443
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 ...
sempaiscuba's user avatar
  • 1,032

Only top scored, non community-wiki answers of a minimum length are eligible