Firmware upgrade issues

If you are having problems with your 3D printer or have had a problem and discovered a great solution, then share your experiences here.
User avatar
ge_rik
Administrator
Administrator
Posts: 6497
Joined: Sun Oct 25, 2009 10:20 pm
Location: Cheshire
Contact:

Firmware upgrade issues

Post by ge_rik » Sun Jun 05, 2022 10:23 pm

I wonder if anyone can advise?

I've just upgraded the firmware on my cheapo Anet A8 clone from whatever it was supplied with to the latest version of Marlin (2.1).

I have the settings in Cura set up perfectly for the printer but the new firmware seems to ignore the gcode settings in the files - items which printed perfectly with the old firmware now won't print properly. The print speeds and extrusion rates seem far faster.

I'm struggling to understand why the new firmware seems to be ignoring the parameters (eg print speed, extrusion rate) in the gcode? Or are there some sort of master settings which override them in the new firmware?

Rik
------------------------
Peckforton Light Railway - Blog Facebook Youtube

metalmuncher
Cleaner
Cleaner
Posts: 95
Joined: Sat Oct 20, 2012 4:15 pm

Re: Firmware upgrade issues

Post by metalmuncher » Sun Jun 05, 2022 11:15 pm

I can think of a lot of scenarios could be causing things to go wrong here.

Are you sure all the settings e.g. steps per mm in configuration.h were edited to be correct for the particular machine? The update probably decided to nuke your old firmware EEPROM settings stored on the mainboard since the data layout is probably different between versions. If you have a copy of the M503 command's report from before the update you could compare with an M503 report on the current settings and look for differences.

User avatar
ge_rik
Administrator
Administrator
Posts: 6497
Joined: Sun Oct 25, 2009 10:20 pm
Location: Cheshire
Contact:

Re: Firmware upgrade issues

Post by ge_rik » Mon Jun 06, 2022 7:32 am

Yes, as far as I know, I used the configuration.h library recommended for my machine, though mine is a clone of the original so there could be some subtle differences. It does seem as though the stepper motor drivers are on a higher setting than they should be.

I've not got an M503 report but could get one. I've installed the firmware on a second motherboard and kept the original board (just in case), so I could probably access it. I'd prefer to use the newer board if I can as it has enhanced safety features.

There is a 2.1 bug fix patch. I tried installing it but it threw up an error (twice) so I had to reinstall Marlin 2.1 to get it working again. There's dozens of pages of bugs listed so I might try installing Marlin 2.0 in the hope that's more stable/compatible.

Rik
------------------------
Peckforton Light Railway - Blog Facebook Youtube

User avatar
philipy
Moderator
Moderator
Posts: 5033
Joined: Sun Jan 30, 2011 3:00 pm
Location: South Northants

Re: Firmware upgrade issues

Post by philipy » Mon Jun 06, 2022 8:35 am

I can't help, but you have my commiserations.
You've also confirmed a decision I made a month or two back. I saw posts on various boards about upgrading motherboards and firmware for my new Creality CR20 Pro. I didn't understand most of it but it looked to be a lot of hassle and I came to the conclusion that if it ain't broke don't fix it. So often these computer upgrades don't really add anything of real world value but just satisfy the geeks ( my apologies to any geeks who may read this! :D ).
Philip

User avatar
ge_rik
Administrator
Administrator
Posts: 6497
Joined: Sun Oct 25, 2009 10:20 pm
Location: Cheshire
Contact:

Re: Firmware upgrade issues

Post by ge_rik » Mon Jun 06, 2022 10:26 am

Upgrading has been on the agenda for a while now. Firstly, there's a bug in the original firmware which means I can't print anything taller than 11cm. Secondly, the new firmware include safety checks to avoid overheating and thirdly, the new firmware includes code for attaching a bed levelling sensor.

So, whilst the original code does (sort of) work, the new code will be an improvement, if I can figure out how to fix it.

Rik
------------------------
Peckforton Light Railway - Blog Facebook Youtube

User avatar
ge_rik
Administrator
Administrator
Posts: 6497
Joined: Sun Oct 25, 2009 10:20 pm
Location: Cheshire
Contact:

Re: Firmware upgrade issues

Post by ge_rik » Mon Jun 06, 2022 10:28 am

metalmuncher wrote: Sun Jun 05, 2022 11:15 pm I can think of a lot of scenarios could be causing things to go wrong here.

Are you sure all the settings e.g. steps per mm in configuration.h were edited to be correct for the particular machine? The update probably decided to nuke your old firmware EEPROM settings stored on the mainboard since the data layout is probably different between versions. If you have a copy of the M503 command's report from before the update you could compare with an M503 report on the current settings and look for differences.
Sorry - bit of a numpty question, but how do I get to see the EEPROM settings? I've tried using the serial monitor in Arduino IDE but when I try sending M503, nothing seems to come back.

Rik
------------------------
Peckforton Light Railway - Blog Facebook Youtube

User avatar
ge_rik
Administrator
Administrator
Posts: 6497
Joined: Sun Oct 25, 2009 10:20 pm
Location: Cheshire
Contact:

Re: Firmware upgrade issues

Post by ge_rik » Mon Jun 06, 2022 4:34 pm

Duhhh....
I should read the on-screen prompts!!! It clearly says CRTL+ENTER to send to the printer - so why did I only hit ENTER??? :?

Got the values off the old board now. So I'll compare these with those in the new board.

Rik
------------------------
Peckforton Light Railway - Blog Facebook Youtube

User avatar
ge_rik
Administrator
Administrator
Posts: 6497
Joined: Sun Oct 25, 2009 10:20 pm
Location: Cheshire
Contact:

Re: Firmware upgrade issues

Post by ge_rik » Mon Jun 06, 2022 5:01 pm

Now this is interesting (I think)
The settings are stored in a different way for the two sets of firmware - but, as far as I can see, the stepper values are the same.

Code: Select all

[b]ORIGINAL FIRMWARE[/b]

start
Info:External Reset
Free RAM:11450
SD init fail
debug:401
SD init fail
extruder 0: temp sensor defect
heated bed: temp sensor defect
Error:Printer set into dry run mode until restart!
ok 0
EPR:2 75 115200 Baudrate
EPR:3 129 150.407 Filament printed [m]
EPR:2 125 100945 Printer active [s]
EPR:2 79 0 Max. inactive time [ms,0=off]
EPR:2 83 360000 Stop stepper after inactivity [ms,0=off]
EPR:3 3 100.0000 X-axis steps per mm
EPR:3 7 100.0000 Y-axis steps per mm
EPR:3 11 400.0000 Z-axis steps per mm
EPR:3 15 400.000 X-axis max. feedrate [mm/s]
EPR:3 19 400.000 Y-axis max. feedrate [mm/s]
EPR:3 23 4.000 Z-axis max. feedrate [mm/s]
EPR:3 27 100.000 X-axis homing feedrate [mm/s]
EPR:3 31 100.000 Y-axis homing feedrate [mm/s]
EPR:3 35 12.000 Z-axis homing feedrate [mm/s]
EPR:3 39 20.000 Max. jerk [mm/s]
EPR:3 47 0.300 Max. Z-jerk [mm/s]
EPR:3 133 -45.000 X home pos [mm]
EPR:3 137 -5.000 Y home pos [mm]
EPR:3 141 0.000 Z home pos [mm]
EPR:3 145 265.000 X max length [mm]
EPR:3 149 230.000 Y max length [mm]
EPR:3 153 235.000 Z max length [mm]
EPR:3 51 400.000 X-axis acceleration [mm/s^2]
EPR:3 55 400.000 Y-axis acceleration [mm/s^2]
EPR:3 59 400.000 Z-axis acceleration [mm/s^2]
EPR:3 63 400.000 X-axis travel acceleration [mm/s^2]
EPR:3 67 400.000 Y-axis travel acceleration [mm/s^2]
EPR:3 71 400.000 Z-axis travel acceleration [mm/s^2]
EPR:0 106 0 Bed Heat Manager [0-3]
EPR:0 107 255 Bed PID drive max
EPR:0 124 80 Bed PID drive min
EPR:3 108 196.000 Bed PID P-gain
EPR:3 112 33.000 Bed PID I-gain
EPR:3 116 290.000 Bed PID D-gain
EPR:0 120 255 Bed PID max value [0-255]
EPR:3 200 90.000 Extr.1 steps per mm
EPR:3 204 50.000 Extr.1 max. feedrate [mm/s]
EPR:3 208 20.000 Extr.1 start feedrate [mm/s]
EPR:3 212 5000.000 Extr.1 acceleration [mm/s^2]
EPR:0 216 3 Extr.1 heat manager [0-3]
EPR:0 217 230 Extr.1 PID drive max
EPR:0 245 50 Extr.1 PID drive min
EPR:3 218 7.0000 Extr.1 PID P-gain/dead-time
EPR:3 222 2.0000 Extr.1 PID I-gain
EPR:3 226 40.0000 Extr.1 PID D-gain
EPR:0 230 255 Extr.1 PID max value [0-255]
EPR:2 231 0 Extr.1 X-offset [steps]
EPR:2 235 0 Extr.1 Y-offset [steps]
EPR:1 239 1 Extr.1 temp. stabilize time [s]
EPR:1 250 150 Extr.1 temp. for retraction when heating [C]
EPR:1 252 0 Extr.1 distance to retract when heating [mm]
EPR:0 254 255 Extr.1 extruder cooler speed [0-255]

[b]MARLIN 2.1 FIRMWARE[/b]
start
Marlin 2.1
echo: Last Updated: 2022-06-04 | Author: (Bob Kuhn, Anet config)
echo: Compiled: Jun  4 2022
echo: Free Memory: 12171  PlannerBufferBytes: 1200
echo:V86 stored settings retrieved (629 bytes; crc 4310)
echo:SD card ok
echo:; Linear Units:
echo:  G21 ; (mm)
echo:; Temperature Units:
echo:  M149 C ; Units in Celsius
echo:; Filament settings (Disabled):
echo:  M200 S0 D1.75
echo:; Steps per unit:
echo:  M92 X100.00 Y100.00 Z400.00 E100.00
echo:; Max feedrates (units/s):
echo:  M203 X400.00 Y400.00 Z8.00 E50.00
echo:; Max Acceleration (units/s2):
echo:  M201 X2000.00 Y2000.00 Z100.00 E10000.00
echo:; Acceleration (units/s2) (P<print-accel> R<retract-accel> T<travel-accel>):
echo:  M204 P400.00 R1000.00 T1000.00
echo:; Advanced (B<min_segment_time_us> S<min_feedrate> T<min_travel_feedrate> J<junc_dev>):
echo:  M205 B20000.00 S0.00 T0.00 J0.10
echo:; Home offset:
echo:  M206 X0.00 Y0.00 Z0.00
echo:; Material heatup parameters:
echo:  M145 S0 H190.00 B60.00 F0
echo:  M145 S1 H240.00 B90.00 F0
echo:; Hotend PID:
echo:  M301 P21.00 I1.25 D86.00
echo:; Bed PID:
echo:  M304 P295.00 I35.65 D610.21
ok
So, I'm not the wiser...

BTW - the errors shown in the original firmware returns are because there's no SD Card inserted and the board isn't connect up to the printer

Rik
------------------------
Peckforton Light Railway - Blog Facebook Youtube

metalmuncher
Cleaner
Cleaner
Posts: 95
Joined: Sat Oct 20, 2012 4:15 pm

Re: Firmware upgrade issues

Post by metalmuncher » Mon Jun 06, 2022 5:39 pm

Brilliant thinking putting it on a new mainboard and saving the old one, that has probably saved a lot of time trying to make sure the firmware defaults are set properly.

The relevant values are looking pretty similar, so that's a big part of the problem space we can probably shortcut.

One thing I can think of is the microstepping setting being different on the new motherboard. This would be an obvious problem, the printer would try and move way too far on every move. For example, if the firmware thinks the stepper driver is set for 16x microstepping, and the driver is actually set for 1x/no microstepping, when you tell it to move 1mm the steppers will try and move 16mm in the same time it would normally do 1mm, i.e. really fast.

On old style motherboards this used to be set by jumpers on pin headers near the stepper drivers. Not sure what its like on your board. If it seems like the printer is moving further than commanded this could be the issue.

Other than that, I think its got to be some interaction of the slicer/gcode/firmware. Perhaps the old firmware responded differently to feedrate commands than the new one. Can you upload a sliced gcode file?

User avatar
ge_rik
Administrator
Administrator
Posts: 6497
Joined: Sun Oct 25, 2009 10:20 pm
Location: Cheshire
Contact:

Re: Firmware upgrade issues

Post by ge_rik » Mon Jun 06, 2022 6:48 pm

Closer scrutiny has revealed some minor differences in the extruder values which could account for the over-extrusion.

ie original steps/mm for extruder were 90 but are 100 on new firmware
Max feed rates were 4mm/s but are now 8mm/s

I have tried printing a part. The X and Y dimensions were ok - not sure about the Z dims though as I had to abort the print owing to the over extrusion issues. What seems way out are the travel speeds which I reduced in the gcode on the old board when I kept getting layer displacement. I will try tweaking the values in Cura to see if I can get them back down again.

The max acceleration rates seem much higher in the new firmware, but I can't see any travel settings in the new configuration script. I'll check again as it's easy to miss some of the settings. I'll try printing a hard copy as trying to spot them on screen is tricky.

Rik
------------------------
Peckforton Light Railway - Blog Facebook Youtube

metalmuncher
Cleaner
Cleaner
Posts: 95
Joined: Sat Oct 20, 2012 4:15 pm

Re: Firmware upgrade issues

Post by metalmuncher » Mon Jun 06, 2022 7:10 pm

I did notice the acceleration difference, the M204 P400 should set the acceleration during print moves to 400 like the old configuration, but M204 T1000 sets the acceleration during to travel at 1000, whereas the old travel accel was 400.

Try issuing M204 T400 to set the travel to 400mm/s2.

You could also just issue M201 X400 Y400 to make it the same as the old max accel, that should limit any axis moves to that value.

User avatar
ge_rik
Administrator
Administrator
Posts: 6497
Joined: Sun Oct 25, 2009 10:20 pm
Location: Cheshire
Contact:

Re: Firmware upgrade issues

Post by ge_rik » Mon Jun 06, 2022 7:33 pm

Thanks
I'll give that a try

Rik
------------------------
Peckforton Light Railway - Blog Facebook Youtube

User avatar
ge_rik
Administrator
Administrator
Posts: 6497
Joined: Sun Oct 25, 2009 10:20 pm
Location: Cheshire
Contact:

Re: Firmware upgrade issues

Post by ge_rik » Tue Jun 07, 2022 3:09 pm

I'm getting closer to solving the extruder problem.

Because my cheapo printer is a cloned Anet A8 and not the real thing, the Z axis screws are actually M8 rods rather than pukka Z screws - so vertical movement requires considerably more turns of the stepper motors than would normally be required - as it turns out 6.67 times as many.

I've just calibrated the Z axis and rather than 400 steps/mm it actually needs 2666.67 steps per mm. So it wasn't over extrusion - it was a distinct lack of vertical movement.

What I can't understand is why the value stored on the EEPROM of the old motherboard is 400steps/mm - ie the default for a proper Anet A8!

What I need to solve next is how to slow all the movements down. It seems to be at least twice as fast as with the old board - auto homing happens as if the printer is on steroids.

Where on earth have they hidden these parameters if they are not on the EEPROM??

Rik
------------------------
Peckforton Light Railway - Blog Facebook Youtube

metalmuncher
Cleaner
Cleaner
Posts: 95
Joined: Sat Oct 20, 2012 4:15 pm

Re: Firmware upgrade issues

Post by metalmuncher » Tue Jun 07, 2022 6:01 pm

Things like homing speed are baked into the firmware when you compile it, its not adjustable with a gcode.

For homing feedrate, you can find it in configuration.h:

Code: Select all

// Homing speeds (linear=mm/min, rotational=°/min)
#define HOMING_FEEDRATE_MM_M { (100*60), (100*60), (4*60) }
You will have to recompile and reupload the code to the mainboard. Its multiplying by 60 to convert 100mm/s to 6000mm/min, so if you want a homing feedrate of 20mm/s in X and Y and 1mm/s in Z you would change it to:

Code: Select all

#define HOMING_FEEDRATE_MM_M { (20*60), (20*60), (1*60) }
Your steps per mm for the Z might be a bit off. Its simply steps/rev * microstepping / screw pitch. Its likely that your motors are 200steps/rev with 16x microstepping. Standard M8 coarse pitch is 1.25mm, which would mean your steps/mm should be 200*16/1.25 = 2560. Your value of 2666 steps/mm would correspond to a pitch of 1.2mm, which I suppose is possible but unlikely.

User avatar
ge_rik
Administrator
Administrator
Posts: 6497
Joined: Sun Oct 25, 2009 10:20 pm
Location: Cheshire
Contact:

Re: Firmware upgrade issues

Post by ge_rik » Tue Jun 07, 2022 7:04 pm

Thanks. That's really useful info.

I wondered what feed rates actually were. That now makes a lot of sense.

The calibration for the Z axis was simply done by telling the extruder to move upwards by 100mm and measuring how far it actually moved (~15mm). A bit rough and ready, but it seems to be working OK for now. I'll get it to print a 10mm cube and put the electronic calipers on it to see exactly how far out all the axes are, though X and Y seem to be quite accurate judging by what I've printed so far.

Rik
------------------------
Peckforton Light Railway - Blog Facebook Youtube

User avatar
ge_rik
Administrator
Administrator
Posts: 6497
Joined: Sun Oct 25, 2009 10:20 pm
Location: Cheshire
Contact:

Re: Firmware upgrade issues

Post by ge_rik » Wed Jun 08, 2022 11:36 am

Hmmm .... interesting
When I loaded Marlin 2.0 into Arduino IDE, it only shows the configuration file libraries - it doesn't show all the other library files wherein the main firmware code is stored. There's a baffling array of folders and files - and so far I've not tracked down the file for the feedrates.

So, I did a bit of googling and discovered that M220 enables us to reset the feedrate as a percentage. I found that 80% slows everything down to a speed which is a lot less frenetic. Unfortunately, once reset, the new value isn't stored on the EEPROM and so would need to be re-entered every time th printer is powered up.

So..... I decided to add the instruction ( M220 S80 ;Set feedrate to 80% ) to the Start G-Code for this machine in Cura - so that every time I slice and create gcode for an object the feedrate is reset to 80%

Not as elegant as editing the firmware code but a lot easier

Rik
------------------------
Peckforton Light Railway - Blog Facebook Youtube

User avatar
ge_rik
Administrator
Administrator
Posts: 6497
Joined: Sun Oct 25, 2009 10:20 pm
Location: Cheshire
Contact:

Re: Firmware upgrade issues

Post by ge_rik » Thu Jun 09, 2022 3:55 pm

I did some digging in the various folders and eventually tracked down the motion.h library file. The feedrate section looks very complicated - it looks like it checks whether an M220 percentage value has been applied. So far, I've not tracked down where the default values are defined. I'm reluctant to tinker with this bit of code so, for now I think I will stick with the M220 gcode command.

Code: Select all

/**
 * Feed rates are often configured with mm/m
 * but the planner and stepper like mm/s units.
 */
constexpr xyz_feedrate_t homing_feedrate_mm_m = HOMING_FEEDRATE_MM_M;
FORCE_INLINE feedRate_t homing_feedrate(const AxisEnum a) {
  float v = TERN0(HAS_Z_AXIS, homing_feedrate_mm_m.z);
  #if DISABLED(DELTA)
    LINEAR_AXIS_CODE(
           if (a == X_AXIS) v = homing_feedrate_mm_m.x,
      else if (a == Y_AXIS) v = homing_feedrate_mm_m.y,
      else if (a == Z_AXIS) v = homing_feedrate_mm_m.z,
      else if (a == I_AXIS) v = homing_feedrate_mm_m.i,
      else if (a == J_AXIS) v = homing_feedrate_mm_m.j,
      else if (a == K_AXIS) v = homing_feedrate_mm_m.k
    );
  #endif
  return MMM_TO_MMS(v);
}

feedRate_t get_homing_bump_feedrate(const AxisEnum axis);

/**
 * The default feedrate for many moves, set by the most recent move
 */
extern feedRate_t feedrate_mm_s;

/**
 * Feedrate scaling is applied to all G0/G1, G2/G3, and G5 moves
 */
extern int16_t feedrate_percentage;
#define MMS_SCALED(V) ((V) * 0.01f * feedrate_percentage)
Rik
------------------------
Peckforton Light Railway - Blog Facebook Youtube

metalmuncher
Cleaner
Cleaner
Posts: 95
Joined: Sat Oct 20, 2012 4:15 pm

Re: Firmware upgrade issues

Post by metalmuncher » Thu Jun 09, 2022 4:47 pm

If the Arduino IDE is playing up, you can just open configuration.h in any text editor, its in the same folder as the Marlin.ino file you open with the Arduino IDE.

User avatar
ge_rik
Administrator
Administrator
Posts: 6497
Joined: Sun Oct 25, 2009 10:20 pm
Location: Cheshire
Contact:

Re: Firmware upgrade issues

Post by ge_rik » Fri Jun 10, 2022 8:01 pm

Eventually tracked down the homing feed rate setting in the configuration.h file. It was tucked away in a section I least expected to find it ("Mesh"???). I loaded the file into WordPad so I could use 'Find'. Then tracked it down in Arduino IDE (line 1830!) so I could edit it without adding the gobbledegook which Word adds to files. A bit convoluted, but got there in the end. I've not yet uploaded it to the printer as I want to be sure there's nothing else I want to change.

I've found that, despite what is portrayed on a load of websites and YouTube videos, updating firmware isn't as straightforward as they make out. All sorts of error messages flash up and sometimes the relevant COMS port doesn't seem to be recognised - it can take several attempts before the files upload successfully - unless my set-up is faulty. So, I'll wait a little while until I make another attempt. In the meantime, the printer seems quite happy. It even warned me that there was a thermal runaway while pre-heating for PLA. No idea why, but it's reassuring to know it is checking for such events....

Rik
------------------------
Peckforton Light Railway - Blog Facebook Youtube

User avatar
Jimmyb
Fireman
Fireman
Posts: 492
Joined: Sat Nov 23, 2019 10:43 pm
Location: Weston-super-Mare

Re: Firmware upgrade issues

Post by Jimmyb » Sat Jun 11, 2022 9:00 am

Rik, that is why I am cautious about updating firmware on any device, especially my PC, unless you can gain access to read the file you have an expensive paper weight.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest