Page 1 of 12 123411 ... LastLast
Results 1 to 12 of 140

Thread: PIC-Based Step Generation With Linear Acceleration?

  1. #1
    Registered
    Join Date
    Feb 2006
    Location
    USA
    Posts
    3,539
    Downloads
    0
    Uploads
    0

    PIC-Based Step Generation With Linear Acceleration?

    Has anyone implemented a good step pulse generator with linear acceleration on a PIC? If so, what kind of step rates can you achieve with a 20MHz PIC?

    Regards,
    Ray L.


  2. #2
    Registered The Blight's Avatar
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    580
    Downloads
    0
    Uploads
    0
    Well it depends on many factors such as how many axis to move, how far... etc. If it is for single axis or rapid movement, then around 25khz. If you want multi axis movement, you will probably end up at around 15-20khz.

    It also depends on how you program the thing. I'm doing it with assembly all the way.

    PS. forgot to mention that this estimate is for a PIC18. PIC16 would use much longer time as it doesn't have a multiplication instruction.
    Last edited by The Blight; 12-01-2010 at 05:34 PM.


  3. #3
    Registered
    Join Date
    Oct 2005
    Location
    Australia
    Posts
    2,387
    Downloads
    0
    Uploads
    0
    You can do a steprate at 39062 Hz on a PIC 18 with the interrupt every 256 instructions.

    If you are good enough to do 3axis acceleration math *and* control everything with an int of 256 instructions... Well that's a different matter.


  4. #4
    Registered The Blight's Avatar
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    580
    Downloads
    0
    Uploads
    0
    So far I can do 2 axis in about 250 instructions. 3 axis takes about 400. This is with a maximum amount of steps at 2^32, and up to 2^16 steps per unit.


  • #5
    Registered
    Join Date
    Oct 2005
    Location
    Australia
    Posts
    2,387
    Downloads
    0
    Uploads
    0
    Is that with all the linear acceleration ramps running?

    I did it with full 3 axis and receiving serial comms on a 18F2221 but it was tight as heck, I had to use some inline assembler and some clever old-school tricks too. It's not for the faint hearted.


  • #6
    Registered Khalid's Avatar
    Join Date
    Apr 2006
    Location
    Pakistan
    Posts
    2,960
    Downloads
    0
    Uploads
    0
    Hi Roman,
    sometime i wish if i had a knowledge like you..
    http://free3dscans.blogspot.com/ http://my-woodcarving.blogspot.com/
    http://my-diysolarwind.blogspot.com/


  • #7
    Registered The Blight's Avatar
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    580
    Downloads
    0
    Uploads
    0
    With acceleration on all axis at the same time. And feedrate adjustments (10-100%).

    Because I'm writing everything in assembly, I can tailer the routines for a specific task.

    I'm using a SD card for programs with FAT16 support.

    I have been working on this project for several years now. About 2 times a year I get really inspired and work 8+ hours per day on it for a couple weeks. After that I'm pretty exhausted (it keeps me awake at night), and I end up getting so tired of it that I have to find something else to do for the next 6 months or so.

    One day it will get done!

    Roman, did you post your project here on the zone? I believe I have seen 2 or 3 projects of that kind.


  • #8
    Registered
    Join Date
    Oct 2005
    Location
    Australia
    Posts
    2,387
    Downloads
    0
    Uploads
    0
    Hi Khalid! I've seen your web pages, you have lots of specialist skills too!

    The_Blight- Doing SD and FAT16 in assembler is pretty hardcore. And I hear you re the getting burnt out thing, I'm sure we've all done that on some jobs when after a few days you just can't stand to look at it! These days I mainly do embedded in C with some inline assembler of the speed critical parts.

    Here's the link to my machine build, there's not a huge amount of info on the electronics but you may find it interesting;
    DIY hobby small plastics mill/router

    I threw the PIC18 3 axis controller together in a couple of afternoons work, but then I didn't have to do SD and FAT16 with it, just some serial comms and safety routines.

    I'm curious what your 2-axis controller is for? If it's for a PNP machine I have recently started a build for one myself;
    RomanLini's high speed light-weight PNP machine


  • #9
    Registered The Blight's Avatar
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    580
    Downloads
    0
    Uploads
    0
    Saved your link for later reading Never seen your build before, so I will enjoy it.

    About SD and FAT16, it takes quite a bit of reading to get it to work properly, but it was quite fun too. The sad thing is that I don't make many comments the first time through. So the second time I opened the thing, I had no idea what I had done. After that I made a lot of comments and files explaining whats going on. That takes as much time as the programming itself, and so this is moving along quite slowly. I'm not a programmer at all, and so everything that I know, I have thought myself. I'm pretty sure that if someone doing this for a living saw my code, they would be scratching their head and wondering what the hell I have been thinking. Hehe.

    Now I'm done with all the math routines I will be using except 64-bit square root (did 24-bit but found out that it was not good enough, and had to be expanded for 64-bit and I just got tired of the thing).

    It is actually a 4 axis cnc controller, with 2 spindle controllers. Its for my lathe and mill.

    Nice pick'n'place project! I'm going to be following that one with great interest! I have an engraving machine for PCBs which I had an idea of using as a PNP machine, but never really got anywhere with it.

    Do you still use your controller?


  • #10
    Registered
    Join Date
    Oct 2005
    Location
    Australia
    Posts
    2,387
    Downloads
    0
    Uploads
    0
    Yep my controller is the main brain inside my CNC machine, it gets used a few times a week.


  • #11
    Registered The Blight's Avatar
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    580
    Downloads
    0
    Uploads
    0
    I actually noticed while reading through your topics. Quite impressive builds! Seems like you have some of the same plans as me with this project.


  • #12
    Gold Member
    Join Date
    Mar 2003
    Location
    United States
    Posts
    2,782
    Downloads
    0
    Uploads
    0
    I use an Actel FPGA for the actual step pulse generation. A PIC24F generates 16-bit velocity commands and an SPI interface feeds them to the FPGA. The FPGA generates interrupt timing back to the PIC to have it update the FPGA with new velocity words every millisecond. This allows for a comfortable 16,000 instructions between ISR updates. The velocities (32K CW and 32K CCW) are evenly spaced because the FPGA produces a frequency directly proportional to the velocity command word.

    Mariss


  • Page 1 of 12 123411 ... LastLast

    Similar Threads

    1. Corner Step Acceleration
      By flash319 in forum LinuxCNC (formerly EMC2)
      Replies: 3
      Last Post: 05-07-2010, 07:16 PM
    2. Need Help!- Loosing step more and more on X axis only after reducing the accl/velocity step motor
      By Calico in forum DIY CNC Router Table Machines
      Replies: 3
      Last Post: 04-09-2010, 08:23 PM
    3. Need Help!- Step/Direction pins should be Step FWD and Step BACK
      By rayscott in forum Mach Software (ArtSoft software)
      Replies: 6
      Last Post: 02-09-2010, 06:57 PM
    4. Just IN- MRS Sigma: the Next Generation Miniature Linear Guide
      By Pacific Bearing in forum Product and Manufacturer Announcements
      Replies: 0
      Last Post: 01-20-2009, 11:21 AM
    5. Step by step cnc plasma with parts list and links.
      By massajamesb in forum General Waterjet
      Replies: 8
      Last Post: 07-08-2007, 11:22 PM

    Posting Permissions


     


    About CNCzone.com

      We are the largest and most active discussion forum from DIY CNC Machines to the Cad/Cam software to run them. The site is 100% free to join and use, so join today!

    Follow us on

    Facebook Dribbble RSS Feed


    Search Engine Friendly URLs by vBSEO ©2011, Crawlability, Inc.