Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: router101 on May 02, 2010, 09:09:02 PM

Title: Using Mach3 with Reprap extruder
Post by: router101 on May 02, 2010, 09:09:02 PM
Gooday from Sydney.

I have recently built a four axis gantry robot running Mach3 software.
It uses a four motor parallel port hobby cnc controller, and runs on windows 2000.

I am building an extruder and want to know how to make parts with this rig.

I have four active stepper motor channels and motors working.

Mach3 can control up to six channels.

The real question is how do I assaign the b or c axis to driving the extruder?

Has anyone been down this path?

Thanks Peter.
Title: Re: Using Mach3 with Reprap extruder
Post by: poppabear on May 03, 2010, 12:56:55 AM
does the extruders rate of extrusion have to be tied to the movement of the other axis?
if yes, then you could tie in that axis rate with overal machine movement.
If no, i.e. the extruder function runs at a set rate, then you could just set/control that rate externally.
I have not ever got to play with an extruder to see how they work, so cant say for sure.

BUT, if you can define what it needs to do, and how it needs to do it, I/we could help you more.

scott
Title: Re: Using Mach3 with Reprap extruder
Post by: kf2qd on May 03, 2010, 12:16:34 PM
What is it your are trying to do? Are you trying to control the Reprap with Mach3 or are you trying to make parts for the Reprap? From the research I have done into the Reprap you will be running a 3 axis machine with an extruder to lay down the material. 3 axis are X Y & Z. Does the extruder need a speed contol or on/off control? is the extruder the 4th axis? Might it be setup as the spindle axis and use speed commands to control extrusion rate?

If you want answers you need to describe your problem a bit more fully so those reading your post know what you are doing. otherwise we are apt to give you that answers we think you are asking for instead of answers that would be of some use to you. Not meaning to harsh, but we can't see what you are working with or imagining and thus it is hard to give good answers.
Title: Re: Using Mach3 with Reprap extruder
Post by: router101 on May 03, 2010, 08:27:37 PM
Gooday thanks for the reply.
Firstly I am trying to make reprap parts using mach3 with a custom made extruder.
I would like to use the extruder to make other parts later.
Reprap g code defines extruder and uses E as the feedrate. See the G code below.

I want to be able to download a reprap part g-code description and run it using mach 3 software.
I want to know how to patch E onto a functioning axis such as A, so I can control the extruder.
I want to be able to control temperature on the extruder using the G code shown below.

Thanks Peter

G1 F1500
G1 X90.6 Y13.8 E22.4 F3000

Will set a feedrate of 1500 mm/minute, then do the move described above accelerating to a feedrate of 3000 mm/minute as it does so. The extrusion will accelerate along with the X, Y movement so everything stays synchronized.

RepRap thus treats feedrate as simply another variable (like X, Y, Z, and E) to be linearly interpolated. This gives complete control over accelerations and decelerations in a way that ensures that everything moves together and the right volume of material is extruded at all points.
Example: M104 S190

Set the temperature of the current extruder to 190oC and return control to the host immediately (i.e. before that temperature has been reached by the extruder). See also M109.
M105

Example: M105

Request the temperature of the current extruder in degrees Celsius. The temperature is returned to the host computer.
M106

Example: M106

Title: Re: Using Mach3 with Reprap extruder
Post by: kf2qd on May 03, 2010, 10:02:37 PM
Feedrates work a bit different in a normal CNC operation. - if there is no axis move then NOTHING will run. Your G01 F1500 will do nothing as there is no axis move. You will get the same results from the following move with F3000 as you would without the G1 F1500 line. the only way you can have any "motion" would be to treat the extruder as a "spindle" and set its speed and motion using the S1500 M3 command and the add an S3000 to another move. then to stop the extruder you would use M5. The other problem with your idea is that you would have to have a, Say a C-Axis tied to the extruder but it programming it would be a challenge as coordinated moves all axis start and finish at the same time.
Title: Re: Using Mach3 with Reprap extruder
Post by: router101 on May 04, 2010, 02:22:06 AM
Thanks for the replies so far.
Here is some g code from a reprap part.
The speed and flow rates are already worked out.
I just need to tell mach3 that E=B so it can drive the extruder stepper.
Can this be done?
Can I display x, y, z 4, and 5 in the control window?
Thanks

M101
G1 X94.34 Y24.61 Z0.4 F960.0 E98.202
G1 X94.34 Y28.89 Z0.4 F960.0 E102.482
G1 X84.33 Y28.89 Z0.4 F960.0 E112.491
G1 X79.33 Y34.89 Z0.4 F960.0 E120.301
G1 X76.14 Y34.89 Z0.4 F960.0 E123.492
G1 X76.14 Y50.25 Z0.4 F960.0 E138.854
G1 X74.82 Y48.27 Z0.4 F960.0 E141.239
G1 X73.39 Y46.86 Z0.4 F960.0 E143.25
G1 X71.73 Y45.71 Z0.4 F960.0 E145.261
The average feedRate is 15.9 mm/s, (955.8 mm/min).
The cross section area is 0.2 mm2.
The extrusion diameter is 0.5 mm.
The extruder speed is 31.0
The extruder was extruding 86.5 percent of the time.
The extruder was toggled 2696 times.
The layer thickness is 0.4 mm.
The operating flow rate is 3.1 mm3/s.
The perimeter extrusion fill density ratio is 0.68
The perimeter width is 0.72 mm.
Title: Re: Using Mach3 with Reprap extruder
Post by: poppabear on May 04, 2010, 02:27:03 AM
well given that E is your extruder control of out feed goop, it will be set to some constant rate for the feed you have set. To convert the E to some other axis, i.e. C like in your example, I suspect you would need to parse the Gcode file in a plugin, find all the "Exx.x" and convert it the repost it to the G code window. kind of a pain in the butt, but do-able. Your other option is to do a Find-Replace operation in a text editor, switching all Exx.x to Cxx.x in the file, then save and load it in mach3.

Since you have a "Warm up time", I would Edit/make the macros you speak of for a pause time for warm up time that could be pulled off a "User DRO" on your screen. Your spindle in your case sets a temp, that implies some type of "Warmer/Heater" system that takes some value to set its temp. So, I would assume, that that spindle value in your current machine, would be some kind of "Digital value" like a 8, 10, or 12 bit value, if that is the case, and your heater is on Modbus, you could send it over modbus. If your heater takes an Analog 0-10v control value, you could also send it out as modbus to a "interface device", like: Peter Holmans ModIO, Aurturo Duncans Modus boards, or a ADC PLC like an 05 with an Analog module in it.

    Further, if possible, the CAM that writes your current machine extruder programs, I would see if you can Edit the post Processor to change the output type to what mach likes, THAT would be a Great Option.

scott
Title: Re: Using Mach3 with Reprap extruder
Post by: kf2qd on May 13, 2010, 09:50:31 AM
I think the best analog between your Reprap extruder and Mach 3 would be to use spindle control for the extruder. S98.2 m3 would replace the first E98.2. Use the spindle as the extruder control as the spindle output is not tied to any axis motion. In other words - you can at MDI type S98 M3 and the extruder would run, and just type M5 and the extruder would stop.  This would also let you use the spindle override feature to adjust the extruder feed rate if it is not putting out the correct amount of material and this would keep it independant of axis motion, or you could adjust axis feed override without altering the extruder rate. Either option would result in changes to how teh materiel is deposited.

I am assuming that the extruder runs independent of the other axis like the spindle does on a milling machine.