603,897 active members*
3,515 visitors online*
Register for free
Login
IndustryArena Forum > CNC Electronics > PIC Programing / Design > dual axis 16f628a stepper driver
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2009
    Posts
    5

    dual axis 16f628a stepper driver

    I have been working on some code to drive two steppers from step/dir inputs on a pic 16f628a.
    it also has full/half step modes.
    Its written in C, compiled using the open source SDCC
    To control actual motors, its a simple task of hooking up some FET's or power transistors to the outputs and drive bipolar motors. and of course hooking up the inputs to a pc parallel port and running EMC2 etc..

    some improvements I would like to make:
    -Use a pic16f88 with analogue feedback to regulate current, maybe attempt microstepping, like the linstepper but using fets and pwm
    -Use the USART and write a driver for EMC2 to allow 3 steppers to be controlled from one chip. anyone have any experience in this? maybe EMC already supports rs232 output?
    Attached Files Attached Files

  2. #2
    Join Date
    Sep 2007
    Posts
    17
    Usually to get current feedback you could use a shunt resistor with a known millivolt output per amp of current - like 50mv/amp so you know that an analog output of 2 amps would produce a 100mv "drop" across the shunt that you would feed back to your AD (Analog to Digital device) if you wanted to request the current reading.

    If you were setting limits on current for over current purposes you could feed this analog voltage back to a Magnitude Comparator (like an LM339) this would give you a more immediate over-current protection (real time instead of having to process the analog signal to digital conversion)

    Don't know what EMC2 is, know of the PIC MPU's but have never used one always stayed with the more conventional stuff like the Z80, 8088, 80286 CPU's but my guess would be that yes you could write a drive in "C" using ASCII code and knowing the protocol of the receiving device -- like start bits, stop bits, parity checking, baud rate, non-printable ASCII code that may be required like CR (carriage return) and LF (line feed).

    I write code in VB for many serial devices -- a good book on the subject would be Jan Axelson's "Serial Port Complete".

    Hope this helps.

    Norm P

  3. #3
    Join Date
    Jan 2011
    Posts
    0
    Quote Originally Posted by yaycnc View Post
    I have been working on some code to drive two steppers from step/dir inputs on a pic 16f628a.
    it also has full/half step modes.
    I've programmed and tested this hex by building a test circuit on breadboard and it seems to work pretty damn well.

    Would there any issues with timing by running 2 motors from one pic and using just the internal oscillator? is there a limit to how fast the motors could spin other then what their limit is anyway?

Similar Threads

  1. Mechatronics 3 Axis Stepper Motor Driver
    By Chaka in forum LinuxCNC (formerly EMC2)
    Replies: 8
    Last Post: 02-10-2009, 08:21 PM
  2. Dual Z axis and Dual Spindle
    By Adamj12b in forum Mach Software (ArtSoft software)
    Replies: 3
    Last Post: 08-28-2008, 09:15 PM
  3. 3 axis stepper motor driver using a single PIC
    By david90 in forum PIC Programing / Design
    Replies: 5
    Last Post: 04-06-2008, 03:22 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •