Page 2 of 2

Re: Heating extruder only on printing moves

Posted: Fri Apr 27, 2018 6:40 am
by Asadinator
ednisley wrote:
Asadinator wrote:I’m not skilled enough to start from scratch :D
No shame there, because nobody starts out knowing this stuff ...

A cheap Chinese CNC machine kit (considerable assembly required) from Amazon (cheaper elsewhere, your choice):

https://www.amazon.com/Control-Engravin ... B07169D9JQ

You get about the same work area as the M2, a platform intended to hold down parts, a junk spindle you won't need, a crappy stepper controller with backlevel GRBL, and bag of "engraving bits", all for just over $200. Toss the crap you won't need in a drawer, assemble the rest, and verify that it more-or-less works.

Control the ultrasonic head with a solid-state relay attached to the spindle enable output, so you get easy G-Code control over the thing. If it has a PWM intensity input, the spindle speed control will do that for you, too.

Reflash the controller with current GRBL to get a solid G-Code parser & motion controller:

https://github.com/gnea/grbl

Now you have a low-end CNC machine with enough accuracy & speed for your purposes. The newer versions of GRBL include a "laser mode" that may be useful with an ultrasonic head.

If you're moving the head in geometric patterns or tracing shapes, then you can probably generate the G-Code algorithmically. Fetch the G-Code Meta Compiler:

http://www.vagrearg.org/content/gcmc

Generate G-Code with a semi-high-level language and move on.

It'll take some learning, but doesn't require working around the limitations of Marlin, a 3D printer tool chain, and a hacked M2. The problems you solve will be directly related to doing what you want done, not battering software into doing something it's not designed to handle and figuring whether it's your design or battered code falling off the rails.

Bonus: this keeps the M2 operational so you can make the parts to bolt the ultrasonic head on the CNC spindle mount.
funnily at 75W as you mentioned
Well, 24 V times the 2-3 A you mentioned rounds off to 75 W, soooo ... [grin]
Cheers for the help Ed. If I ever get the time I’ll look into that.

I’m hacking the M2 as a proof of concept (which I’m not revealing now) but when it comes to making a real solution I would need to get expert help. It’s not really for me to get too technically invested.

For your bonus suggestion, did I mention the transducer and support would be submerged? :D no cheap ABS plastic for me, already purchased in SS for M2 mounting :D

Re: Heating extruder only on printing moves

Posted: Sun Apr 29, 2018 12:13 pm
by Asadinator
insta wrote:You might be able to use Marlin's "DISABLE_E" configuration option, which will disable the stepper driver immediately when it's not being used.

You can then swap the E0_ENABLE and HEATER_0_PIN numbers in pins_RAMBO.h. Make sure your TEMP_SENSOR_0 is 999, and TEMP_SENSOR_BED set to 998, and DUMMY_THERMISTOR_999_VALUE set to 180C.

This should make the heater pop on immediately when trying to move the extruder, which would be any G1 command using an "E" value.
Hi insta

I am confused about the pins.h file since there are multiple duplicates. Which MOTHERBOARD settings are for the M2 with v3b hotend from 2014 with 24v supply and no lcd screen?

Also I made Temp_sensor_0 = 0 (no thermistor) and dangerous extruder moves to 0 (off).
Will this achieve the same thing?

Re: Heating extruder only on printing moves

Posted: Sun Apr 29, 2018 9:38 pm
by insta
You want pins_RAMBO.h, or a MUCH newer version of the firmware than you're using.

Your "no thermistor" and "dangerous moves" will probably be fine.

Re: Heating extruder only on printing moves

Posted: Mon Apr 30, 2018 4:06 am
by Asadinator
insta wrote:You want pins_RAMBO.h, or a MUCH newer version of the firmware than you're using.

Your "no thermistor" and "dangerous moves" will probably be fine.
Thanks Insta, it worked so far, I don’t get thermistor error and I can operate extruder.

Another query -> I would like to monitor when the heat0 output is on/off.
I am using Repetier Host and you are able to view a temperature graph of extruder and bed, and the output to the extruder and bed. I’m no longer interested in the temperature, but output is very useful.
Would it show the output to extruder if I change the pin configuration with E0_enable?
Or do I have to change something else to output E0_enable for graphing...

Re: Heating extruder only on printing moves

Posted: Wed May 02, 2018 11:20 am
by Asadinator
insta wrote:You might be able to use Marlin's "DISABLE_E" configuration option, which will disable the stepper driver immediately when it's not being used.

You can then swap the E0_ENABLE and HEATER_0_PIN numbers in pins_RAMBO.h. Make sure your TEMP_SENSOR_0 is 999, and TEMP_SENSOR_BED set to 998, and DUMMY_THERMISTOR_999_VALUE set to 180C.

This should make the heater pop on immediately when trying to move the extruder, which would be any G1 command using an "E" value.
Hi insta,

I’ve been playing around with this using a extruder, then I over cooked the heating element to 260C by accident, so used a fan pin for E0_enable to monitor.
There is a key thing you missed and that is to flip the extruder inverter to be enabled high.
Then it is working.

However apart from being correctly enabled at the start of printing moves and disabled at the end of job, it is still enabled during travel moves.
I believe the reason for this is the stepper inactivity time, which is by default at 246*10001. That is 2460 seconds.
If I reduce it to like 0.01s, would it only disable extruder and keep other moters on?
Because in the stepper inactivity code it disables them all???
Or should I add another code to only disable extruder really quickly.

Re: Heating extruder only on printing moves

Posted: Wed May 02, 2018 11:45 am
by Asadinator
And I forgot to mention, using manual control on RepetierHost, when you press extrude it successfully worked by turning on and then off.

There are a few other things I can play with to understand why it didn’t go off on travel moves when printing.

Re: Heating extruder only on printing moves

Posted: Wed May 02, 2018 3:16 pm
by insta
If #define DISABLE_E isn't doing it, then I'm going to have to go back to Ed's suggestion of you're pushing Marlin a little too far out of its comfort zone. ;)

Re: Heating extruder only on printing moves

Posted: Thu May 03, 2018 12:47 am
by Asadinator
insta wrote:If #define DISABLE_E isn't doing it, then I'm going to have to go back to Ed's suggestion of you're pushing Marlin a little too far out of its comfort zone. ;)
:D

I dug deeper and found a check_axes_activity() function called at the end of inactivity in Marlin.ino. This is independent of a default motor disabling when the block queue is empty and a default time is reached.

Check_axes_activity() is the one checking the DISABLE flags. It uses a buffer size of 16 to check whether an axis is active or not in that range. This is the issue because interval for travel moves are less than 16.
I will hack the if function to use effectively a buffer size of 2.

Re: Heating extruder only on printing moves

Posted: Thu May 03, 2018 10:55 am
by Asadinator
Solved! 8-)

As mentioned before I modified the check_axes_activity() function as follows:

Code: Select all

while(block_index != block_buffer_head - 1)
to

Code: Select all

while(block_index != block_buffer_tail + 1)
which instantly disables extruder when not an extruder move.

Also ignore my stupidity from before, I later tested this with the LED pin not Heat0 or Fan pins, to monitor it real time not with any lag.