Welcome! Log In Create A New Profile

Advanced

Extruder direction voltage question

Posted by bluenovajinx 
Extruder direction voltage question
December 09, 2018 02:30PM
I'm running an Arduino Mega 2560 with a RAMPS 1.4 board. We have installed the 1.1.X Marlin firmware.

I have a question about modifying the idle direction voltage for our extruder. Our project is a bit unconventional. Rather than using a stepper driver with the extruder's direction and pulse, I have the direction used as the logic signal to a relay. The relay then controls a separate pump and valve. The direction values work when the extruder is actively retracting or extruding, but is inverted (compared to what I want) when idle. It looks like the direction signal of the extruder when idle is the same value as when it is extruding. I would like to set the idle direction value of the extruder to the same value as the "retract" direction instead. I'm thinking this can be done through modification of the firmware, but am only passingly familiar with the Marlin solution. Any advice or pointers as to where the relevant code could be found would be greatly appreciated.
Re: Extruder direction voltage question
December 09, 2018 04:36PM
Depending on your version of Marlin 1.1.X

In configuration.h

// For direct drive extruder v9 set to true, for geared extruder set to false.
#define INVERT_E0_DIR false
#define INVERT_E1_DIR false

Edited 1 time(s). Last edit at 12/09/2018 04:36PM by Roberts_Clif.


Computer Programmer / Electronics Technician
Re: Extruder direction voltage question
December 09, 2018 05:33PM
Thank you Roberts_Clif for the quick reply. With my current build I have the flag you mentioned set to true. The 0.14V signal opens the relay I have but the 5V does not. This keeps my logic straight where if the board is off, the pump and valve are closed/off. Unfortunately if the flag is set to true or false, the Idle value still matches the Extrude value like I have listed below. I also tried
#define INVERT_E_STEP_PIN
in configuration_adv.h
with both combinations of INVERT_E0_DIR to no avail

Extruder Direction Inverted
Retracted 5V
Extrude 0.14V
Move while Extruder Idle 0.14V

Extruder Direction Normal
Retracted 0.14V
Extrude 5V
Move while Extruder Idle 5V

My goal is to get the voltage of the direction pin when idle to match the voltage when the extruder is retracting. Like I have listed below. I hope this helps clarify what I'm trying to do. I apologize if my terminology or formatting is poor.

Ideal Direction Signals
Retracted 5V
Extrude 0.14V
Move while Extruder Idle 5V
Re: Extruder direction voltage question
December 10, 2018 02:54AM
Maybe you could solve the problem by enabling your extruder stepper externally with a constant signal and then use an external gate to combine the E_ENABLE and E0_DIR signals generated by Marlin for activating your relay. To do this, you would need to set DISABLE_E to true in your Configuration.h, so that the generated E_ENABLE signal shows the active/idling state of the extruder.
Re: Extruder direction voltage question
December 10, 2018 11:20AM
Thanks for the suggestion enif. I think this is a good line of thinking. I'm going to try some experiments with DISABLE_E and DISABLE_INACTIVE_EXTRUDER tonight.
Re: Extruder direction voltage question
December 11, 2018 07:17PM
I think I found a solid solution. In planner.cpp I changed line 789(ish) from

if (de < 0) SBI(dm, E_AXIS);

to

if (de <= 0) SBI(dm, E_AXIS);

With this change, Idle direction for the extruder appears to be in the retract direction rather than the extrude direction. I do need to confirm more thoroughly that I haven't catastrophically damaged some other section of code. Logically direction shouldn't matter for the extruder when it isn't extruding or retracting, but I guess we will see.
Sorry, only registered users may post in this forum.

Click here to login