0% found this document useful (0 votes)
11 views23 pages

Overview Project Mechsoftronic

Uploaded by

Mehmet Unutkan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views23 pages

Overview Project Mechsoftronic

Uploaded by

Mehmet Unutkan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

FPGA/Nios Based CNC Controller

https://github.com/mhouse1/mechsoftronic

10/28/2015

mercredi 28 octobre 15
What is CNC?
✤ Computer Numeric Control

✤ Take drawing from CAD (Computer Aided Design) tools, convert


to a series of numbers (GCode), control movement using GCode

✤ CNC Machine

✤ Mechanical, software, and electronic components that make up a


tool that can create objects designed in CAD

✤ CNC Controller

✤ A device with firmware that interprets GCode and outputs motor


control signals to control how an object is shaped
mercredi 28 octobre 15
Sample GCode

mercredi 28 octobre 15
3D Print vs Milling
what kind of output do you need?

✤ extrusion
✤ layer by layer
✤ low structural integrity
✤ slow

✤ photopolymerization:
✤ layer by layer
✤ better structural integrity
✤ faster
✤ create more complex shapes

✤ milling (what this project is)


✤ high structural integrity: plastic, wood, metals
✤ fast
✤ less complex shapes
mercredi 28 octobre 15
Project Goals

✤ Research, Design, and Build a CNC Machine

✤ Create CNC controller and make everything OpenSource

✤ Use FPGA to create jitter free movement

✤ great system integration by managing hardware and software

✤ End result is a tool usable at home to make designs from CAD


quickly and accurately

✤ adaptable to any mechanical platform

mercredi 28 octobre 15
Adaptable Mechanical Platform

MKI ($0) MKII ($1000) MKIII (~$1600)

mercredi 28 octobre 15
Why not just buy one?
✤ Cost
✤ high cost even for a CNC mill
with small milling area
✤ Customizable
✤ add on laser cutter, plastic
extruder, plasma cutter, exacto
knife, ... anything you want
✤ Full understanding of how the
machine works and its limits

✤ base system for future use


✤ FPGA based systems are complex and painful to setup but is powerful;
this project will be used as a starting point for future projects

mercredi 28 octobre 15
Design
Linear motion hardware
rack and
ball screw acme belt drive
pinion
✴almost no backlash ✴will hold a load in place ✴easily expandable to larger ✴can accommodate semi
✴low friction (good for by design machines large machine
moving but bad for stopped) ✴backlash; unexpected play ✴complex; requires proper ✴simple
✴will tend to rotate away due to clearance or looseness gear reduction and other ✴not so great at high speeds
from loads of mechanical parts hardware to eliminate radial ✴typically used by
✴must use oversized loads ✴limited size load on the motor shaft hobbyists because its one of
to mitigate back driving ✴not so expensive ✴can become expensive if the cheaper options for
loads performance desired performance
✴expensive

mercredi 28 octobre 15
Hardware
Modified OpenHardware Shapeoko 2 1000mm x 1000mm rails

✤ Altera DE-0 Nano development board


✤ Using Nios II/e core (free)
✤ gShield OpenHardware stepper motor driver

note: quantity above indicate number of sets


mercredi 28 octobre 15
Software:Firmware

2014

Today, 2015

mercredi 28 octobre 15
Software:Firmware
Task1 Task2 Task3
•make sure FIFO don’t over flow •read queued data from task 1 and •dequeues step and direction and
•read serial data from UART convert to data packets writes to hardware for FPGA
FIFO •if threshold # of data packets modules to determine acceleration
•queue data for task 2 to received, signal sender to stop and synchronization
consume sending
•sender will be required to send • process data packets
gcode at a slower rate than •either commands
commands •or GCode
•GCode is interpreted into steps and
dir and queued for Task 3 to consume
•Commands are processed right
away
•see GUI for commands available

The 3 tasks run in parallel on MicroC OS II RTOS, this was done because the FPGA is configured with the “free” Nios II/
e CPU core where vectored interrupts are not available.

mercredi 28 octobre 15
Software:GUI
✤ configure nominal pulse settings
for 1 step
✤ where 1 step is a square
wave
✤ each count = 20ns
✤ so x-axis in this case would
output 4ms of high and 4ms
of low per step
✤ acceleration settings only applies
to z-axis

Can also select serial com-port and GCode file to send


mercredi 28 octobre 15
Software:GUI
✤ jog single axis specified number
of steps in specified direction
✤ jog X and Y axis at the same time
✤ check reverse to reverse axis in
software
✤ PWM will control routing
spindle speed (not yet
implemented)
✤ scale will increase drawing scale
✤ feed-rate will determine
maximum speed of the router
✤ other commands: start, cancel,
pause, erase route

note: highlighted in red is no longer needed and to be removed

mercredi 28 octobre 15
Software:GUI
✤ The parse_gcode.py module doubles
as an preview tool if ran individually
✤ allows user to preview points
with respect to time and position

✤ To use:
✤ modify GCode file name

mercredi 28 octobre 15
FPGA: special components

✤ non-standard altera modules (see project log to learn how to install)


✤ slave_template

✤ memory mapped registers, firmware can read/write to these

and FPGA can read/write to it too. used by firmware to control


FPGA motion control modules, and other IO
✤ FIFOed UART

✤ a modified version of the Altera UART module with the added

ability to buffer UART data


✤ PWM generator

✤ used for controling RC servos, and router speed controller

✤ pulse generator

✤ used to generate step and dir signal that goes to the stepper

motor driver

mercredi 28 octobre 15
FPGA: motion generator Z-axis

✤ z-axis acceleration is
handled by the FPGA
given a nominal
speed and a speed
change, the curve
generated is similar to
simulation shown
(left)
✤ This had to be
redesigned for XY
axis to work properly

mercredi 28 octobre 15
FPGA: motion generator Z-axis
tested using Xilinx test bench

odd # of steps

nominal speed not reached

nominal speed reached

mercredi 28 octobre 15
FPGA: motion generator XY axis
✤ Design and implementation in
progress
✤ currently limited to no acceleration
✤ this means xy axis should move
much slower
✤ redesign is basically a clock tick that
can be sped up or slowed down
used to synchronize xy axis while
maintaining acceleration

mercredi 28 octobre 15
Project Status

✓ Able to go from CAD to numbers to firmware to finished product


✓ Z-axis acceleration working

✓ XY-axis must move at slower speeds until synchronized

acceleration implemented
★ As of 4/23/2014 project been OpenSourced on GitHub
★ 5 users watch project

★ starred 17 times

★ forked once

mercredi 28 octobre 15
Future work

• implement synchronized XY axes acceleration motion


• estimated completion date 07/01/2016

• implement firmware GCode look ahead algorithm


• estimated completion date 03/01/2016

• move controller to MKIII mechanical platform


• TBD

mercredi 28 octobre 15
Everything documented

• See GitHub mechsoftronic documentation for more details


• all things relating to the project design and work has been

documented

mercredi 28 octobre 15
Everything documented
• From May, 2013 to today

mercredi 28 octobre 15
Tools

✤ This CNC will support drawings from AutoCAD


✤ draw object in autoCAD, export as *.DXF file

✤ hint: draw different categories on its own layer

✤ Convert DXF to GCode using DXF2GCODE (OpenSource software)


✤ Another useful GCode viewing tool is OpenSCAM
✤ it does not allow you to view points like parse_gcode.py does but it

does allow you to view a simulated routing

mercredi 28 octobre 15

You might also like