Welcome! Log In Create A New Profile

Advanced

Marlin configuration

Posted by jtrantow 
Marlin configuration
April 19, 2012 11:10PM
I'm trying to port my Teacup configuration over to the Marlin firmware. I'm using custom hardware and electronics with a Mega2560 and max6675 temp 0 sensor. I had a little problem with the files in the ErikZalm-Marlin-ffea800.zip still having a bug in the MAX6675 code which gave out of range temp values. Looks like this problem has been fixed but not in the zipped files.

While I was having temp sensor problems, I removed my filament and disconnected my heater. Next, I started looking at the extruder stepper signals which weren't doing anything. I finally figured out that I needed to undef PREVENT_DANGEROUS_EXTRUDE since I wasn't heating. In hindsight, I guess I could have sent a gcode to disable this temporarily. My extuder stepper now runs but I'm still not getting any movement with the XYZ steppers.

This setup moved all the steppers using Teacup and the pin macros looked the same. (And my E0 stepper pinouts worked once I got past the extra check for PREVENT_DANGEROUS_EXTRUDE.

Are there any other extra checks in Marlin that are preventing me from moving the XYZ axis using the pronterface jog???
My startup shows:

Printer is now online.
echo:Marlin: 1.0.0 RC1
echo:Configuration.h: Apr 19 2012 | Author: Jerry Trantow
echo:Free Memory:5709 PlannerBufferBytes:1168
echo:Using Default settings:

If I can't figure out what's wrong, I guess I could hook up my hotend again to see if that is locking me out but I'd really like to run some XY movement tests before I connect up the heater again. With Teacup I was seeing an accumulating error in the XY position. I'm really hoping this was due to integer arithmetic with non-metric linear drives.
Re: Marlin configuration
April 20, 2012 01:27AM
Found part of the problem. My XYZ use enable high so I needed:

#define X_ENABLE_ON (1)
#define Y_ENABLE_ON (1)
#define Z_ENABLE_ON (1)
#define E_ENABLE_ON (0) // For all extruders.

Now my Z axis started working. However, my X and Y get enabled but don't move as expected. Loading the Teacup firmware confirms that the hardware and electronics still move the machine as desired. I copied my X,Y,Z_STEPS_PER_M and basically divided by 1000 to go from M to MM. Is there any Marlin setting (acceleration) that I need to change that only pertain to XY?
Re: Marlin configuration
April 20, 2012 02:00AM
Re: Marlin configuration
April 20, 2012 01:56PM
I have #define DISABLE_MAX_ENDSTOPS and

#define X_MIN_PIN -1 //!< X axis Minimum limit pin.
#define Y_MIN_PIN -1 //!< Y axis Minimum limit.
#define Z_MIN_PIN -1 //!< Z axis Minimum limit pin.
#define X_MAX_PIN -1 //!< X axis Maximum limit pin.
#define Y_MAX_PIN -1 //!< Y axis Maximum limit.
#define Z_MAX_PIN -1 //!< Z axis Maximum limit pin.

which I think will disable the endstops.

With some editing of configuration.h, I've now lost my Z movement. I have verified the following values work in Teacup.

#define STEPS_PER_M_X (125984) //!< 200 steps/revolution. Sixteenth stepping, 1 inch per revolution.
#define STEPS_PER_M_Y (125984) //!< 200 steps/revolution. Sixteenth stepping, 1 inch per revolution.
#define STEPS_PER_M_Z (629920) //!< 200 steps/revolution. Sixteenth stepping, 1 inch per 5 revolutions.
#define STEPS_PER_M_E ( 24773) //!< MK7 with quarter stepping.

#define MAXIMUM_FEEDRATE_X (2000) //!< Maximum X feedrate in [mm/minute] for G0 rapid moves and as a cap
#define MAXIMUM_FEEDRATE_Y (2000) //!< Maximum Y feedrate in [mm/minute] for G0 rapid moves and as a cap
#define MAXIMUM_FEEDRATE_Z ( 600) //!< Maximum Z feedrate in [mm/minute] for G0 rapid moves and as a cap
#define MAXIMUM_FEEDRATE_E (1000) //!< Maximum E feedrate in [mm/minute] for G0 rapid moves and as a cap

#define SEARCH_FEEDRATE_X ( 50) //!< X feedrate in [mm/minute] when searching endstops and as default feedrate.
#define SEARCH_FEEDRATE_Y ( 50) //!< Y feedrate in [mm/minute] when searching endstops and as default feedrate.
#define SEARCH_FEEDRATE_Z ( 50) //!< Z feedrate in [mm/minute] when searching endstops and as default feedrate.

#undef ACCELERATION_REPRAP
#define ACCELERATION_RAMPING
#define ACCELERATION 100. // mm/s^2

Without changing anything in the electronics or PrinterInterface settings, I then load Marlin firmware with the following:

#define DEFAULT_AXIS_STEPS_PER_UNIT {125.984,125.984,629.920,24.773} // default steps/millimeter.
#define DEFAULT_MAX_FEEDRATE {2000/60,2000/60,600/60, 45} // (mm/sec)
#define DEFAULT_MAX_ACCELERATION {1000,1000,1000,10000}

#define DEFAULT_ACCELERATION 100 // X, Y, Z and E max acceleration in mm/s^2 for printing moves
#define DEFAULT_RETRACT_ACCELERATION 100 // X, Y, Z and E max acceleration in mm/s^2 for r retracts

#define DEFAULT_XYJERK 20.0 // (mm/sec)
#define DEFAULT_ZJERK 0.4 // (mm/sec)
#define DEFAULT_EJERK 5.0 // (mm/sec)
Re: Marlin configuration
April 20, 2012 02:12PM
Is it possibly the preprocessor math in the feedrates causing the issue?

Do you have all your steppers on the correct internal timers? (is it wired like RAMPS or gen6 or Sanguinololu)

Have you tried putting a resistor across the thermistor leads to trick it into thinking it has a temperature sensor?


FFF Settings Calculator Gcode post processors Geometric Object Deposition Tool Blog
Tantillus.org Mini Printable Lathe How NOT to install a Pololu driver
Re: Marlin configuration (Sometimes software should be debugged with a scope)
April 20, 2012 03:18PM
Ok, I pulled out the scope. scope_9.bmp shows the X step, direction, and enable pins for a 0.1mm move using the Teacup firmware. (works)
Green=step, yellow=dir, blue=enable. This gives exactly what I expect. 125984 steps/m for a 0.1mm move equals 12.5984 steps. This plot shows 12 steps, subsequent moves show 13, and the average should be 12.5984. Also notice, the steps in the center are closer together as the acceleration ramps up.

Next, I load up the Marlin firmware and give it the same 0.1mm command. Instead of seeing 12 steps, I saw various numbers (2,3,8,10) steps but always less than 12. WTF??? Digging in a little deeper, I measured the step pulse width as 60usec using Teacup (scope_10) and only 1.4usec using Marlin. (scope_11).

My extruder stepper is connected to a Pololu A4988 with a 1usec pulse width requirement so my extruder works fine.
However, my XYZ steppers are connected to an optoisolated board with TB6560AHQ with a 30usec requirement. (No wonder it won't work at <1.4usec.)


Is there any setting in the Marlin firmware to extend the length of the step pulse???
Attachments:
open | download - scope_9.bmp (394 KB)
open | download - scope_10.bmp (394 KB)
open | download - scope_11.bmp (394 KB)
Re: Marlin configuration
April 21, 2012 07:22AM
Likely you have to dig into the source code and move the stepper-pulse-off command from where it is to a place after doing some calculations.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Sorry, only registered users may post in this forum.

Click here to login