본문 바로가기

카테고리 없음

Driving Bipolar Stepper Motors By Pic 16f84 Projects



STEPPER MOTOR USING PIC MICROCONTROLLER,In this tutorial, you will learn to interface a stepper motor with PIC16F877A microcontroller. A stepper motor is a kind of a motor that converts electrical pulses into mechanical movement. Unlike all conventional motors, a stepper motor advances in steps. These steps of the motor are measured in degrees and can vary as per its application. It takes one step at the time and the size of each step is equal to the other.

Motor

/*-----EasyDriver_Pot_01.ino Arduining 31 MAY 2015 Stepper motors following a potentiometer on analog input 0. A software low-pass filter is used to reduce the noise in the analog reading. The ENABLE signal is used to shut-down the current and keep the motor cold.

There are three excitation modes of a stepper motor;wave drive, full driveand half drive. In wave drive mode, only one winding is energized at a given time, whereas in full drive mode, two phases are energized at the same time. The number of steps, however, are same in both wave and full drive modes. Half drive mode combines both wave drive and full drive i.e. it energizes one and two phase alternatively. TASK

To drive a stepper motor using PIC microcontroller

CIRCUIT DIAGRAM FOR STEPPER MOTOR USING PIC microcontroller :

Circuit diagram of stepper motor interfacing with pic16f877a microcontroller is given below:

The easiest way of interfacing a stepper motor with a microcontroller is via ULN2003 transistor array chip. This IC has seven Darlington transistor drivers and is used for high current torque motors. In the circuit diagram, the four input pins (1B, 2B, 3B, 4B) of ULN2003 are connected to the lower significant bits of PORTD of the microcontroller and the output pins (1C, 2C, 3C, 4C) are connected to the ‘live’ pins of the stepper motor as shown above.

The ‘common’ pins of the stepper motor, together with ‘COM’ pin of ULN2003 are hooked up to a 12V battery supply.

Stepper motor speed

Bipolar Stepper Motor Wiring

The speed of the stepper motor can be increased or decreased via Proteus as well. For this purpose, right click on the stepper motor and select ‘Edit Properties. The window on the right will appear on the screen.

For a 200 step motor, a complete rotation (360°) is divided into 200 steps. This gives the size of a single step which is equal to 1.8°. You can vary the number ofsteps as well as the step angle using Proteus, the effects of which will be visible during simulation.

C-CODE FOR STEPPER MOTOR INTERFACING WITH PIC MICROCONTROLLER

Driving Bipolar Stepper Motors By Pic 16f84 Projects

Write the following code in the mikroC code editor window:

  1. void main()
  2. {
  3. TRISD = 0b0000000; // PORT D as output port
  4. PORTD = 0b1111111;
  5. do
  6. {
  7. PORTD = 0b00000011; // energizing two phases at a time
  8. Delay_ms(500); // delay of 0.5s
  9. PORTD = 0b00000110;
  10. Delay_ms(500);
  11. PORTD = 0b00001100;
  12. Delay_ms(500);
  13. PORTD = 0b00001001;
  14. Delay_ms(500);
  15. }while(1); // loop executed infinite times
  16. }
Pic

The above code represents the working of a stepper motor in full drive mode. For wave drive and half drive modes, slight changes will be required in the above code. The circuit diagram, however, remains the same. The PORTD of the controller has been declared as an output port which is fed to the driver IC ULN2003. The combination of bits from PORTD of the controller is transferred to the input pins of the IC, which enables it to switch the different coils of the motor on and off.

APPLICATIONS :

Bipolar Stepper Driver Circuit

Stepper motors are used immensely in our daily life. They are used in automobiles, digital photocopiers, computer printers, to move the print head carriage, and other home appliances. Stepper motors are also used in industrial machines, security and medical equipments.

Bipolar Stepper Motor Driver

To dowload circuit diagram and code of stepper motor control using pic microcontroller click on following link :

you can help us and others by sharing this article with your friends. Thanks 🙂

Bipolar Stepper Motor Tutorial

Hi All, I have some small stepper motors which I want to put into a small CNC project. The motors are Japan Servo Co. KH42KM2R053 1.2 Amp 3.1/2.3 Ohm 1.8 Deg step.
Can you give me some recommendations for driving these motors? I was thinking of using a PIC and tc4423 or 4469 with FETs. I really want to Microstep these motors. As I said this is a small setup but I want to have good accuracy. I don't want to discuss the mechanics just the electronics and maybe the driving software/controller interface.
I have looked at various chips and just want some advice.
I hope someone can help.
Thanks