Connect with us

Microcontroller, Stepper Motors and a 4-Axis Drilling Machine

Discussion in 'Electronics Homework Help' started by Sadlercomfort, Dec 10, 2014.

Scroll to continue with content
  1. Sadlercomfort

    Sadlercomfort Ash

    Feb 9, 2013
    Hi Guys,

    I have been given an assignment where I need to design a 4-axis drilling machine, with 4 stepper motors and a PIC micro-controller. The X, Y axis will be controlled using a lead-screw, moving the work table. The Z-axis will also be controlled with a lead-screw, but moves the drill head up/down. The final stepper motor operates the drill bit and its RPM. Each stepper motor is operated via a keypad.

    I'll be using assembly language for this, because this is how we're being taught. I'm looking for some information on how to interface sensors within the design. I could use a count for each of the pulses to estimate the distance travelled of each axis, but the programming would be difficult for me and sensors will increase my grade. I've only heard about ultrasonic sensors, but don't know if this will work.

    I also need to interface an LCD display, which is another thing we haven't been taught. But I'm sure I could work this one out.

    Guidance Only Please!


    Heres a scary thought: 4 steppers motors, 3 sensors and an LCD Dislpay = 8 Devices. But were using a PIC16F88, with only 4 ports?
  2. Bluejets


    Oct 5, 2014
    Heaps of info out there where others have done this many times and sorted out all the bugs and what not.
    Linux would be a good start.
    Ultrasonic will not do your measurments accurately.
    Plenty of projects around on the net showing the use of Chinese style digital calipers and interfaces to suit just about any application.
    The calipers are cheap (mostly $10 or less on Ebay) and accurate.
  3. Sadlercomfort

    Sadlercomfort Ash

    Feb 9, 2013
    Thanks, I'm not using Linux. I'm using assembly language written and compiled by MPLAB. This assignment is entirely theoretical based and I don't have to build any prototypes.

    All I can find are infra-red ultrasonic sensors.
  4. Bluejets


    Oct 5, 2014
    Infra-red is light based ....ultra-sonic is sound based.

    Two different mediums.

    My reference to Linux was so you could see how it is achieved.
    There would be others done in assembly, probably not many but they would be of the older varity these days.
  5. Gryd3


    Jun 25, 2014
    @Sadlercomfort, I would avoid using IR, or UltraSonic based sensors to determine your position...
    If your machine will do anything other than draw, you need to be able to position it with an accuracy of at least 1/100th of an inch...
    Machines driven by stepper motors typically have one master controller that takes care of positioning. This controller will typically have two outputs per axis to control direction, and distance. One output is a simple 1/0 to dictate forward/backward motion, the other output is a simple 'step' output. Every pulse is one step.
    This controller must be tuned. You need to be able to determine how many pulses equal an inch, (or mm... depending on your units)
    From here, your controller simply sends the pulses to the stepper controllers which take care of the actual motion. The stepper motor will have a well defined step/revolution. So no sensors are required for positioning as long as your controller can maintain the current positioning information.
    Sensors will help position the machine on the initial start-up. These sensors are commonly switches or contacts usually in place for 'homing' the machine.

    As far an manual input devices are concerned, they are commonly a jog-wheel with a 3 or 4 position switch to select which axis you wish to move, as well as an additional multi position switch to select the scale at which the axis will move at. For example, you could move the X axis 1.5" by setting the scale to 1X and selecting the X axis...

    If you really want to deal with sensors and push the complexity for a higher grade, you can look into using encoders to take care of positioning of the machine. Of course, once you start to work with a closed-loop system you need to be able to adjust and setup the feedback for your circuit in such a way as to actually have the closed-loop work in your favor... One of the shops I visited had their servo tuned incorrectly... and the machine would stutter as it ramped it's speed up... this had a horrible sound and left tooling marks on the material. It was later corrected by adjusting one of the Servo Controller parameters.

    Anyway.. that's food for though from Kitchen Le Gryd3.

    And as far as that Linux CNC project is concerned... it may be in your best interest to skim the material they have... even if your not using linux. This is not a turn-key solution and requires extensive setup. It is documented very well, and I'm positive that this documentation will give you some much needed insight and some tips/tricks for building your own, even if you are using a different platform.
  6. Sadlercomfort

    Sadlercomfort Ash

    Feb 9, 2013
    Thanks alot!

    You are right, the accuracy of these stepper motors should be sufficient to determine the position if set-up correctly. I have started alot of work on this already. I have some good assembly code which I can manipulate to create a keypad control for 4 stepper motors.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day