Results 1 to 10 of 757
Hybrid View
-
07-22-2014, 09:07 AM #1
- Join Date
- Jun 2014
- Posts
- 37
I had problems with mine air printing after G28/29, my printer thought it was lower than it actually was. When I ran G28/29 then M114 it would report my Z position as -0.78 even though it was 10mm above the bed. After lots of help from Roxy (s)he worked out I had some strange offset stored in my EEPROM. I just had to connect and issue M502 followed by M500 and problem solved. If you've got the same problem I had this might work for you. Good luck.
Last edited by Roxy; 07-22-2014 at 10:23 AM.
-
07-22-2014, 10:27 AM #2
As a result of that experience, I wrote a small piece of firmware to invalidate the EEPROM so the setting are not taken from it unless you actually do an implicit store to the EEPROM. I think the original authors of Marlin were trying to save a little firmware space and did not include it. But if you are making changes to your Configuration.h file, it gets annoying having to load the default settings and save them each time. Its easier to just invalidate the EEPROM (with a M499) command:
In Marlin_Main.cpp:
case 499: // Invalidate the M500 Store settings in EEPROM command
{
Invalidate_EEPROM_Settings(); // Roxy added function to guarintee we are using
// the default values defined in the firmware!
}
break;
In ConfigurationStore.cpp:
void Invalidate_EEPROM_Settings()
{
char bogus_ver[4] = "xyz";
char confirmation[4] = "???";
int i=EEPROM_OFFSET;
EEPROM_WRITE_VAR(i,bogus_ver);
i=EEPROM_OFFSET;
EEPROM_READ_VAR(i,confirmation); //read stored version
if (strncmp(bogus_ver, confirmation,3) == 0)
SERIAL_PROTOCOLLNPGM("EEPROM Settings invalidated.");
else {
SERIAL_PROTOCOLLNPGM("EEPROM Settings not invalidated.");
SERIAL_PROTOCOLPGM("Read Version: [");
SERIAL_PROTOCOL(confirmation);
SERIAL_PROTOCOLLNPGM("]\n");
}
}
In ConfigurationStore.h:
#ifdef EEPROM_SETTINGS
void Invalidate_EEPROM_Settings(); // Roxy routine to guarantee we are using default firmware values
void Config_StoreSettings();
void Config_RetrieveSettings();
#else
FORCE_INLINE void Config_StoreSettings() {}
FORCE_INLINE void Config_RetrieveSettings() { Config_ResetDefault(); Config_PrintSettings(); }
#endifLast edited by Roxy; 08-05-2014 at 08:49 AM.
-
07-23-2014, 02:01 PM #3
- Join Date
- Jul 2014
- Location
- Van Nuys, CA
- Posts
- 22
Roxy,
Do you plan on making this a pull request to Marlin so it gets into the codebase permanently?
-
07-23-2014, 02:20 PM #4
-
07-23-2014, 03:53 PM #5
- Join Date
- Jul 2014
- Location
- Van Nuys, CA
- Posts
- 22
Well, I haven't actually done it myself, but it appears the steps would be:
First you need to have a github account and be signed in.
Next, on the Marlin firmware main page (https://github.com/ErikZalm/Marlin), there's a button in the upper right of the page that says "Fork". Hit this and it will fork a copy of the firmware to your github account.
Make your changes in your copy, commit them, and verify everything works as it should.
Back on the Marlin main page, on the right hand side, there's a link for "Pull Requests" Click on that.
You will see a button "New Pull Request". Hit that.
It gets a little fuzzy at this point because I have nothing to submit, but you should be able to select your fork in your account and make that the pull request.
After that, it's up to the Marlin developers as to when and if they merge your pull request into the main branch.
Bruce
-
08-04-2014, 02:55 PM #6
If I go and find case 500 so I can put this new case 499 in front of it I'm not sure of the syntax.
I have:
/////////////////////////////////Code Start Paste///////////////////////////////////////////
#if defined(ENABLE_AUTO_BED_LEVELING) && defined(SERVO_ENDSTOPS)
case 401:
{
engage_z_probe(); // Engage Z Servo endstop if available
}
break;
case 402:
{
retract_z_probe(); // Retract Z Servo endstop if enabled
}
break;
#endif
case 500: // M500 Store settings in EEPROM
{
Config_StoreSettings();
}
break;
/////////////////////////////////Code End Paste///////////////////////////////////////////
Does is go like this?
/////////////////////////////////Code Start Paste///////////////////////////////////////////
#if defined(ENABLE_AUTO_BED_LEVELING) && defined(SERVO_ENDSTOPS)
case 401:
{
engage_z_probe(); // Engage Z Servo endstop if available
}
break;
case 402:
{
retract_z_probe(); // Retract Z Servo endstop if enabled
}
break;
case 499: // Invalidate the M500 Store settings in EEPROM command
{
Invalidate_EEPROM_Settings(); // Roxy added function to guarintee we are using
// the default values defined in the firmware!
}
break;
#endif
case 500: // M500 Store settings in EEPROM
{
Config_StoreSettings();
}
break;
////////////////////////////Code End Paste///////////////////////////////////////////////////
My reason for asking is it looks like each case gets a 'break;' at the end and your snippet didn't have that.Bambu P1S/AMS
NVision4D http://nvision4d.com
-
08-04-2014, 04:32 PM #7
Thank You for pointing that out. That was sloppy cutting & pasting.
Yes, each 'case ??:' gets a break normally. That keeps the code from falling through into the next 'case'. Usually (but not always) you want a 'break' after the code for a given case. And certainly for this invalidate code, you want to break after it finishes.
I put the 'break' in the correct place on that post.Last edited by Roxy; 08-04-2014 at 04:36 PM.
Ender 3 Neo - Jam Problem
05-08-2024, 03:06 PM in Tips, Tricks and Tech Help