603,348 active members*
3,243 visitors online*
Register for free
Login
IndustryArena Forum > OpenSource CNC Design Center > Open Source Controller Boards > Making a stepper driver with pic18 using C
Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2013
    Posts
    4

    Making a stepper driver with pic18 using C

    Hi I'm new here and trying to understand how to drive a stepper with a pic18 using C18. Ive got TEA3718 to use as driver and was thinking of just doing half step at first just to get the ball rolling.

    I'm hopefully going to implement micro-stepping with these drivers but the idea of varying vref is confusing me. The idea as I understand is to create a sinusoidal wave but I'm confused as to were this comes in. Dose it transition one half cycle per step to create micro-steps and hold if the motor is stopped.

    I'm going to try and hook it up as the data sheet says first just to get going assuming all I have to do it transition the pins in0 in0 an ph in the correct cycle and duration.

    Is the any open source code written in C preferably for pic but any will do to be honest every thing I seem to find is either using H bridges or written in ASM

    Any help much appreciated.

  2. #2
    Join Date
    Apr 2003
    Posts
    131
    I happen to sell a PIC based stepper translator IC already, which has code downloadable too if you want to take a peek.

    DAK Engineering - U2 Stepper Translator

    This is selectable half/full step.

    If you want to do micro-steps use the same principles, but you need to ratio the current in a sine wave fashion for each step (so divide the cycle entire by 8,16, etc rather than 4 or 8).

    This incredibly helpful link that I leaned on when I first started out has equations, evaluate them for 90 degree intervals (full step) and you'll see what's going on:

    Jones on Stepping Motor Microstepping

    Of course, you're probably much farther ahead merely buying commercial drives (Gecko, Xylotex), and moving forward unless you're completely broke or just want to explore the fundamentals more.
    -Dave Kowalczyk
    Author of TurboCNC --> http://www.dakeng.com

  3. #3
    Join Date
    Nov 2013
    Posts
    4
    Hi just been looking at your site cheers for the heads up. I think Ive got it down just wiring my circuit up and gonna try and get some movement after mplabx stops hating my new laptop..

    Its more for the fun than anything Ive actually got some driver boards knocking around from a old cnc but were would be the fun it that.

    Thanks for the help much appreciated.

  4. #4
    Join Date
    May 2005
    Posts
    1397
    There is some C code for a version of the Linistepper driver here:
    Please title this page. (mod-hazimin-sdccc-stepdir.htm)
    James hosts the single best wiki page about steppers for CNC hobbyists on the net:
    http://www.piclist.com/techref/io/steppers.htm Disagree? Tell him what's missing! ,o)

  5. #5
    Join Date
    Nov 2013
    Posts
    4
    Thanks James this exactly what I was looking for. Ive been on your site before but somehow overlooked the code written in c.

Similar Threads

  1. Replies: 0
    Last Post: 02-26-2013, 08:37 AM
  2. KP8M2-001 motor need help for making driver
    By briobit in forum Stepper Motors / Drives
    Replies: 8
    Last Post: 10-26-2010, 01:35 PM
  3. 6 leads stepper motor connect to TB6560AHQ stepper driver board
    By wf1318 in forum Stepper Motors / Drives
    Replies: 2
    Last Post: 07-25-2010, 08:19 AM
  4. STEPPER DRIVER FAQ {Stepper/driver amp per phase match.
    By huios in forum Stepper Motors / Drives
    Replies: 0
    Last Post: 08-27-2006, 02:43 PM
  5. have anybody making servo driver?
    By masaV in forum Servo Motors / Drives
    Replies: 0
    Last Post: 06-20-2005, 09:10 AM

Posting Permissions

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