Hello Guest it is March 28, 2024, 10:10:20 AM

Author Topic: How to create a plugin for Mach3  (Read 11537 times)

0 Members and 1 Guest are viewing this topic.

How to create a plugin for Mach3
« on: May 12, 2014, 07:37:43 PM »
About two years ago I built a CNC and a PIC based controller board. The controller is connected to an old computer through a parallel port, but now I realy would like to use my leptop to control it through the serial port (USB to Serial adapter). I've searched it on google but did not found what I want. I know that it's possible to create a plugin and instal it on Mach3.

My question is: is it possible to create a plugin that makes Mach3 send a certain character to the serial port each time it sends a pulse to the parallel port? for example: each time it sends a pulse to the parallel port to rotate clockwise the motor X, it sends also a character (for example "a") to the serial port, so the controller board connected to the serial port can get that character and rotate the motor. This way I can control my CNC from my leptop which has no parallel port.

If it's posible, what should I learn and what softwares should I use to make it? I have C programming knowledge and use Code::Blocks.
Any tutorial or guide would be appreciated.

I'm not sure if my English is understandable, but sorry for any mistake!

Thanks in advance!!!
« Last Edit: May 12, 2014, 07:55:20 PM by Peta »
Re: How to create a plugin for Mach3
« Reply #1 on: May 18, 2014, 12:09:55 AM »
Hi Peta,

Have a look at the Ethernet Smoothstepper board from Warp9.
That would save you alot of work and you can use it on your laptop ethernet port.
They also have a USB version however I would recomend the Ethernet version.

Good luck with it.

Cheers Al.

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: How to create a plugin for Mach3
« Reply #2 on: May 18, 2014, 07:11:41 AM »

My question is: is it possible to create a plugin that makes Mach3 send a certain character to the serial port each time it sends a pulse to the parallel port? for example: each time it sends a pulse to the parallel port to rotate clockwise the motor X, it sends also a character (for example "a") to the serial port, so the controller board connected to the serial port can get that character and rotate the motor. This way I can control my CNC from my leptop which has no parallel port.

If it's posible, what should I learn and what softwares should I use to make it? I have C programming knowledge and use Code::Blocks.
Any tutorial or guide would be appreciated.

Thanks in advance!!!

See the Ma h3 Programmer's Resources here:

http://www.machsupport.com/software/downloads-updates/#tabs-4
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: How to create a plugin for Mach3
« Reply #3 on: May 18, 2014, 11:00:36 PM »
Thanks for your help CNC-AL, I'll take a look at this, but for now I prefer something for my own controller board!
ger21, thank you very much, soon I'll start learning it and if I get any result I'll post it here, so others who want a cheaper system will benefit with it.
Re: How to create a plugin for Mach3
« Reply #4 on: November 12, 2015, 11:26:20 AM »
Hi again,

I know it is a really long time since I started this topic and I'm back to show the resolts of my efforts on making the plugin.

After some months working on it on my free time I moved from PIC to arduino as it is less time consuming and some days ago I finally got my CNC working with the system I created. You can see the first test here: https://www.youtube.com/watch?v=O385I6P_o8o

As you can see the motors do not move perfectly because I used DC motors with low resolution encoders (16 steps per revolution) and the control is based on a PID algorithm so it will always have some error between desired position and current position (about 5 steps) but it has an advantage: it will never lose steps permanently as the PID algorithm is constantly correcting the error.

I am working on some improvements now. Shortly I will post another video milling something and if there is sufficient interest I will release the pluging.

Please note that the controller is not for stepper motor, it is just for servo motors but I do think it's not too hard to adapt it for steppers.

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: How to create a plugin for Mach3
« Reply #5 on: November 12, 2015, 12:49:50 PM »
Very cool Peta!

To the untrained eye the boards and wires may not look like a lot of fun but I know what they are! Looks like your having a blast! Good on you!  :)

Will be watching how you advance.
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!
Re: How to create a plugin for Mach3
« Reply #6 on: November 20, 2015, 11:03:48 PM »
very interesting
waiting to see more on this
thanks
Re: How to create a plugin for Mach3
« Reply #7 on: July 18, 2016, 03:15:01 PM »
Hello Peta!
I have a question. Which Functions are you using to catch the control signal from Mach?
Thank you for your answer in advance!
Re: How to create a plugin for Mach3
« Reply #8 on: July 18, 2016, 04:07:38 PM »
Hello J-Steel, in the plugin sdk I used a timer to verify the axis index (in motor steps, NOT in inch or millimiters) every 50 milliseconds, if any axis changes the plugin sends the difference to the arduino board. You can read the axis index by reading the value in Engine->Axis[ x ].index (you should replace x with the axle you want to read, starting from 0 to 5. For example, 0 for X axis, 1 for Y axis and so on).
« Last Edit: July 18, 2016, 04:10:27 PM by Peta »