CNC Stepper ConTroller

A. PREFACE



        This topic purpose to support the CNC controller, but the technique is universal. So it is relevant to any other stepper motor controller to run on any other machine, or to use it in robotic field. Stepper motor usually 2-phase or 4-phase and have the coil configured as bipolar or unipolar type. This type is universal and have many way to drive it. But I got the 5-phase stepper, not usual and hard to find controller to drive it.
        Controlled using a stepper motor is an open loop controlled system, it means the result can not be precisely handle any error caused by disturbance or something else. The distance is equal to the number of step pulse given to stepper motor. If the load is too heavy then the controlled distance become disorder, and it must have to refer again to reference point.

EasyDriver Stepper Motor Driver 

B. EXPERIMENT

        Not like the universal bipolar or unipolar 2 phase stepper motor. Bipolar and unipolar stepper motor has many chip controllers and can be build from discrete part. But to run a 5-phase stepper motor, it takes more than that. My stepper motor have spec like this :
  • Vexta, 5-phase Stepping Motor, 6-cable, 
  • Type : A2487-9215 or A3380-9215,
  • 0.75A, 4 Ohm, 0.72Deg/Step, 
  • FH7-1413, 
  • Under license of Berger Lahr, 
  • Vexta, Oriental Motor Co. Ltd., 
  • Made in Japan.
I hacking the stepper motor and found the connection is star connection with one cable is the center tap.
        At first, I search the net to find how to run the stepper, I found Prof. Douglas W. Jones tutorial, show algorithm how to run the star type stepper motor for 5-phase coils. This program contains a good example to run the stepper. See also the http://www.stepperworld.com/, it contain tutorial how to run stepper motor, the technique to control it. Then I make some modification to run it from lpt parallel port. Here is the test program if you want to see it. The circuit attach to the lpt parallel port directly for data pin 2~6 connect related to coil 1~5 driver of stepper motor, using bipolar transistor. I put the rating voltage for 5V because the stepper motor rating only for 3V max. Check by tester to the motor voltage only about 1.3V and the current only about 0.4A, but it runs. Here is the circuit layout :
5-Phase Stepper Motor Controller Test Circuit Diagram (19.144 Bytes)
It doesn't have big torque yet, not a problem. I try to test the speed, it's only about 25 rpm (12.500 steps/minute) or only about 208 step/sec. This is of course very slow to run the threadrod, because I used about 20 tpi pitch. It just travel about 1 inch more per minute. It takes to slow. Up to this speed the motor start to buzzing and the moving not continuously. I try to read some chip controller data book. I found that if the frequency rise, the torque will become low, for high frequency the fluxtuation of magnetic field in the coil not get the maximum, because the voltage not get to maximum also. To rise this frequency, I must put the higher voltage to the motor, so the rise and fall time of the changing magnetic fluxtuation can be made more vertical slope. This information also discuss at internet CNC forum and other FAQ's. But I think that I must try this motor anyhow. So I surf the net .....
        Here are a few relevant infos, due to this project. First, Scott Stephens CNC PCB drill. He made his card using PIC microcontroller, but for bipolar type stepper motor. Good resource. Second, JAL, a pascal style PIC micro chip compiler, but still a primitive design, not like commercial product yet. Most important things that this is a free (based on GNU licence) design by Wouter Olaf van Ooijen. Many explanation about PIC micro types, designs, and kits, etc. Most a very good resource. Expecially for me, I am not to good in C programming, because it is too hard to follow the rules, also added by the complexity of the compiler rules itself, give me a dizzy. This JAL style more like Pascal style, it is more easy to follow.  

C. SCHEMATIC

        Here are the schematic for this PIC micro project. I need 3 inputs to control (this refer to the schematic block diagram for CNC made by Kelly, KCAM), ie: step, direction, and enable inputs.
  • Step input is an active low signal, 
  • Direction is CW for positive signal and CCW for negative signal,
  • Enable is active low signal, if low it will keep, if high then motor is free wheel. This function is also for power saving option,
The output run from a commercial power supply. I got these power supply for CB batery charger. the output about 13.8V/1.5A. So I used a resistor to cover this over voltage, since the motors are for 3V/0.75A. I used the power transistor C1061 or H1061 type, since this type already try before at my relay board project. In fact that this type is for 15A max current. But note that, I don't need a heatsink to this transistor. The others output 5-leds for monitoring the stepping sequence. It may be omitted and the spare I/O can be used for another purpose, like current limiter or something else. It is up to your choice, because the PIC can be reprogrammed. For this design I use PIC16F84A type and I choose the I/O map like this :
  • I/O port A-0 = LED indicator phase-1 stepper
  • I/O port A-1 = LED indicator phase-2 stepper
  • I/O port A-2 = LED indicator phase-3 stepper
  • I/O port A-3 = LED indicator phase-4 stepper
  • I/O port A-4 = LED indicator phase-5 stepper
  • I/O port B-0 = Coil phase-1 stepper
  • I/O port B-1 = Coil phase-2 stepper
  • I/O port B-2 = Coil phase-3 stepper
  • I/O port B-3 = Coil phase-4 stepper
  • I/O port B-4 = Coil phase-5 stepper
  • I/O port B-5 = Input step pulse
  • I/O port B-6 = Input direction
  • I/O port B-7 = Input enable motor
Note that for I/O port A-4 pin, because this I/O is an open collector type I/O. It can not sink or source any self current. Another I/O are totem pole I/O. If you don't know that, when you experiment with it, as if this I/O was broken.

New FREESCALE SEMICONDUCTOR FREESCALE SEMICONDUCTOR Integrated 8-Ch Stepper Motor Controller

D. LAYOUT

        To wiring the component, I design a PCB layout to fit this purpose. Here is one of this design and tested as my prototype. It work good. I made 3 of it to run my CNC drilling machine (XYZ table).

E. PART LIST

        Here are the part list for this stepper controller :
   1. Resistors :
      R1 ~ R5 = 220 Ohm, 1/4W, 10% ..............5 pcs
      R6 ~ R10 = 1k, 1/4W, 10% ................. 5 pcs
      R11 ~ R15 = 12 Ohm, 10W, 10% .............5 pcs
      R16 ~ R19 = 4k7, 1/4W, 10% ............... 4 pcs
   2. Capasitors :
      C1 ~ C2 = 22 pF (for oscillator) ........... 2 pcs
      C3 = 100 nF (for IC decoupling, used as necessary)....1 pcs
   3. Semiconductors :
      IC1  = PIC16F84A (PIC microcontroller) ...........1 pcs
      Q1 ~ Q5 = C1061 or H1061 (NPN transistor) ........2 pcs
      D1 ~ D5 = 1N4007 (Silicon diode) .................5 pcs
      LED1 ~ LED5 = 3mm red ........................... 5 pcs
   4. Others :
      X1 = 4MHz (Crystal oscillator) ...................1 pcs
      Optional IC socket for 18-pins (use 20-pins) .... 1 pcs
      Optional terminal connector CON1, CON4 = 2 pin ...2 pcs
      Optional terminal connector CON2 = 4 pin .........1 pcs
      Optional terminal connector CON3 = 6 pin .........1 pcs

F. FIRMWARE

        PIC microcontroller IC needs to programmed with the specific programmer. Many commercial programmers can programmed this IC. But for this purpose ofcourse, I don't want to spend too much to these kind of programmer. So I used a selfmade PIC programmer. Many free design PIC programmer included with its software program on the net right now (search the net by types "PIC micro programmer). Some are free, some are shareware, many are comercial made. Some only for a specific type, some for a wide variety types. I choose a free one. I made the El-Cheapo PIC programmer, because I already have the PCB when I buy the book of Myke Predko (as a free bonus included with his book), also this is a simple one. It can programmed a few types of PIC micro from the small type to the large type. And the most important, it works. I already reprogrammed many-many times. But I change the original design to fit the last version (newer version, its V0.84 when I made this). This is  my PIC programmer looks like.
        For this stepper controller, I used JAL (free pascal compiler), but still limited development (all is free, include the source program base on GNU licence). More interesting to learn yet.
        For this 5-phase stepper controller sequence algorithm, I make the sequence like this :
  • If input disable then all output coil low (zero)
  • If input enable then keep the output with the last step
  • If input step low then check direction. If direction CW then increment step, else decrement step
  • Loop the process to the beginning
In my last experiment, I don't put delay between 2 pulses, so the timing keep up to the clock frequency. I hope that I could run the stepper motor as fast as possible. The speed about 70 RPM (600 steps/sec) could be make.
Here is the firmware for PIC-16F84A :
  1. 5-phase stepper controller final version (jal)
  2. 5-phase stepper controller final version (asm)
  3. 5-phase stepper controller final version (hex)
That's all ...!!!

G. APPLICATION

Running Small Motors with PIC Microcontrollers 

        To run the stepper board from PC, I need an interface to connect all the board and parts togethers. Here are the application to my CNC drilling machine, schematics for CNC LPT interface diagram and CNC block to block connection diagram. The PCB layout for this interface also already made like this. For this interface it takes a few component also. I used the relay board that I already design first when I fix my washing machine. Because I need only 2 relays for spindle motor and maybe for vacuum for next expand. Even the board reserved for 3 relays. Then the interface board can be build small enough. Here are the additional part list for this interface :
   1. Resistors :
      R1 ~ R12 = 4k7, 1/4W, 10% .......................12 pcs
      R13 ~ R15 = 1k, 1/4W, 10% ...................... 3 pcs
      R16 ~ R17 = 1k, 1/4W, 10% (for relay indikator led)  2 pcs
   2. Capasitors :
      C1 ~ C2 = 1000 uF/16V ..................... 2 pcs
   3. Semiconductors :
      IC1  = 7805 (Voltage Regulator) ........... 1 pcs
      Q1 ~ Q2 = C1061 or H1061 (NPN transistor) ... 2 pcs
      D1 ~ D2 = 1N4007 (Silicon diode) ............. 2 pcs
      LED1 ~ LED2 = 3mm red (for relay indicator) ...2 pcs
   4. Others :
      Optional power supply connector CON1, CON6, CON11 ...3 pcs
      Optional terminal connector CON2, CON4, CON5, CON7, CON9,
               CON10, CON12, CON14, CON15, CON19 = 2 pin ...10 pcs
      Optional terminal connector CON17 = 3 pin ........1 pcs
      Optional terminal connector CON3, CON8, CON13,
               CON18 = 4 pin .......................... 4 pcs
      LPT connector CON16 = DB25-F .....................1 pcs
      Optional terminal connector CON3 = 6 pin ......... 1 pcs

H. PROTOTYPE

        Here are the prototypes 5-phase stepper board, and cnc lpt interface also the relay board. For those of you which curious and enthusiasm or want to built also, here are the complete cnc controller package.

AUTONICS 5PFF9 Stepper Motor Controller, 2 Axis, 24VDC 

I. PENTA CONNECTION 5-PHASE STEPPER

        Some 5-phase stepper motor has star connection wiring, while the other is penta connection. For this kind of connection I already modified the firmware to control it but I didn't try it, please use it at your own risk. First of this firmware ask by a reader, Andy Evans, who has found the wiring schematic and the boolean truth table to run it. But he has difficulty to make the controller. The controller still use PIC16F84A type and some change to the I/O map are like this :
  • I/O port B-0 = Bridge Transistor SW1 drive
  • I/O port B-1 = Bridge Transistor SW2 drive
  • I/O port B-2 = Bridge Transistor SW3 drive
  • I/O port B-3 = Bridge Transistor SW4 drive
  • I/O port B-4 = Bridge Transistor SW5 drive
  • I/O port B-5 = Bridge Transistor SW6 drive
  • I/O port B-6 = Bridge Transistor SW7 drive
  • I/O port B-7 = Bridge Transistor SW8 drive
  • I/O port A-0 = Bridge Transistor SW9 drive
  • I/O port A-1 = Bridge Transistor SW10 drive
  • I/O port A-2 = Input step pulse
  • I/O port A-3 = Input direction
  • I/O port A-4 = Input enable motor
All of the I/O are used. To make it easy, I put all the port B I/O to drive the transistor, and some of  port A. While the control signal put at the rest of port A. You can change it as your purpose, but remember to change the firmware too. No need I/O for selected input for half or full step, because the sequence only for half step purpose, besides that the I/O already run out. Here is the complete firmware for this 'penta 5-phase stepper controller' by my concept and design. Have a good luck!
        Recently, I got somewhere from the net, 5-phase penta connection stepper and the sequence to run it (in full step). May be it's helpful to another person.

No comments:

Post a Comment

Labels

PROJECTS 8086 PIN CONFIGURATION 80X86 PROCESSORS TRANSDUCERS 8086 – ARCHITECTURE Hall-Effect Transducers INTEL 8085 OPTICAL MATERIALS BIPOLAR TRANSISTORS INTEL 8255 Optoelectronic Devices Thermistors thevenin's theorem MAXIMUM MODE CONFIGURATION OF 8086 SYSTEM ASSEMBLY LANGUAGE PROGRAMME OF 80X86 PROCESSORS POWER PLANT ENGINEERING PRIME MOVERS 8279 with 8085 MINIMUM MODE CONFIGURATION OF 8086 SYSTEM MISCELLANEOUS DEVICES MODERN ENGINEERING MATERIALS 8085 Processor- Q and A-1 BASIC CONCEPTS OF FLUID MECHANICS OSCILLATORS 8085 Processor- Q and A-2 Features of 8086 PUMPS AND TURBINES 8031/8051 MICROCONTROLLER Chemfet Transducers DIODES FIRST LAW OF THERMODYNAMICS METHOD OF STATEMENTS 8279 with 8086 HIGH VOLTAGE ENGINEERING OVERVOLATGES AND INSULATION COORDINATION Thermocouples 8251A to 8086 ARCHITECTURE OF 8031/8051 Angle-Beam Transducers DATA TRANSFER INSTRUCTIONS IN 8051/8031 INSTRUCTION SET FOR 8051/8031 INTEL 8279 KEYBOARD AND DISPLAY INTERFACES USING 8279 LOGICAL INSTRUCTIONS FOR 8051/8031 Photonic Transducers TECHNOLOGICAL TIPS THREE POINT STARTER 8257 with 8085 ARITHMETIC INSTRUCTIONS IN 8051/8031 LIGHTNING PHENOMENA Photoelectric Detectors Physical Strain Gage Transducers 8259 PROCESSOR APPLICATIONS OF HALL EFFECT BRANCHING INSTRUCTIONS FOR 8051/8031 CPU OF 8031/8051 Capacitive Transducers DECODER Electromagnetic Transducer Hall voltage INTEL 8051 MICROCONTROLLER INTEL 8251A Insulation Resistance Test PINS AND SIGNALS OF 8031/8051 Physical Transducers Resistive Transducer STARTERS Thermocouple Vacuum Gages USART-INTEL 8251A APPLICATIONs OF 8085 MICROPROCESSOR CAPACITANCE Data Transfer Instructions In 8086 Processors EARTH FAULT RELAY ELECTRIC MOTORS ELECTRICAL AND ELECTRONIC INSTRUMENTS ELECTRICAL BREAKDOWN IN GASES FIELD EFFECT TRANSISTOR (FET) INTEL 8257 IONIZATION AND DECAY PROCESSES Inductive Transducers Microprocessor and Microcontroller OVER CURRENT RELAY OVER CURRENT RELAY TESTING METHODS PhotoConductive Detectors PhotoVoltaic Detectors Registers Of 8051/8031 Microcontroller Testing Methods ADC INTERFACE AMPLIFIERS APPLICATIONS OF 8259 EARTH ELECTRODE RESISTANCE MEASUREMENT TESTING METHODS EARTH FAULT RELAY TESTING METHODS Electricity Ferrodynamic Wattmeter Fiber-Optic Transducers IC TESTER IC TESTER part-2 INTERRUPTS Intravascular imaging transducer LIGHTNING ARRESTERS MEASUREMENT SYSTEM Mechanical imaging transducers Mesh Current-2 Millman's Theorem NEGATIVE FEEDBACK Norton's Polarity Test Potentiometric transducers Ratio Test SERIAL DATA COMMUNICATION SFR OF 8051/8031 SOLIDS AND LIQUIDS Speed Control System 8085 Stepper Motor Control System Winding Resistance Test 20 MVA 6-digits 6-digits 7-segment LEDs 7-segment A-to-D A/D ADC ADVANTAGES OF CORONA ALTERNATOR BY POTIER & ASA METHOD ANALOG TO DIGITAL CONVERTER AUXILIARY TRANSFORMER AUXILIARY TRANSFORMER TESTING AUXILIARY TRANSFORMER TESTING METHODS Analog Devices A–D BERNOULLI’S PRINCIPLE BUS BAR BUS BAR TESTING Basic measuring circuits Bernoulli's Equation Bit Manipulation Instruction Buchholz relay test CORONA POWER LOSS CURRENT TRANSFORMER CURRENT TRANSFORMER TESTING Contact resistance test Current to voltage converter DAC INTERFACE DESCRIBE MULTIPLY-EXCITED Digital Storage Oscilloscope Display Driver Circuit E PROMER ELPLUS NT-111 EPROM AND STATIC RAM EXCITED MAGNETIC FIELD Electrical Machines II- Exp NO.1 Energy Meters FACTORS AFFECTING CORONA FLIP FLOPS Fluid Dynamics and Bernoulli's Equation Fluorescence Chemical Transducers Foil Strain Gages HALL EFFECT HIGH VOLTAGE ENGG HV test HYSTERESIS MOTOR Hall co-efficient Hall voltage and Hall Co-efficient High Voltage Insulator Coating Hot-wire anemometer How to Read a Capacitor? IC TESTER part-1 INSTRUMENT TRANSFORMERS Importance of Hall Effect Insulation resistance check Insulator Coating Knee point Test LEDs LEDs Display Driver LEDs Display Driver Circuit LM35 LOGIC CONTROLLER LPT LPT PORT LPT PORT EXPANDER LPT PORT LPT PORT EXTENDER Life Gone? MAGNETIC FIELD MAGNETIC FIELD SYSTEMS METHOD OF STATEMENT FOR TRANSFORMER STABILITY TEST METHODS OF REDUCING CORONA EFFECT MULTIPLY-EXCITED MULTIPLY-EXCITED MAGNETIC FIELD SYSTEMS Mesh Current Mesh Current-1 Moving Iron Instruments Multiplexing Network Theorems Node Voltage Method On-No Load And On Load Condition PLC PORT EXTENDER POTIER & ASA METHOD POWER TRANSFORMER POWER TRANSFORMER TESTING POWER TRANSFORMER TESTING METHODS PROGRAMMABLE LOGIC PROGRAMMABLE LOGIC CONTROLLER Parallel Port EXPANDER Paschen's law Piezoelectric Wave-Propagation Transducers Potential Transformer RADIO INTERFERENCE RECTIFIERS REGULATION OF ALTERNATOR REGULATION OF THREE PHASE ALTERNATOR Read a Capacitor SINGLY-EXCITED SOLIDS AND LIQUIDS Classical gas laws Secondary effects Semiconductor strain gages Speaker Driver Strain Gages Streamer theory Superposition Superposition theorem Swinburne’s Test TMOD TRANSFORMER TESTING METHODS Tape Recorder Three-Phase Wattmeter Transformer Tap Changer Transformer Testing Vector group test Virus Activity Voltage Insulator Coating Voltage To Frequency Converter Voltage to current converter What is analog-to-digital conversion Windows work for Nokia capacitor labels excitation current test magnetic balance voltage to frequency converter wiki electronic frequency converter testing voltage with a multimeter 50 hz voltages voltmeter

Search More Posts

Followers