Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Help with choosing Microcontroller for CNC

  • 12-07-2007 7:44pm
    #1
    Closed Accounts Posts: 31


    Hello; I see that we have a few good brains here so I was wondering if I could tap into a bit of that knowledge. The thing I’m looking for is a suggestion on a type of microcontroller to use.


    Last year I made myself a digital height gauge based on the 8051. I’m from a mechanical engineering background, so that side of things isn’t the problem.
    I’ve been learning electronics for the last few years on my own time so although I’m familiar with that side, I’m far from being an expert. As far as the height gauge went, I got it working perfectly after some trial and error. The whole apparatus was a stand alone device. I didn’t connect it to the serial port and instead used a keypad and LCD which is what I’m thinking of doing again.
    The code was written in assembly and took up roughly five hundred lines. The 8051 had 4K of internal code space and I thought I was going to run out of room since I had some unexplained errors.

    I’ve set myself a new task of building a CNC milling machine. I kept the height gauge under 256mm so I didn’t have to go into 16 bit territory. This time I want to build an XY plotter and possibly add in a Z dimension. The rig will be much larger so I can’t avoid dealing with 16-bit numbers. Anyway, to cut a long story short, I would appreciate any suggestions on the type of microcontroller that could be used. As I said, I’m familiar with the 8051, but I’m under the impression that it really isn’t the best option for this type of project. I only used it the last time because it was deemed as a good choice for beginners.

    Time and money aren’t issues. Just my electronics abilities. Oh yeah, I’m learning C at the moment. Underline the learning bit.
    I would be interested in using a different uC, but an 8051 variant would be acceptable. I just haven’t a clue on the type of memory requirements and was hoping someone might know off the top of their heads. I don’t want to buy a pig in a bag and find out it isn’t suitable. I have researched a few that I think could be useful especially if I'm capable enough to use C.


Comments

  • Registered Users, Registered Users 2 Posts: 5,401 ✭✭✭DublinDilbert


    If i was choosing a CPU i would first look at which inputs you will have? what are you using to measure your angles? optical encoders? what sort of output do these have quatrature 5V TTL signals?? Or are you even using encoders at all?

    What would your outputs be? how do you plan to drive the motors? are they stepper motors or DC motors??

    You could just do all the control from a PC? or do the motion control in an embedded system, with an RS232 link to a host PC.

    I think either way you'll need a host PC which you can put in step files for the CNC machine and have these step files outputted to the system...


  • Registered Users, Registered Users 2 Posts: 441 ✭✭robfitz


    I would agree with DublinDilbert that you need to define the input and output requirements first and then select a suitable microcontroller. Personally I really like ARM processors; a 32 bit architecture, range of processor types (speed, power usage, etc.), lots of peripheral options, numerous suppliers, and a large range of development tools.

    At the moment I'm using an Analog Devices ADuC7020 microcontroller minikit in my bicycle sensor data logging project. The minikit is really simple and nice and only about 30 euro, though for my needs I thinking of changing to something which incorporates a USB interface maybe from Atmel or NXP.


  • Registered Users, Registered Users 2 Posts: 1,511 ✭✭✭dave2pvd


    Well, you're certainly stepping up the level of difficulty. In terms of difficulty, a 1-D height gauge doesn't even compare to a 3 axis closed loop system.

    Start here perhaps: http://www.triomotion.com/tmt2/sitefiles/about_trio/trio_news.asp I've used their stand alone 4.5 axis controller (MC206, IIRC). Perhaps you could use one of their PC card controllers. They work for servo or stepper, in just about any mode/configuration you can think of.

    I hope you have a bit of money! Closed loop control isn't so cheap.

    Probably THE cheapest way to do closed loop control is the hobby electronics route. I've never messed with anything like that, but have perused my way through some of the hobby shops and been amazed at what is available. However, if you want to build a mill/router, the hobby components might be a wee bit light. How about a plotter instead? Or a pick and place?

    You do know that what you are looking for is readily available 'off the shelf'?


  • Closed Accounts Posts: 31 I disagree


    It’s only a hobby.

    Previously, I used a unipolar stepper motor to drive a homemade (lead)screw. It was only a low torque motor in the region of 30-40 Ncm and required 12V and less than an amp so I used darlington pair transistors connected to a heatsink. The stepping sequence was provided by my code.
    I didn’t use an encoder. I thought I would get away without using one since a Hybrid stepper motor seems to be accurate enough. Maybe I’m wrong about that. I would only be interested in tenth of a millimetre accuracy. Nothing really too much to ask, so I thought. Since it’s only a hobby machine, I’m prepared to compromise on accuracy to an extent.
    I came across a max232 IC for use with theRS232 connection, but I was staying away from it because I preferred to head along the path of a ‘stand alone’ device with a keypad input, LCD and motor as outputs. Something simple. I might actually reconsider the whole approach. Could I have all of my code on the PC (or laptop??) and run the program from there or have I misinterpreted what DublinDilbert was saying?

    By the way, thanks for the replies so far.


  • Registered Users, Registered Users 2 Posts: 5,401 ✭✭✭DublinDilbert


    Hi

    I don't think you'll need alot of torque as your using lead screws...

    I would do it in stages... first get the motion control side of things sorted on the embedded system, with a PC providing the step data... You can always add an LCD later on, and make a standalone system....

    Yep you'll need some sort of Max232 converter to convert the RS232 levels from the PC into TTL levels. you can also buy these, although it would probably be best to mount it near the embedded system:-
    http://www.bb-elec.com/images/product_images/232LPTTL_large.jpg



    You can also make up a fairly simple serial protocol to send down the step data as ASCII for the motors from the PC... Error checking of the data coming from the PC would be important, as a one bit error could cause the machine to break!
    If i was doing it i would make up a frame of ASCII characters like this:-
    S 2 0 3 1 A X X

    S = Step command
    2 = This is a command for stepper number 2
    031A = 16 bit step value as ASCII, 0000->FFFF can be used
    X X is a checksum of the data S 1 0 2 1 0, which is checked at the CNC machine, before the new step point is loaded..


    If i was doing this project, i'd also ad in some "homing" sensors, they can be simple limit switches / prox switches, which allow the embedded system to home the motors and put them into a known position... After the system homes the motors it can clear all of the variables holding the position data ect...


  • Advertisement
  • Closed Accounts Posts: 31 I disagree


    Thanks for the help.:D

    I'm sure I'll be back some time in the near future requesting some additional help.


Advertisement