We changed our privacy policy. Read more.

Hot answers tagged

5

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 over long time and so the driver have more stable power and works generally better. Also it protects the driver from noise of other parts. the other is protect ...


4

use disable output class in accelstepper library. http://www.airspayce.com/mikem/arduino/AccelStepper/


4

It would be more accurate to say that it can be used as part of a microstepping system, though it's probably not a good choice for any use today. The L293D is merely an (effectively obsolete implementation of an) H-bridge, not a stepper motor sequencer, hence it is no more capable of autonomously driving a motor in full or half step mode than it is of ...


4

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 timing methods.


4

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 depending on the motor you used. For more information, you can check here. You have to check for your motor stepper resolution. Most common motor stepper has ...


4

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 delay of the provided number of milliseconds. The argument is an unsigned long which on a 16-bit Arduino is a 32-bit unsigned integer type, having a maximum ...


4

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 detail at what those pins are and how they are being used. In your example you have SPI being used (pins 10-13) for one shield and PWM (3/11) and GPIO (8/9/12/13)...


4

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

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 number generator so the pattern of random numbers you will get later doesn't always give the same results each time you start the sketch. In your delay() call, ...


3

According to Pololu's website, the VMOT pin needs at least 8V to function. Try a 12V switching (important!) wall wart supply that can supply at least 1A instead of your USB supply. Avoid supplies that can deliver currents >3A, as they are overkill for a small stepper motor and can be dangerous if shorted. Be sure to put a large (100uF is good) capacitor ...


3

1) it is probably something like A1, A2, Common, B1, B2. You could confirm this with an ohmmeter. Common to any of the others would be a certain resistance X, while between any of the others (A1-A2, B1-B2, A1-B1, A1-B2, B1 A2) would be 2X. 2) You can't. It is a unipolar stepper. The EasyDriver faq number 5.1 at http://www.schmalzhaus.com/EasyDriver/ ...


3

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

I'd look for a proper stepper driver, e.g. something based on A4988 or similar. I wasted a fair amount of time on the Adafruit motor-shield 2.3 until I finally abandoned it after failing to achieve higher speeds (I also had lots of issues with the motor getting hot). The A4988 takes care of step sequencing including micro-stepping and interfacing and ...


3

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 implementation. The math We are dealing with a frequency-modulated signal, with the frequency ramping linearly from f = 0 at t = 0 up to a ...


3

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 because of overhead causing poor resolution or jitter. Using timer 1 in a PWM mode offers an advantage: loading of the OCR1A register is double buffered in PWM ...


3

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' and give it the value 0", and that happens every time loop() is executed. Instead making it static will change it so that it only happens the first time loop()...


3

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

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 them. The driver does not make smaller steps than 1 full step, if you don't tell him on extra pins (The library you use can utilize those pins too). So the ...


3

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 the correct order. These motors seem to work with an activation pattern for half steps (I don't know, if the motor is really doing half steps with this, ...


3

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 it has to be like that. Then, if the motor vibrates or click, it may be one of these problems: You didn't connect the motor properly The current is set too low ...


3

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 Amps for any length of time. You will also need to set the vREF correctly for the motors you are using - if this is not set you will either provide too little ...


3

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 too and thus the speed is constant. If you control just one motor the method of using delays to control the frequency works. But in the case of two motors with ...


3

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: 1001001 If we line those up it's then like: SR3: 1110010 SR4 1001001 You can now see the overlap. So taking SR3 and shifting it left two places (sr3 <&...


2

I have two ideas: I don't have personal experience working with the AccelStepper Library, but I believe it implements a class that allows you to work with multiple steppers. I plan on controlling two steppers for a project of my own (a self-balancing robot implemented with an STM32 processor), and I plan on using hardware timer interrupts to control the ...


2

You need a struct for each stepper with a timestamp, a position and rate of change and a loop that updates the postion based on rate which is the change in position over some time: struct stepper { unsigned long timestamp; int position; int rate; }; // init steppers array while (keepGoing()) { unsigned long now = millis(); int si; delay(10); ...


2

On stepper motors there are a few types of wiring, but essentially there are two coils inside the stepper motor. To figure out where the wiring is you need a way to test if the coils are being connected. On your setup I would suggest to connect two of the wires together at a time and spin the shaft. If the shaft offers resistance then you have found the two ...


2

I don't quite understand the problem. A arduino mega would have no problem controlling 9 of these steppers alone. If you are asking about i2c protocol please be more specific about what you need help with.


2

How did you set the amps on the http://www.schmalzhaus.com/EasyDriver/ to 0.5A? What was the voltage at the test point? The EasyDriver v4.5 schematic says the formula for coil current is A = V/6. So rearranging, V=A*6, and to get 0.5A, the voltage should be 0.5*6=3V at the motor driver's test point. The linked motor spec is 0.6A max per coil, and if ...


2

If you follow JayEye's approach (ie, use five MCP23017 units to connect 80 switches, and five more to connect 80 LEDs) the wiring and the software should be fairly simple. But dealing with all the wires will be a problem unless you use a custom printed circuit board to mount all the switches, LEDs, wiring traces, and connectors. If you have experience with ...


2

Since microcontrollers typically only have one "core" or "thread" they can only do "one thing at a time". A microcontroller will step through your code and do everything in order (if you don't call interrupts). Basically, when you put in a for-loop (or any other type of loop) or a delay, it will only continue with the rest of your code when that is done. ...


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