Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Reckless on January 15, 2023, 03:58:25 AM

Title: Trying to get Mach3/Mach4 to work with Dorna Robot G2Core Arduino Due 5-axis
Post by: Reckless on January 15, 2023, 03:58:25 AM
I have a Dorna Robot which is a 5 axis robot that uses Arduino Due/G2core.  I want to speed the robot up and use arduino due thats installed in the controller.  It was originally setup for G2core but I heard that it is buggy so thinking to flash to GRBL then using Mach3 or Mach4 to control.  Any suggestions?  Do I need any external hardware?

I will be attaching a fancy cognex 2d camera to PC for robotic guidance and part inspection.  Will Mach4 be better for this?
Title: Re: Trying to get Mach3/Mach4 to work with Dorna Robot G2Core Arduino Due 5-axis
Post by: Tweakie.CNC on January 15, 2023, 06:12:31 AM
Neither Mach3 or Mach4 support full kinematic motion for robot arm control however there is a 'teach' function whereby a sequence of (5 or 6 axis) movements can be recorded and then repeated as desired (bit like the operation of a robot arm in a car body welding shop).

Tweakie.
Title: Re: Trying to get Mach3/Mach4 to work with Dorna Robot G2Core Arduino Due 5-axis
Post by: JohnHaine on January 15, 2023, 09:42:43 AM
Or indeed GRBL.!
Title: Re: Trying to get Mach3/Mach4 to work with Dorna Robot G2Core Arduino Due 5-axis
Post by: Reckless on January 15, 2023, 11:41:54 AM
I asked chatgpt this is the response I got:

Mach3 and Mach4 are both CNC software programs that can be used to control CNC machines. They both support full kinematic motion, which means they are able to control the movement of the machine in all three axes (X, Y, and Z) and can perform a wide range of motion commands, including linear and circular interpolation, helical motion, and more.

Mach3 and Mach4 are capable of controlling CNC machines with 5 axes, but the level of support for kinematic motion in 5 axes may vary depending on the specific version and configuration of the software. Some versions of Mach3 and Mach4 support 5-axis motion control using specialized plugins or add-ons, while others may not have built-in support for 5-axis motion control.
Additionally, The five-axis functionality also depends on the capability of the controller used in the CNC machine. It is recommended to check with the software and controller manufacturer for specific details on 5-axis motion control support.


Mach3 was suggested by the manufacturer over g2core as g2core open source has some bugs.  It can be done and can make the robot move much faster.  There is a g2core plugin for mach4 not sure about mach3.
Title: Re: Trying to get Mach3/Mach4 to work with Dorna Robot G2Core Arduino Due 5-axis
Post by: JohnHaine on January 15, 2023, 06:03:38 PM
Well despite the great press it's getting at the moment I don't think chatGPT is all that reliable when it comes to given good factual answers, based on some recent personal experience.  I think there is also a misunderstanding both perhaps on the part of chatGPT and your manufacturer as to what g2core does compared with Mach3/4.  Mach is not just, or even, a motion controller as I understand it.  Mach3 can control motion using stepper type motors with what amounts to a parallel port plugin which is the "motion controller" part.  Though I understand there is a PP plugin for Mach4 it is deprecated and an external motion controller is preferred - which might logically be g2core or GRBL but neither of those are supported.  There is a range of motion controllers for Mach that connect using either Ethernet or USB - their suppliers need to implement the API to Mach which is not open.  Though Mach can certainly control 4 axes, and might do 5, it is optimised to run CNC machining define by G-code commands rather than a robot.
Title: Re: Trying to get Mach3/Mach4 to work with Dorna Robot G2Core Arduino Due 5-axis
Post by: joeaverage on January 15, 2023, 09:51:23 PM
Hi,
Mach, be it Mach3 OR Mach4 is a Gcode interpreter and trajectory planner. Its output is a string of numeric data, in 32 bit integer blocks that describe the controlled point in 1 millisecond time slices.
To my knowledge neither g2core nor GRBL can accept the numeric data that Mach produces.

A motion controller, for example an Ethernet SmoothStepper, has a plugin which is software that adapts the motion controller to Mach....but the same basic scheme is in action,
ie Mach produces a stream of numeric data, and the motion controller converts that data to pulse stream suitable for the axis motor drives.

Craig
Title: Re: Trying to get Mach3/Mach4 to work with Dorna Robot G2Core Arduino Due 5-axis
Post by: Reckless on January 16, 2023, 02:13:57 AM
I am trying to remove g2core/grbl from my system.  The controller already has a microprocessor (arduino due) wired up to servos.  I am hoping for a solution that does not require me to do any rewiring.  There are alot of wires for 5 axis and it already has a usb output/input.  Hoping to reflash firmware on arduino due so that it works with mach3/4.  Please tell me if not possible.  Hacking wires is not my specialty.
Title: Re: Trying to get Mach3/Mach4 to work with Dorna Robot G2Core Arduino Due 5-axis
Post by: joeaverage on January 16, 2023, 02:44:38 AM
Hi,
from what I can see it looks like the Arduino is the motion controller, but I know of NO Arduino based controller that accepts trajectory data
from either Mach3 or Mach4.

If you want to do that then get an Ethernet SmoothStepper and use the SmoothStepper to signal your five axis drives. The you could use Mach3
or Mach4, but note that Mach is a Gcode interpreter.....I'm not at all sure it will drive a robot arm.

Can you post a pic of the robot? If the robot has X, Y, A, and B axes then maybe, but if the axes are not orthongal then you require a kinematic
solver, and that is not what Mach does.

Craig
Title: Re: Trying to get Mach3/Mach4 to work with Dorna Robot G2Core Arduino Due 5-axis
Post by: Reckless on January 16, 2023, 02:51:25 AM
https://www.kickstarter.com/projects/775197166/dorna-fast-powerful-and-precise-robotic-arm (https://www.kickstarter.com/projects/775197166/dorna-fast-powerful-and-precise-robotic-arm)

here is pic of controller but video shows ethernet but its usb:
https://www.youtube.com/watch?v=AXnRwwztdfw

I believe this shows what mach3 improved speed:
https://www.youtube.com/shorts/Fhmli5Vgebo
Title: Re: Trying to get Mach3/Mach4 to work with Dorna Robot G2Core Arduino Due 5-axis
Post by: joeaverage on January 16, 2023, 03:15:58 AM
Hi,
that is a robot arm with three rotating joints that I can see.  Gcode cannot drive that.

Gcode, at least lets start with just three axis Gcode, describes the movement of a machine along the X axis,
Y axis and Z axis all mutually orthogonal to each other. If you have a Gcode file like this:

G1 X 100
G1 Y100
G1 Z 100
G1 X0 Y0 Z0

then the machine moves to 100mm in the X direction, then it moves 100mm in the Y direction, then 100mm in the Z direction,
and the last line causes all three axes to move at once it a straight line from (100,100,100) to (0,0,0).

In order for your robot arm to describe a 100mm linear movement requires coordinated action between the three rotating joints.
This is done by a 'kinematic solver'. If you wish to make for instance a linear move of 100mm in a given direction at a given speed
the you need some software that can 'solve' for the required commands to each of the three rotating joints so that motion can be achieved.
The relationship between the three rotating joints is not necessarily constant either.

Mach is not, nor will it ever be a kinematic solver. If you have a separate program that does the kinematics then you could potentially use Mach
to signal the motor drives, not a very practical solution. It would be a bit like translating English into Chinese and the Chinese to Russian, when it would
be better to translate direct from English to Russian and skip the Chinese bit altogether.

I don't think Mach is going to help you. Mach is a GCode interpreter and orthogonal trajectory planner, great for CNC machines and 3D printers,
CNC lathes and CNC Laser tables but no good for robot kinematics. You are barking up the wrong tree.

Craig
Title: Re: Trying to get Mach3/Mach4 to work with Dorna Robot G2Core Arduino Due 5-axis
Post by: Reckless on January 17, 2023, 12:12:47 AM
It looks like to me that mach4 is designed for robots, from website:

Mach4 can control CNC machinery, PLC equipment, and robotics. The core is a full featured ‘brain’ that ensures all input and output devices are coordinated with motion.

All Motion control calculated in the core = less dependence on hardware and associated software driver.

Motion Device Drivers (Plug Ins) have standard format = common level of functionality between components, less complexity, easier and less costly to troubleshoot and support.

New Features Continued
Title: Re: Trying to get Mach3/Mach4 to work with Dorna Robot G2Core Arduino Due 5-axis
Post by: Tweakie.CNC on January 17, 2023, 12:40:35 AM
As in my earlier posting...

Neither Mach3 or Mach4 support full kinematic motion for robot arm control.

Tweakie.
Title: Re: Trying to get Mach3/Mach4 to work with Dorna Robot G2Core Arduino Due 5-axis
Post by: JohnHaine on January 17, 2023, 04:53:51 AM
I can imagine that Mach could control a robot with only rectilinear motion, X, Y, Z and a couple of rotational axes.  That could suit for example a pick and place application.  But for a robot arm all the motions are rotational, even if you want to move the control point in a straight line, so there would need to be a translation stage in between the Mach trajectory planner and the motion controller to resolve the straight line in say the X direction to appropriate rotational moves.  AFAIK Mach does not incorporate that of have the hooks to do it.

But if you are not convinced why don't you contact NFS sales support and ask them?  They are a commercial organisation so should be able to help potential customers understand the product capabilities. 
Title: Re: Trying to get Mach3/Mach4 to work with Dorna Robot G2Core Arduino Due 5-axis
Post by: Reckless on January 17, 2023, 11:09:06 AM
I sent a message to support last night and they responded this morning that they don't have a way to do inverse kinematics.  I tried googling if there is a plugin for it but it seems like they all disappeared. 
Title: Re: Trying to get Mach3/Mach4 to work with Dorna Robot G2Core Arduino Due 5-axis
Post by: joeaverage on January 17, 2023, 02:34:57 PM
Hi,
while Mach cannot do inverse kinematics, what Mach and a compatible motion controller can do is generate pulse streams for axis motors and
this it does very well.

If you wrote your own kinematic solver the you could use it to effectively 'feed Mach with Gcode' which would result in the motion controller producing
pulses for your drivers.

Gcode we are familiar with tends to be of the form:
G1 Xnnn Ymmm Zppp
which causes the machine to linearly interpolate from its current position to (nnn,mmm,ppp). We conventionally assume that the axes are mutually orthogonal,
ie X, Y, Z but they could be rotary axes just as well. With that understanding (nnn,mmm,ppp) would be the angular position rather than a cartesian position.
If your kinematic solver were to output a stream of angular positions then you could drive your robot arm.

I use Mach4 and am most familiar with it. The scripting language of Mach3 is called Cypress Enable and is a subset of Visual Basic and is a dogs breakfast. Mach4 uses
Lua, which has its challenges also but it blindingly fast and stable by comparison to VB. You could write a kinematic solver in Lua, which would in turn drive Mach4's core.
Note also you can write C code for Mach4, not that I have done so, so I can't give any details about how its done......but if you'd prefer to use C, and for a kinematic solver
I can well imagine C would be preferrable.

Are you up for a software challenge?

Craig
Title: Re: Trying to get Mach3/Mach4 to work with Dorna Robot G2Core Arduino Due 5-axis
Post by: Reckless on January 17, 2023, 03:09:14 PM
My software days are over.  I am willing to hire someone for this or even better if chatgpt could be used to write the code.  Does anyone know what I should tell chatgpt so it does this for me? 
Title: Re: Trying to get Mach3/Mach4 to work with Dorna Robot G2Core Arduino Due 5-axis
Post by: joeaverage on January 17, 2023, 03:15:27 PM
Hi,
have you bothered to do any research on kinematic solvers?

Google IKFast, its an open source kinematic solver.

I think the expectation that someone else is going to do it for you is a joke. If you cant be bothered to do anything why should anyone else?

Craig
Title: Re: Trying to get Mach3/Mach4 to work with Dorna Robot G2Core Arduino Due 5-axis
Post by: JohnHaine on January 17, 2023, 04:45:59 PM
.....even better if chatgpt could be used to write the code.  Does anyone know what I should tell chatgpt so it does this for me? 

Well I guess in principle you would have to fully define the function of the code you want chatGPT to write.  For example you could write it in C - but then you'd have solved your problem.
Title: Re: Trying to get Mach3/Mach4 to work with Dorna Robot G2Core Arduino Due 5-axis
Post by: Reckless on January 17, 2023, 04:50:29 PM
Hi,
have you bothered to do any research on kinematic solvers?

Google IKFast, its an open source kinematic solver.

I think the expectation that someone else is going to do it for you is a joke. If you cant be bothered to do anything why should anyone else?

Craig

I googled it for 5 minutes yesterday and had no luck, had to jump on to other projects.  I usually post here to get some leads.  Will look into google ikfast thank you.