PIC-Based Step Generation With Linear Acceleration?

Page 1 of 12 1234 11 ... LastLast
Results 1 to 12 of 140

Thread: PIC-Based Step Generation With Linear Acceleration?

  1. #1
    Gold Member
    Join Date
    Feb 2006
    Location
    USA
    Posts
    6809
    Downloads
    0
    Uploads
    0

    Default 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.

    Similar Threads:


  2. #2
    Registered
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    607
    Downloads
    0
    Uploads
    0

    Default

    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
    2392
    Downloads
    0
    Uploads
    0

    Default

    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
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    607
    Downloads
    0
    Uploads
    0

    Default

    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. #5
    Registered
    Join Date
    Oct 2005
    Location
    Australia
    Posts
    2392
    Downloads
    0
    Uploads
    0

    Default

    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. #6
    Gold Member Khalid's Avatar
    Join Date
    Apr 2006
    Location
    Pakistan
    Posts
    3423
    Downloads
    0
    Uploads
    0

    Default

    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. #7
    Registered
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    607
    Downloads
    0
    Uploads
    0

    Default

    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. #8
    Registered
    Join Date
    Oct 2005
    Location
    Australia
    Posts
    2392
    Downloads
    0
    Uploads
    0

    Default

    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;
    http://www.cnczone.com/forums/cnc_wo...ll_router.html

    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;
    http://www.cnczone.com/forums/rc_rob...p_machine.html



  9. #9
    Registered
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    607
    Downloads
    0
    Uploads
    0

    Default

    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. #10
    Registered
    Join Date
    Oct 2005
    Location
    Australia
    Posts
    2392
    Downloads
    0
    Uploads
    0

    Default

    Yep my controller is the main brain inside my CNC machine, it gets used a few times a week.



  11. #11
    Registered
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    607
    Downloads
    0
    Uploads
    0

    Default

    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. #12
    Gold Member
    Join Date
    Mar 2003
    Location
    United States
    Posts
    2839
    Downloads
    0
    Uploads
    0

    Default

    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 1234 11 ... LastLast

Posting Permissions

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


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

PIC-Based Step Generation With Linear Acceleration?
PIC-Based Step Generation With Linear Acceleration?