Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

which CPLD for CNC operation i should use?

Status
Not open for further replies.

jaydeep.gajjar90

Newbie level 6
Joined
Mar 11, 2011
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,409
Hello Everyone !

I currently working on a project of hobby cnc mill. i want to design custom control panel to operate the machine in this way :

-> panel have a graphical lcd , buttons etc connected to microcontroller which handles user interaction.
-> cpld is used to control motion of stepper motor.(micro-stepping,acceleration & acceleration, coordination of axes)
-> microcontroller behaves as master which fetches G-code via user-input or text file (NC file)
-> it passes the value to cpld (slave) to how much each axis should move.
-> once value for each axis is supplied to cpld by microcontroller , cpld works independently until required motion is done.

i have fare experience with microcontroller so i am currently working on that part.
current i have Fez panda II board(Arm7) and i currently programming for G-code interpreter,sd card handling and usb communication.

I have no experience of CPLD. (just learned some basics of VHDL in college)
Now, My question is
(1) which CPLD i should use? (please suggest any good cpld with name or product id if possible)
(2) how to communicate between mcrocontroller and CPLD ? (is there any build in protocols like I2C or SPI or rs232)

I want to use CPLD beacuase of it can toggle output at high speed in MHz. (the Arm7 controller which i have cant toggle GPIO pin more than 15 KHz:-().
 

Lattice and Altera are the market leaders in the CPLD market.

Take a look at Lattice's "Mach XO2"
MachXO2

And the Altera MAX series:
CPLD - MAX V CPLDs

Personally, I would go with the MAX because Altera's design tools are considered to be very good.

But...if I had the choise (and obviously you do) I'd pick an FPGA and not a CPLD.
FPGA's are a little more challenging to integrate on a PCB but they offer a lot more logic to work with.
Most FPGA's require external ROM ICs to load from - but some don't.

Take a look at the SPARTAN 3AN (Xilinx - the FPGA market leader) and the IGLOO line (Actel - flash based devices).

Good luck with your project!

---------- Post added at 00:43 ---------- Previous post was at 00:24 ----------

how to communicate between mcrocontroller and CPLD ? (is there any build in protocols like I2C or SPI or rs232) [/QUOTE said:
You have to realize that CPLDs/FPGAs are "bare" devices...unlike MCUs.
You have to "build" (or more correctly: describe) the logic yourself!

Decide how you want the MCU to output the data and based on your decision - implement the needed logic on the other end.

For example:
If you want to communicate via the I2C peripherial on your ARM - you will have to implement an I2C peripherial on the FPGA/CPLD.
Everything is possible...as the limits are usually set by the MCU's IO capabilities and not vice versa. The downside is that NOTHING IS READY TO USE "OUT OF THE BOX" like with MCUs and other ASICs.
 

Why you don't want to use EMC ?
EMC (the Enhanced Machine Control) is a software system for computer control of machine tools such as milling machines and lathes.

EMC is free software with open source code. Current versions of EMC are entirely licensed under the GNU General Public License and Lesser GNU General Public License (GPL and LGPL)

EMC provides:
several graphical user interfaces including one for touch screens
an interpreter for "G-code" (the RS-274 machine tool programming language)
a realtime motion planning system with look-ahead
operation of low-level machine electronics such as sensors and motor drives
an easy to use "breadboard" layer for quickly creating a unique configuration for your machine
a software PLC programmable with ladder diagrams
easy installation with .deb packages or a Live-CD

It does not provide drawing (CAD - Computer Aided Design) or G-code generation from the drawing (CAM - Computer Automated Manufacturing) functions.

It can simultaneously move up to 9 axes and supports a variety of interfaces.
The control can operate true servos (analog or PWM) with the feedback loop closed by the EMC software at the computer, or open loop with "step-servos" or stepper motors.
Motion control features include: cutter radius and length compensation, path deviation limited to a specified tolerance, lathe threading, synchronized axis motion, adaptive feedrate, operator feed override, and constant velocity control.
Support for non-Cartesian motion systems is provided via custom kinematics modules. Available architectures include hexapods (Stewart platforms and similar concepts) and systems with rotary joints to provide motion such as PUMA or SCARA robots.
EMC runs on Linux using real time extensions. Support currently exists for version 2.4 and 2.6 Linux kernels with real time extensions applied by RT-Linux or RTAI patches.
LinuxCNC.org
 

Thanks both of you for reply.

@shaiko

Thanks for your suggestion.i would go for altera.
i want to use CPLD, because my budget is low.(FPGA dev kits have very high price (starts with 10,000 Rs i think))
CPLD have different packages, it can be easily mounted to pcb

@yura717

Thanks for your suggestion. i am familier with EMC2 (also tried mach3)
beacuse parallel port dosnt come with newer designs.
and also parallel port doesnt give high speed.(i have tested with one servo gives me maximum 1400 RPM on EMC2)

so i want to use CPLD.
 

Yes, I agree printer port should be replaced by USB ports.
 

Yes, I agree printer port should be replaced by USB ports.

I don't quite agree with replacing printer ports with USB ports for CNC/EMC2 purposes.

While USB is nice, new and hip, it's pretty much crap for realtime purposes when compared to a lowly parallel port. Not that parports are great for CNC, but USB is worse for CNC.

Then again, you really would want EMC2 to send high level trajectory information to the controller (CPLD/FPGA/whatever), and have the cpld generate the low level pulses. Not sure if today's EMC2 has support for that. Last time I looked not so much...

---------- Post added at 21:41 ---------- Previous post was at 21:20 ----------

Oh yeah, and to answer the question .... xilinx coolrunner 2 works fine for simple things. But the moment you want to do fun stuff that requires larger amounts of memory, it probably doesn't fit. Been there, done that. I tries stuffing simple stepper controller in cpld, that fits. And then I tried more complex things that required more counters + interpolation blah, and that didn't fit. So you may want to look at a small fpga for this.

One word of caution with the fpga approach. Make sure the power electronics can handle the powerup + configuration phase. Either that, or buy some spare mosfets etc. ;)
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top