584,800 active members*
4,603 visitors online*
Register for free
Login
IndustryArena Forum > CNC Electronics > PIC Programing / Design > ANy sucesseful xyz+spindle pic-based lpt drives?
Results 1 to 18 of 18
  1. #1
    Join Date
    May 2010
    Posts
    0

    ANy sucesseful xyz+spindle pic-based lpt drives?

    Hello.
    I am facing a hard choice of either developing my own LPT-based interface or use someone else's sucesseful built.
    Do you know any working examples of CNC machine controll interfaces that use PICS? (I also will use limit switches)

    Thank you

  2. #2
    Join Date
    Mar 2003
    Posts
    6855
    bump

  3. #3
    Join Date
    Jan 2005
    Posts
    1695
    I doubt the PIC is up to the task. I'm not aware of any micro-controller based implementation that can do what Mach or EMC2 does. Not even on ARM processors which are 10 times faster.

  4. #4
    Join Date
    Feb 2008
    Posts
    217
    As I remember, early RepRap machines tried PICs before switching to Atmel / Arduinos, The old DeskNC used LPT with virtually any stepper controller .. . James Newton sells Roman Black's Linistepper on eBay, Turbocad might do it too. I like the arduino because it handles serial via USB using an FT232 chip.
    If you program in "C", you might convert the Sanguiniololu code into something usable to a PIC.
    We're not in business to make parts, we're in business to make money, making parts is just how we do that.

  5. #5
    Join Date
    Feb 2007
    Posts
    962
    All my Viper servo drives run on a pic 18F2431. My starcam 3 axis controller runs on dual pic 18F's one handleing the USB and isolation and the other running the 3 axis 25Khz continious contouring. '

    I like the PICs because they are so reliable and immune to noise. I've literally used thousands, in stepper drives servo drives and controllers.

    Also the USBCNC controller from europe runs on a 18F4550 chip and i've heard works well. The deskNC ran on a pic as well.
    Manufacturer of CNC routers and Viper Servo Drives
    www.LarkenCNC.com and www.Viperservo.com

  6. #6
    Join Date
    Apr 2013
    Posts
    1899
    H500,
    Of course PICs are up to the task. In fact, LPT ports are not as fast as the 18F4550 is, so I don't see why a better PIC would be a problem. I agree with Larken, I am also a great fan of Microchip controllers, but you have to select the right PIC for the right job. In fact, as soon as I am ready with my current CNC project the first update I will make is to replace the LPT based based "blue card" driver with one based on the 18F4550. Even though I spent a great deal of time with fixing the blue card and is now running smooth and very fast with all three motors, I would like to replace it with an USB driver and the 18F4550 is already been decided for. I'll get back if I fail, but I doubt that I'll have performance issues with the PIC.

  7. #7
    Join Date
    Jan 2005
    Posts
    1695
    Quote Originally Posted by A_Camera View Post
    H500,
    Of course PICs are up to the task..
    It isn't clear to me whether we are talking replacing Mach and the PC with a custom CNC program running on a PIC, or just a simple breakout board. It sounds like you are talking about the latter. Even so, a standard usb to parallel cnc interface won't work without custom Mach drivers. There is too much jitter. Do you have a more sophisticated approach inn mind?

  8. #8
    Join Date
    Jan 2005
    Posts
    1943
    check the link below

    Planet CNC

  9. #9
    Join Date
    Apr 2013
    Posts
    1899
    Quote Originally Posted by H500 View Post
    It isn't clear to me whether we are talking replacing Mach and the PC with a custom CNC program running on a PIC, or just a simple breakout board. It sounds like you are talking about the latter. Even so, a standard usb to parallel cnc interface won't work without custom Mach drivers. There is too much jitter. Do you have a more sophisticated approach inn mind?
    The OP asked: "Do you know any working examples of CNC machine control interfaces that use PICS?" He is not talking about replacing any of the PC based software with PIC. That would be a pointless effort even to try, since the only thing which can replace a computer is another computer, no single micro controller can do that task. I thought that was obvious. Apparently you think he wants to replace Mach and the PC, which I don't think is the subject here.

    "Control interface" to me is the break out box plus the driver, both are hardware. A PIC can, with the help of firmware, replace the break out box by emulating an LPT port of a PC trough USB. The actual motor driver is pure hardware.

    No, I am not talking about a "simple break out board", I am talking about replacing the need of a parallel port all together, emulating the printer port through USB. A simple break out board is just wires connected from the LPT pins to terminals, opening up the possibilities to connect anything. I know that standard USB to parallel converter won't work, that's why you need a PIC, or another micro controller which is fast enough in collecting, handling and interpreting the G-codes. Perhaps Mach has something very special in it, preventing the use of USB all together, but I doubt that. If the printer port is properly emulated Mach will have no idea about the use of USB so I think it would work without issues. Anyway, there are commercially available USB interfaces which claim to work with Mach, some are PIC based, so I guess that's not impossible to achieve.

  10. #10
    Join Date
    Jan 2005
    Posts
    1695
    It is my understanding that the latency in the USB itself is too great to provide the uninterrupted pulse stream required by steppers. I don't think any of the commercially available ones are able to work without them writing a special plug-in for Mach. It would be an interesting project if you know how to do the plug-in.

    I used the PIC for quite a few projects, but I consider it to be a weak processor compared to the ARM cortex variants which runs 32 bit code as high as 200 Mhz and cost around $10 online.

  11. #11
    Join Date
    Apr 2013
    Posts
    1899
    Quote Originally Posted by H500 View Post
    It is my understanding that the latency in the USB itself is too great to provide the uninterrupted pulse stream required by steppers.
    That problem can easily be solved with proper buffering. Besides, if USB is suitable for video and other speed demanding applications, like digital oscilloscopes, logic analysers and other stuff, then driving a CNC is really a piece of cake. Parallel ports are a dinosaurs and really slow.

    Quote Originally Posted by H500 View Post
    I don't think any of the commercially available ones are able to work without them writing a special plug-in for Mach. It would be an interesting project if you know how to do the plug-in.
    You should not need a special driver. If a driver is needed then the project is dead because of several reasons, one is that it would make every other CNC software useless and the other is that I am pretty sure Mach3 is not an open system and they will not let me into their software secrets, the third is that I am not interested in writing drivers. Writing firmware for a PIC is fun but writing drivers for PC software is not. I don't know if there are any commercial PIC based CNC interfaces and that was not my aim either. I am talking about a hobby project for home use, not a commercial product.

    Quote Originally Posted by H500 View Post
    I used the PIC for quite a few projects, but I consider it to be a weak processor compared to the ARM cortex variants which runs 32 bit code as high as 200 Mhz and cost around $10 online.
    It's not about ARM vs. PIC and not really about oscillator clock speeds at all. Remember that what's important is the MIPS and for a PIC one clock cycle = one instruction cycle, for the ARM it is not (unless I am mistaken), so you can't really compare oscillator frequencies 1 to 1. I am pretty sure that the 12 MIPS of the 18F4550 is more than enough. Also, it is not about how much a microcontroller costs, you need more than just a single ARM processor for $10 before you can make a working BOB, you need a whole development kit as well, and that is more than $10, not to mention programming experience, language, tools and debug platforms. To start a project like that with ARM costs a lot more than $10 if you already have everything set up for PIC. If you have nothing than you could say it really makes no difference, you must start from scratch anyway. For me this is a hobby, if I had commercial plans I may reevaluate my decisions, but even so, I would not jump to any conclusion before a deep analysis of the high end PICs first on paper and in a prototype.

    I am pretty sure that it is possible to run stepper motors at about 500rpm maximum without problems using the right PIC. I am saying the speed in rpm because in my opinion that's what counts. The actual speed of the CNC depends on the mechanical design, so that's not important for the PIC.

    500rpm is a nice stepper speed for any home build CNC, and with 10x microstepping you only need 17kHz to the motor, or a total of 68k pulses for 4 motors simultaneously driven, so that should not present any problem. My example could give you a theoretical speed of 1250mm/min with a lead screw pitch of 2.5mm, so that is respectable for any home build CNC and as I understand, even for some commercial ones.

    It depends on what you prefer, but I don't think that PIC in general is a limiting factor. It depends of course on the PIC you chose and your own programing skills. For an application like this, I would not chose any other language than assembly because of the predictability of times and the possibility of measuring/calculating exact timings in every stage.

  12. #12
    Join Date
    Feb 2007
    Posts
    962
    Quote Originally Posted by H500 View Post
    It is my understanding that the latency in the USB itself is too great to provide the uninterrupted pulse stream required by steppers. I don't think any of the commercially available ones are able to work without them writing a special plug-in for Mach. It would be an interesting project if you know how to do the plug-in.
    Tell that to the maker of the new AKZ 245 USB Mach3 interface that is driverless.
    The USB sends packets into a FIFO that sends out the step/direction.
    If your USB packets are big enough you can get the thru rate

    Quote Originally Posted by H500 View Post

    I used the PIC for quite a few projects, but I consider it to be a weak processor compared to the ARM cortex variants which runs 32 bit code as high as 200 Mhz and cost around $10 online.
    A Pic32 costs about $5 and is as fast as your ARM.. They both run 1 clock cycle / instruction..
    An 8 bit PIC 18F can run rapids at up to 100 khz if the code is written right.

    Your into overkill, you don't realize older machines ran fast on a Z80 processor.
    You don't need a ARM or CPLD logic array to make a good CNC controller. Just the write person programming it.
    Manufacturer of CNC routers and Viper Servo Drives
    www.LarkenCNC.com and www.Viperservo.com

  13. #13
    Join Date
    Jan 2005
    Posts
    1695
    Quote Originally Posted by A_Camera View Post
    That problem can easily be solved with proper buffering. Besides, if USB is suitable for video and other speed demanding applications, like digital oscilloscopes, logic analysers and other stuff, then driving a CNC is really a piece of cake. Parallel ports are a dinosaurs and really slow.
    The problem is that although usb is fast, the application needs to wait it's turn before it is allowed to send a packet. The amount of delay is enough to cause a motor to run rough or stall. I guess in theory, the lpt/usb converter could delay and buffer the pulse stream, but the common ones don't. They just wait their turn. I wonder how difficult it would be to write a cnc capable serializer for Windows.

    It's not about ARM vs. PIC and not really about oscillator clock speeds at all. Remember that what's important is the MIPS and for a PIC one clock cycle = one instruction cycle, for the ARM it is not (unless I am mistaken), so you can't really compare oscillator frequencies 1 to 1.
    Not counting the pic32, which is a MIPS processor, the fastest pic is the Dspic. It runs 16 bit code at up to 75 mips. The ARM is 32 bits and supposedly run 1.25 dmips per Mhz. The faster cortex M4 variants are close to 200 Mhz and has a floating point accelerator built in.
    I am pretty sure that the 12 MIPS of the 18F4550 is more than enough.
    It's probably enough to do a deserializer, but not a motion controller. Too many calculations are needed. At 50Khz, you only have 20 microseconds between steps.

    Also, it is not about how much a microcontroller costs, you need more than just a single ARM processor for $10 before you can make a working BOB, you need a whole development kit as well, and that is more than $10, not to mention programming experience, language, tools and debug platforms. To start a project like that with ARM costs a lot more than $10 if you already have everything set up for PIC. If you have nothing than you could say it really makes no difference, you must start from scratch anyway. For me this is a hobby, if I had commercial plans I may reevaluate my decisions, but even so, I would not jump to any conclusion before a deep analysis of the high end PICs first on paper and in a prototype.
    You can buy a ready to run 160Mhz evaluation board with the JTAG debugger for about $15. The C compiler is free for up to 32k of code. Don't get me wrong. The pic is a great chip. But there's no reason to limit yourself.

    It depends on what you prefer, but I don't think that PIC in general is a limiting factor. It depends of course on the PIC you chose and your own programing skills. For an application like this, I would not chose any other language than assembly because of the predictability of times and the possibility of measuring/calculating exact timings in every stage.
    Assembly is efficient for simple things, but I can complete a complex application much faster using C. For hobby projects, the chip cost is unimportant. This is largely true even in production. Time is more valuable to me.

  14. #14
    Join Date
    Jan 2005
    Posts
    1695
    [QUOTE=Larken;1275794]Tell that to the maker of the new AKZ 245 USB Mach3 interface that is driverless.
    The USB sends packets into a FIFO that sends out the step/direction.
    If your USB packets are big enough you can get the thru rate
    I did a search and did not find it. Do you have a link?

    A Pic32 costs about $5 and is as fast as your ARM.. They both run 1 clock cycle / instruction..
    PIC32 is a MIPS. It's not really a pic. It's a decent processor and I would use it if it was convenient, but learning to use the ARM opens up more doors.

    An 8 bit PIC 18F can run rapids at up to 100 khz if the code is written right.
    Your into overkill, you don't realize older machines ran fast on a Z80 processor.
    You don't need a ARM or CPLD logic array to make a good CNC controller. Just the write person programming it.
    I am capable of doing well optimized assembly code, but for regular applications, it's a waste of time. I recently did a DSPIC based stepper motor driver as a learning project. I could have done it with a much weaker 8 bitter, but why bother? The cost difference was neglible. Even if I was selling them, parts cost is not the main impediment to profitability.

  15. #15
    Join Date
    Feb 2007
    Posts
    962
    Here is the USB controller that doesn't need a driver. It uses the FIFO technique, same as Mach does.
    3 Axis CNC USB Card Mach3 200KHz Breakout Board Automation Technology Inc

    H500, Your comparing a $10 ARM processor, but when i bring a $5 PIC32 which is as fast, you say its not really a PIC... Huh ??

    and
    We show you a number of CNC controllers running a 18F45xx processor and you say...

    "It's probably enough to do a deserializer, but not a motion controller. Too many calculations are needed. At 50Khz, you only have 20 microseconds between steps. "

    I guess you just aren't listening.
    Manufacturer of CNC routers and Viper Servo Drives
    www.LarkenCNC.com and www.Viperservo.com

  16. #16
    Join Date
    Apr 2013
    Posts
    1899
    H500, I am not interested in continuing this argument. I am convinced that a PIC easily can do the job of a BOB, and if I am wrong then so be it, I am willing to try. This is a PIC Programming / Design forum and your posts are not informative or helpful for anyone interested in PIC programming in relation to CNC. All you are saying is "use ARM", which is pretty pointless. Don't assume that just because you can't do something nobody else can.

  17. #17
    Join Date
    Jan 2005
    Posts
    1695
    Quote Originally Posted by Larken View Post
    Here is the USB controller that doesn't need a driver. It uses the FIFO technique, same as Mach does.
    3 Axis CNC USB Card Mach3 200KHz Breakout Board Automation Technology Inc
    That is clearly a full fledged motion controller that require a custom plugin for Mach. It's not the simple LPT serializer/deserializer that you make it out to be.

    H500, Your comparing a $10 ARM processor, but when i bring a $5 PIC32 which is as fast, you say its not really a PIC... Huh ??
    Do you understand the architectural difference between a PIC and a MIPS M4K processor? The PIC32 is no closer to a PIC than an ARM.

    and
    We show you a number of CNC controllers running a 18F45xx processor and you say...

    I guess you just aren't listening.
    You didn't show a single one that checked out. An 8 bit PIC is nowhere fast enough to do what that controller in your link does.

  18. #18
    Join Date
    Jan 2005
    Posts
    1695
    Quote Originally Posted by A_Camera View Post
    H500, I am not interested in continuing this argument. I am convinced that a PIC easily can do the job of a BOB, and if I am wrong then so be it, I am willing to try. This is a PIC Programming / Design forum and your posts are not informative or helpful for anyone interested in PIC programming in relation to CNC. All you are saying is "use ARM", which is pretty pointless. Don't assume that just because you can't do something nobody else can.
    This is a technical discussion forum, not a fan boy clubhouse. If you are offended because I said something that was not laudatory of your favorite brand, then you are free to ignore my posts. My perspective might not make you feel good, but thinking outside of the box is far from useless.

Similar Threads

  1. Heavy Duty DC Servo Spindle Drives.
    By Al_The_Man in forum Stepper Motors / Drives
    Replies: 0
    Last Post: 06-02-2009, 09:10 PM
  2. Spindle Build based on ER32 Collet Extension
    By InventIt in forum DIY CNC Router Table Machines
    Replies: 10
    Last Post: 03-21-2009, 02:47 PM
  3. New actuators based on the segmented spindle
    By kataka1 in forum News Announcements
    Replies: 0
    Last Post: 06-16-2008, 12:18 PM
  4. R8 spindle project based on LMS#1407
    By mcantelobre in forum Benchtop Machines
    Replies: 1
    Last Post: 12-16-2005, 05:23 AM
  5. Anyone have experience with Bardac Spindle Drives?
    By howling60 in forum CNC Machine Related Electronics
    Replies: 3
    Last Post: 10-28-2005, 01:39 PM

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
  •