Analog Inputs With Arduino & Mach3
Analog Inputs With Arduino & Mach3
Here's a tutorial about how to get analog inputs in Mach3 with Arduino. It is assumed that you are
familiar with what Arduino is and how to put sketches on it with the arduino software. Details about it
can be found at http://www.arduino.cc. It is also assumed that you have fair amount of experience with
setting Mach3 installation and setup. Information about Mach3 can be found at
http://www.machsupport.com.
Here I will demonstrate how to use two potentiometers to adjust the Feed Rate Override (FRO) and
Spindle Speed Override (SSO) in Mach3.
Now go to the Function Cfg's menu and select Setup Serial Modbus Control from there
A screen similar to this will appear. Do the settings as shown in the figure below.
Please note the Port Num: might be other than 3 on your PC for the arduino. You can check the port
number on which Arduino is installed in the arduino software. When you click on Apply button on this
window the communication between Mach3 and Arduino should begin. You should see the TX and RX
Led's on the Arduino board blinking at a rapid rate.
Brain
Next step is to write the brain that will change the FRO and SSO dro's based on the input from
Arduino. Open the brain editor from the Operator menu
Now write a brain as shown in the figure below and save it as AnalogFRO.brn
If you find it difficult to write it then you can download it from Mach3 support forum
(http://www.machsupport.com/forum/index.php/topic,22980.0.html) and save it in your brains folder in
Mach3.
Next we'll have to enable the brain. To enable it click on Operator menu and then on Brain Control
Now select the AnalogFRO.brn in the Loaded Brains window and click on the Enabled checkbox to
enable it. In the end click on the button labeled Reload All Brains to activate it. You should be able to
see the response of your FRO and SSO potentiometers on the Mach3 screen.
Disclaimer
In the end the usual disclaimer with translates in plain English that you are responsible for all the
stupid actions you do with these devises and if anything good comes out of it then the credit goes to
me. Anyways, play safe, take care and have a nice day.