Description: This project involves using an EasyDriver stepper motor driver and a 1.8-degree per rotation stepper motor to achieve a motor speed of one revolution per minute. The EasyDriver simplifies the operation, requiring a DC voltage of 7-30V connected to M+ and ground to GND. The stepper motor connects to terminals A and B, stepping with each LOW to HIGH transition on the STEP signal. The direction of rotation is determined by the DIR signal, which can be set to +5V or ground. The MS1 and MS2 pins define the step resolution, with the driver chip being an Allegro A3967SLB. The breakout board comes with pull-up resistors on both MS1 and MS2, setting it to eight-step resolution by default. These pins can be grounded individually to change the resolution. Improvements to the original design include a DIP switch for user-selected resolution and adjustable steps per minute, maintaining a constant one revolution per minute. An LED indicates each step, and a four-way DIP switch is used for step direction and enabling/disabling steps. The DIR signal is pulled up to +5V with a 10k resistor. The circuit is constructed on a strip board and utilizes an AtTiny25 microcontroller, clocked by a 32.768 kHz watch crystal. Proper fuse bits must be programmed for low-frequency crystal oscillators. The code uses Timer 0 in output compare mode, with adjustments based on the DIP switch settings.
The EasyDriver stepper motor driver facilitates the control of stepper motors by translating digital signals into precise motor movements. In this project, the driver is powered by a DC voltage range of 7-30V, allowing for flexibility in power supply selection. The connection of the stepper motor to the driver is straightforward, with terminals A and B designated for the motor phases. Each transition from LOW to HIGH on the STEP pin results in a single step of the motor, enabling precise control over its movement.
The direction of rotation is manipulated via the DIR pin, which can be set to either a HIGH (+5V) or LOW (ground) state. The MS1 and MS2 pins are critical for defining the step resolution, which influences the precision of the motor's movement. The default configuration of eight-step resolution is suitable for many applications, but the ability to alter these settings via grounding the MS1 and MS2 pins allows for customization based on specific requirements.
The integration of a DIP switch enhances user interaction, enabling the selection of step resolution and maintaining a constant speed of one revolution per minute regardless of the chosen resolution. This is achieved through the microcontroller's programming, which adjusts timer settings based on the DIP switch input. An LED indicator provides visual feedback for each step taken by the motor, enhancing the usability of the circuit.
The AtTiny25 microcontroller serves as the brain of the operation, with its clock driven by a low-frequency watch crystal. This choice of clock source is crucial for the timing accuracy of the stepper motor control. The code implemented utilizes Timer 0 in output compare mode, allowing for precise timing of the step signals. The adjustments made to the OCR0A register based on the DIP switch settings ensure that the motor operates at the desired speed and resolution.
In summary, this project exemplifies the effective use of an EasyDriver stepper motor driver in conjunction with an AtTiny25 microcontroller to achieve precise motor control. The incorporation of user-selectable features and visual indicators enhances the functionality and user experience of the circuit.This is a project I`ve done on behalf of a person on an internet forum. The requested operation is simple: Use an EasyDriver stepper motor driver and a 1. 8 deg/rotation stepper motor and make the motor turn one revolution per minute. This frees me up a bit not having to select and source products myself, nor having to implement the actual stepper driver myself. The EasyDriver is REALLY simple in operation. Connect 7-30v DC to M+ (and ground to GND), connect a stepper motor to A and B and the motor automatically steps once for each LOW->HIGH transition on STEP. The direction is dependent on the state of DIR (+5v or ground). MS1 and MS2 together defines the step resolution. The driver chip is a Allegro A3967SLB, so the truth table for MS pins can be found in it`s datasheet, page 2.
The breakout board has pull-up resistors on both MS1 and MS2, which puts it in eight-step resolution as standard. To alter MS1 and MS2 you simply pull them to ground individually based on your desired resolution. I decided to make a few improvements to the requested operation. Via a DIP-switch the user can select the resolution for the EasyDriver while simultaneously altering the steps/minute so it will always make one turn per minute even though the step resolution is changed.
There is also an LED to indicate each step. I used a four-way DIP switch, the two remaining switches I used for step direction and to simply turn the steps on or off. The DIR signal is pulled up to +5v by a 10k resistor My circuit is built on a strip board and is based on an AtTiny25.
It`s system clock is driven by a low frequency 32. 768kHz watch crystal. It`s important to program the correct fuse bits for low frequency crystal oscillators! On to the code. I`m using Timer 0 with system clock as clock source in output compare mode. The registers defining when an output compare interrupt hits is altered based on MS1 and MS2 signals on the DIP-switch. #include #include #define F_CPU 8000000UL #include #define DIV64 3 #define DIV8 2 #define FULL !(PINB & (1<#define HALF !(PINB & (1<#define QUARTER (PINB & (1<#define EIGHT (PINB & (1< //MS1 pin 7 PB2 //MS2 pin 6 PB1 void step (void) { PORTB = (1<} ISR(TIMER0_COMPA_vect) //Timer/Counter0 Overflow interrupt routine { step(); } int main (void) { uint8_t previous = 1; uint8_t current = (PINB & 36); //Port configuration DDRB |= (1< PORTB |= (1< //Timer initialization TCCR0A |= (1< TCCR0B = DIV64; //Timer/Counter0 prescaler TIMSK |= (1< OCR0A = 76; /* OCR0A values 300ms period (ordinary step) =76/div64 150ms period (half step) 37/div64 75ms period (quarter step) 18/div64 37.
5ms period (eight step) 76/div8 */ sei(); //Enable interrupts globally while(1) { current = (PINB & 3); if (current != previous) { if (FULL) { OCR0A=76; TCCR0B=DIV64; } else if (HALF) { OCR0A=37; TCCR0B=DIV64; } else if (QUARTER) { OCR0A=18; TCCR0B=DIV64; } else if (EIGHT) { OCR0A=76; TCCR0B=DIV8; } previous = current; } } return 0; }
A stepper motor provides a simple, low-cost, and precise method for position control. It can be driven by a circuit that is mounted near the motor and controlled by a microcontroller.
Stepper motors are widely utilized in applications requiring precise control...
Stepper motors are offered in various versions and sizes, accommodating a range of operating voltages. This general-purpose controller supports voltages from approximately 5 V to 18 V. It can drive the motor with a peak voltage equal to half the...
The following circuit illustrates a Stepper Motor Controller Circuit Diagram. This circuit is based on the 7404 IC. Features include a simple stepper motor.
The stepper motor controller circuit utilizing the 7404 IC is designed to drive a stepper motor with...
A new user is seeking to share information about their experiences on this platform.
The user expresses a desire to communicate and engage with the community regarding their experiences. This indicates an interest in exchanging knowledge and possibly seeking assistance or...
Stepper motors with unipolar drives are commonly utilized in applications that demand high torque and rapid positioning. The unipolar operation facilitates stable motor control through relatively simple firmware compared to bipolar drives. This application note examines the use of a...
A stepper motor controller is required to operate a stepper motor, as a stepper motor cannot function merely by connecting it to a power supply.
A stepper motor controller is an essential component for the effective operation of stepper motors,...
This circuit functions similarly to the one depicted in Fig. 57-4. The key differences include the placement of the field across the rectified supply and the armature being positioned within the SCR bridge. Therefore, the field current is unidirectional while...
Stepper motor interfacing with a microcontroller. Full-step and half-step stepper control. Working principles and basics of stepper motors. Tutorial on 6-lead unipolar stepper motors and bipolar stepper motors.
Stepper motors are widely used in various applications requiring precise control of angular...
This document outlines the design process of a control circuit for a stepper motor. Given the characteristics of the stepper motor, the control circuit was developed as a state machine that transitions through four output states depending on two input...
We use cookies to enhance your experience, analyze traffic, and (if you allow) serve personalized ads.
By clicking Accept All, you agree to our use of cookies.
Learn more