Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: benjaminmales on February 18, 2009, 05:26:04 AM

Title: dual arm control
Post by: benjaminmales on February 18, 2009, 05:26:04 AM
Hello there.

I am working on a project where we have two arms that we want to control to draw a picture. each arm has a simple motion of x and y along the plane of the paper and a z to engage the pen with the paper.

Does anyone know if it is possible to control 2 arms in this way? I understand mach3 can control 6 axis... perhaps there is a way of transforming the rotational axis to linear and wiring the actuators for the second arm into these on the control board.

Any help would be much appreciated!

Cheers

Benjamin
Title: Re: dual arm control
Post by: jimpinder on February 18, 2009, 05:50:22 AM
Mach 3 is designed to do just that. It is normally used to control linear axis, not rotating ones.

You do not say how you are controlling these arms, but steppers motors would seem to be best for your system, they are cheap and reliable and drivers are available for them.

Mach 3 control these motors by putting out step pulses and direction pulses (i.e. two wires) to each driver card to move each axis. So make sure if you buy , that they work on pulses. (See Arc Euro Trade website under stepper motors and drivers for the general feel and a guide to prices) - if you are in America then I am quite sure some of our friends across there can advise you.

Control is by GCode programs. which simply move the cutter/tool/pen from where the machine is to where you want is to go with simple commands e.g. G0 X3.2 would move the pen from where-ever it is on the x axis, to position 3.2 (This can be millimeters or inches from your start point) Similar y commands moves the pen up and down the y axis, whilst z commands are normally to lift the tool/pen up and down off the work. Two axis on one line e.g. G0 X4.5 Y6.2 would move the pen in a straight (diagonal) line to the new co-ordinates. Mach 3 keep track of it's position at all times, and gives a digital read out of it.

The control of the other three axis is normally for complex machines for angled drilling or machining, but the majority of us poor relations just use the x,y,z

Get to it ;D





Title: Re: dual arm control
Post by: benjaminmales on February 18, 2009, 06:17:24 AM
Great!

I am using steppers via a parallel controller so i think that will all work out OK. Still in the building stage of the machine and starting to think how to actually control the thing. I should really download mach3 and play but I was just worried about trying to use 2 arms as I assumed it would be designed for just 1 controlled arm.

Im based in London so no chance of getting help from across the pond!

Thanks for your quick reply
Title: Re: dual arm control
Post by: HillBilly on February 18, 2009, 07:13:25 AM
The problem you will run into is using G2 and G3, the arc commands. If the arms are slaved, drawing the same thing, it will work. If they are independant all your moves will have to be G0 and G1 linear moves.

Darek
Title: Re: dual arm control
Post by: jimpinder on February 18, 2009, 01:44:17 PM
If you are in London, have a look at the Arc Euro Trade website for details of their products - stepper motors and drivers. Mine are the 220 Ncm ones - fairly large to drive a metal turning lathe system. you could probably try the small ones, or the next up.

Bear in mind that gearing comes into focus here. If you are willing to sacrifice a little bit of speed, and gear down your motor then you can get away with smaller drives and smaller motors. Mine are geared down 60,000 to one, and could still manage 40 ins per minute. This sounds a lot, but the motors require 200 pulses to turn 1 rev, the drives multiply this by 10 micropulses (=2000), I have 3 to 1 gearing to drive my leadscrew, which turns 10 time to move the table 1 inch (i.e. 60,000 pulses). This means that my computer has to put out 60 pulses to move the table by 1 thousanth of an inch - accuracy is what I need, but I also get the power from the motors - more than enough to snap of 6 mm drills without even trying.

I would try the small motor, with the small driver, and maybe some sort of toothed belt driving the pen holder. Bearing in mind if you use a tooth belt system you can alter the various drive wheels very easily until you reach the ideal set up.

Title: Re: dual arm control
Post by: Tweakie.CNC on February 19, 2009, 09:05:49 AM
Hi Ben,

Whilst Mach is capable of controlling 6 Axis the software to produce the necessary GCode for positioning and controlling your two arms would be extremely specialized. I have no knowledge of any such available software so I think you would have to write your own GCode for anything you intend to produce. Simple stuff is OK but you would have to be extremely serious to write GCode from scratch for complicated products.

Tweakie.
Title: Re: dual arm control
Post by: benjaminmales on February 19, 2009, 03:15:05 PM
Thanks for all your replies!

It's a shame... looks like it might be a lot more difficult than I imagined. I wonder if there is a way of switching between arms so that half of the time one arm is drawing and then the other?? Although one of the major points of the machine is that the arms operate simultaneously :-\.

The problem with writing specific GCode for the second arm is that the image will be different each time the machine operates.... perhaps the gcode could be generated by a separate app and then imported and run for each arm??
Title: Re: dual arm control
Post by: zealous on February 19, 2009, 05:13:23 PM
To get a better understanding of your setup could you post a picture, and a simple Gcode that you use now to control the machine. How are you getting the images to Gcode now?
Title: Re: dual arm control
Post by: jimpinder on February 20, 2009, 03:26:49 AM
Do you mean that you are wanting X Y and Z movement on both arms, in other words vour robot is very clever and can draw left or right handed. If so, you will need six axis, one for each movement - an axis can ony control movement in a straight line on one plane. It is the combination of X Y and Z that produce shapes.

I will echo what someone has put before - yes it is possible, but the software to control it will take some writing, especially for complicated pictures that involve anything other than straight lines, or arcs of a circle - both of which are GCode commands.

The  second three axis, A B and C are controlled by their own commands, and can be linear or rotating axis, so software for one arm can be used on the other by substituting AB and C for X Y and Z
Title: Re: dual arm control
Post by: benjaminmales on February 20, 2009, 12:11:46 PM
Hopefully these image can help explain whats going on.

(http://www.benjaminmales.com/images/jen_4.jpg)
(http://www.benjaminmales.com/images/jen_2.jpg)


The designer is in the process of building a prototype of this. There are basically two identical and opposite 'arms' which can move in x and y directions along the plane of the surface. z is achieved by a little arm that rotates down to engage the drawing implement to the surface of the paper.

The idea is that the system will be given an image. The image will be simplified via processing and then drawn by the machine. This catch is that the job has to be shared between the two arms so that they are both working on the same image (and not colliding!). The processing part is sorted... in that I can produce a very simple light and dark region image of the face with smooth edges ect. The problem is the rest.

I was going to work out whether I could control 2 arms independently from mach3 first and then address the other problems from then.

Perhaps this helps? I know, it's rather ambitious!
Title: Re: dual arm control
Post by: HimyKabibble on February 20, 2009, 12:38:12 PM
Seems to me the Mach3 part of it is pretty straight-forward, and there's no question Mach3 is more than capable of controlling the machine.  Mach3 can control six axes, and you have six axes to control.  The real challenge is the G-code generation, which is mostly an exercise in kinematics and coordinate system transformation, and not something anyone here is likely to be able to help with.  The motion of each arm can be exporessed by some fairly simple equations of motion, so you can come up with a means of mapping any given X/Y position in the drawing to a set of coordinates for one of the two arms.  You clearly need to be able to partition the drawing into sections to be drawn by each of the arms, such that they won't crash into each other while drawing.  This pretty much has to start with splitting the drawing down the middle between the two gantries, then perhaps shifting that dividing line one way or the other to "load balance", if the line density is not pretty consistent on the two halves.  Then, you have to translate the 2D vectors comprising the drawing into the 3D movements of the arms, doing the necessary kinematic permutation from cartesian coordinates to the machines coordinate system.  Given the euqations of motion for the arms and gantries, this should not be fundamentally difficult.  Finally, you need to output the G-code, merging individual moves for the two arms into single G-code move commands that will complete in essentially the same period of time, so you keep both arms busy drawing at full speed as much of the time as possible, rather than having one axis running full speed, while the other moves a low speed because it has a shorted line to draw.  All perfectly do-able, but that last part is, I think, not trivial to do efficiently.

Something to consider - it would probably be a lot simpler, and more efficient, to have two computers, and two copies of Mach3 running, one controlling each arm, so you don't have to do as much coordination between the two.   This would make it a LOT easier to keep both of them moving all the time, and eliminate that last nasty step in the G-code generation.

Regards,
Ray L.
Title: Re: dual arm control
Post by: Tweakie.CNC on February 21, 2009, 02:53:59 AM
Ben,

Do you need complete positional control of the two Z axis or is is just 'pen up / pen down' as you would have with a plotter ?.

Tweakie.
Title: Re: dual arm control
Post by: benjaminmales on February 22, 2009, 05:36:24 AM
Thanks for your new replies.

I'm glad you think it's do-able. I think Using 2 computers may be a way forward, and will simplify the actual drawing part significantly. As for the preparation of the GCode, this is something I will have to spend a bit of time thinking about. I understand that Lazycam can create Gcode from files such as JPEG or DXF. Perhaps this could be something I could look at (as the source image will most probably be a JPEG). If this is possible I could split the image during processing and generate GCode for each part. This could be sent to 2 computers to do the drawing.

As for the Z axis control, Tweakie, It only needs to be pen up/pen down as with a plotter.

Cheers

Benjamin
Title: Re: dual arm control
Post by: HimyKabibble on February 22, 2009, 11:20:17 AM
Thanks for your new replies.

I'm glad you think it's do-able. I think Using 2 computers may be a way forward, and will simplify the actual drawing part significantly. As for the preparation of the GCode, this is something I will have to spend a bit of time thinking about. I understand that Lazycam can create Gcode from files such as JPEG or DXF. Perhaps this could be something I could look at (as the source image will most probably be a JPEG). If this is possible I could split the image during processing and generate GCode for each part. This could be sent to 2 computers to do the drawing.

As for the Z axis control, Tweakie, It only needs to be pen up/pen down as with a plotter.

Cheers

Benjamin

I don't think *any* off-the-shelf CAM program will do you any good, as it will simply output X/Y/Z moves for a conventional orthogonal axis machine, which is not what you have.  Or would you then post-process the CAM-generated G-code to do the coordinate transform?  That would work, but probably would be extremely inefficient.

Regards,
Ray L.