Welcome, Guest. Please login or register.
Did you miss your activation email?
May 27, 2012, 04:40:48 PM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  Mach SDK plugin questions and answers.
| | |-+  Motion plugin for virtual hardware(for tests) - lets share our knowledge
Pages: 1 2 3 »   Go Down
Print
Author Topic: Motion plugin for virtual hardware(for tests) - lets share our knowledge  (Read 3128 times)
0 Members and 1 Guest are viewing this topic.
jarekk
Active Member

Offline Offline

Posts: 47


View Profile
« on: February 25, 2011, 10:12:23 AM »

Hi,

I have my own USB CNC controller ( something close to ncPod - 120Mhz Arm Cortex CPU capable of about 100kHz operation). It works with different software then Mach.
I wanted to to write Mach plugin for it, but there is no good documentation for it. There are few people who know it quite well, but this knowledge is commercially valuable , so nobody was interested to join me.

I have it quite alive. There are few things missing ( like input/output processing, homeing, jog operation), but basic motion works. There is also console windows to dump all interesting internals
I decided to share it before finishing as there are some other people working on similar design (http://www.machsupport.com/forum/index.php/topic,17602.0.html)

So - please have a look at sources, play with it.
It is free to use as long as you share your knowledge to make it really good template for starting own motion plugins.

You need Visual C++ Express 2010 to compile it.
You will need to change in project post processing step - to accomodate path to your Mach directories.
In case your console window is too small - change it . Once changed it will keep setting for consequiteve runs.








* mach_vmotion.zip (44.63 KB - downloaded 313 times.)
Logged
madfly
Active Member

Offline Offline

Posts: 7


View Profile
« Reply #1 on: February 27, 2011, 12:49:59 PM »

Hello, thank you for your help and the example that I've provided, I have compiled and now I understand better how Mach3 inside.
 As you rightly said you can not find a working example to see how Mach3 sends commands.
 Almost all USB Mach3 to do nothing but take the data in Modbus format and then regenerate the toolpath, my idea is instead to capture the pulse of step and direction, sending them to the usb it will not do more than repeat the impulses Mach3, which sends the parallel.
 I do not know if I was very clear but my English is at school, thanks again Daniele
Logged
Scoppio
Active Member

Offline Offline

Posts: 12


View Profile
« Reply #2 on: March 25, 2011, 12:53:09 PM »

Well... I'm taking a look in your plugin but I don't get one thing - Where do you send the data trought the USB? I can't find any function that send's the data to the USB port, could someone please point that for me?
Logged
jarekk
Active Member

Offline Offline

Posts: 47


View Profile
« Reply #3 on: March 25, 2011, 02:21:37 PM »

This is virtual plugin  designed to show Mach internals. So no real USB - just software emulation of it.
But - if you are asking about it - it depends on your particular USB device.   For most of my USB devices sending data is like writing to FIFO or file.  If you are interested in real examples see libusb project (http://sourceforge.net/apps/trac/libusb-win32/wiki) or FTDI library (http://www.ftdichip.com/Support/SoftwareExamples/CodeExamples.htm)
Logged
Scoppio
Active Member

Offline Offline

Posts: 12


View Profile
« Reply #4 on: March 25, 2011, 10:45:00 PM »

actually I'll be using a PIC18F4550 to convert the USB into a LPT1 to run 3 stepper motors axis :\
Logged
jarekk
Active Member

Offline Offline

Posts: 47


View Profile
« Reply #5 on: March 26, 2011, 08:44:19 AM »

Use external USB/ serial port or fifo controller. It adds about 19$ to the cost ( for ready made DIP style module from DigiKey ), but it is easier in the beginning.
Logged
Scoppio
Active Member

Offline Offline

Posts: 12


View Profile
« Reply #6 on: March 27, 2011, 05:46:02 PM »

Actuallly, I develop cnc's using pic's, thats the first time I'll try to use the usb port to communicate with the pic instead of using the Parallel, the problem is actually making the mach3 send the data to the pic via USB :\
Logged
jarekk
Active Member

Offline Offline

Posts: 47


View Profile
« Reply #7 on: March 28, 2011, 02:07:34 AM »

Mach will *NEVER* send anything on USB - it has to be your plugin which takes Mach data and sends it itself.
Have a look at some my routines - PC side for FT245R chip ( USB-> Parallel FIFO) converter and LPC1769 code to get data from it.

If this is too complicated - then wait until you try to extract motion data from Mach....

* ft245R_USB.ZIP (2.37 KB - downloaded 165 times.)
Logged
Tweakie.CNC
Active Member

Offline Offline

Posts: 3,263


Super Kitty.


View Profile WWW
« Reply #8 on: March 28, 2011, 10:50:31 AM »

Something you may find interesting.

http://www.machsupport.com/forum/index.php/topic,17992.0.html

Tweakie.
Logged

Success consists of going from failure to failure without loss of enthusiasm.  Winston Churchill.
Scoppio
Active Member

Offline Offline

Posts: 12


View Profile
« Reply #9 on: March 28, 2011, 11:53:48 AM »

Mach will *NEVER* send anything on USB - it has to be your plugin which takes Mach data and sends it itself.
Have a look at some my routines - PC side for FT245R chip ( USB-> Parallel FIFO) converter and LPC1769 code to get data from it.

If this is too complicated - then wait until you try to extract motion data from Mach....

Yeah, i know, thats way I asked how to make THIS plugin send data via USB :\
I'll keep searching how to do it, but the hardware is pretty much standar - usb input, control of steppers, etc...

Something you may find interesting.

http://www.machsupport.com/forum/index.php/topic,17992.0.html

Tweakie.

really interesting, actually thats EXACTLY what I'm trying to do, but instead of atmel MCU I'll be using a Microchip PICmcu and instead of an Altera FPGA I'll be using 3 pics mcu specialized on driving step-motors (to decrease the learning/development time).
Logged
Pages: 1 2 3 »   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!