Welcome! Log In Create A New Profile

Advanced

Problem compiling marlin firmware!

Posted by jpan 
Problem compiling marlin firmware!
March 07, 2014 07:04PM
I was setting up marlin firmware because I am switching to dual extruder and old sprinter firmware doesn't support. I got a "pre-configured version from reprap wiki" I opened it, and start doing configuration. When I saw :
"
// PID settings:
// Comment the following line to disable PID and enable bang-bang.
"

in configuration.h, I commented the line:

"//#define PIDTEMP"

Because it sounds optional and I don't know what PID is!
Then, I saw

"// If you are using a preconfigured hotend then you can use one of the value sets by uncommenting it
//Ultimaker......
// Makergear
// Mendel Parts V9 on 12V "

I am using neither of those ones mentioned, so I commented all
Then, I commanded to compiled it, and the arduino software warned

"lvalue required as unary '&' operand"

and highlighted this line:

"EEPROM_WRITE_VAR(i,3000);"

Then I scrolled up, and found that i=EEPROM_OFFSET, so I thought something's wrong with those EEPROM stuff. Therefore I commented this line:

"#define EEPROM_SETTINGS
//to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
// please keep turned on if you can."

because it sounded otional. Then the software compiled it and it was all right. But that EEPROM stuff sounded good-to-have! I really want to keep it.....

SO is there any way to keep "EEPROM_SETTINGS" and compile it successfully? There must be....


Here's a extended paste of the highlighted line (bold):

"#ifdef PIDTEMP
EEPROM_WRITE_VAR(i,Kp);
EEPROM_WRITE_VAR(i,Ki);
EEPROM_WRITE_VAR(i,Kd);
#else
EEPROM_WRITE_VAR(i,3000);
EEPROM_WRITE_VAR(i,0);
EEPROM_WRITE_VAR(i,0);
#endif
char ver2[4]=EEPROM_VERSION;
i=EEPROM_OFFSET;
EEPROM_WRITE_VAR(i,ver2); // validate data
SERIAL_ECHO_START;
SERIAL_ECHOLNPGM("Settings Stored");
}
"



Thanks, guys!
Re: Problem compiling marlin firmware!
March 07, 2014 08:40PM
Did you try compiling the firmware before you started messing with settings that you know nothing about? That way you would know if it was your fault or not.

Leave PID enabled. It gives better control of temperature on the hot end. Leave one of the PID value sets uncommented.


Help improve the RepRap wiki!
Just click "Edit" in the top-right corner of the page and start typing.
Anyone can edit the wiki!
Re: Problem compiling marlin firmware!
March 07, 2014 09:34PM
I didn't save after messing around, that's one thing I knew to do.
The problem is "which one to leave" or "how to determine it by myself" cuz I am using neither of those hot ends listed.
Will it matter if the PID values are wrong? There were some choices, and I don't know which one should I use.
It says
"//Ultimaker
......
// Makergear
......
// Mendel Parts V9 on 12V
...... "
in front of each value, and I am using neither of those hot ends listed.
I'm using something from China, so....
Re: Problem compiling marlin firmware!
March 07, 2014 09:38PM
Those are just recommended starting values for those hot ends. The firmware needs something to start from, so pick a set and leave them uncommented. After you get your firmware working you will run PID autotune to get proper values for your hot end.


Help improve the RepRap wiki!
Just click "Edit" in the top-right corner of the page and start typing.
Anyone can edit the wiki!
Re: Problem compiling marlin firmware!
March 08, 2014 10:50AM
Actually this is a bug.
EEPROM_WRITE_VAR needs variable, not constant.

Github version of marlin is correct:
31bb3fb2 ยป Stefanowicz
2013-04-12 Fix: Build error when EEPROM_

#ifdef PIDTEMP
    EEPROM_WRITE_VAR(i,Kp);
    EEPROM_WRITE_VAR(i,Ki);
    EEPROM_WRITE_VAR(i,Kd);
  #else
		float dummy = 3000.0f;
    EEPROM_WRITE_VAR(i,dummy);
		dummy = 0.0f;
    EEPROM_WRITE_VAR(i,dummy);
    EEPROM_WRITE_VAR(i,dummy);
  #endif
Re: Problem compiling marlin firmware!
March 09, 2014 11:18AM
OK, so I copied and replaced with the codes in ledvinap's quote, then I commented "#define PIDTEMP" to unable PID. Now it could be compiled. I decided not to use PID, because in the link NewPerfection gave me I found "M303 S C" and think it is the g-code to get a proper value, but I don't know what "cycles" is, and I won't heat the hot end up with out proper value, for safety.

Anyways, if unable PID just doesn't matter, I'll skip it. It sound's like something good-to-have though.
Re: Problem compiling marlin firmware!
March 09, 2014 12:15PM
You should and and almost need PID set, it controls how your hotend controls the temp in the hotend. Without it you may have uneven heating and that can cause jams. Go to the wiki and search for PID. I think some time reading wiki may help you in your printing adventure.
Re: Problem compiling marlin firmware!
March 09, 2014 05:27PM
I didn't use PID when I was using Sprinter, and the printer seemed fine. I know how to auto tune now anyways. Will give it a try. PID Tuning is an easy tutorial.

Edited 1 time(s). Last edit at 03/09/2014 05:27PM by jpan.
Re: Problem compiling marlin firmware!
March 10, 2014 02:44PM
The necessity of PID depends on the hot end design and power draw. For a hot end that has a lot of thermal mass but low power draw and good thermistor coupling, bang-bang control may be just fine and could keep the temperature within a few degrees of the set point. For a high-powered, low thermal mass hot end with a thermistor in a less-than-ideal location, PID would be almost an absolute must to prevent wild temperature swings.

If you were not using PID before and your hot end maintained temperatures within 1 or 2 degrees, then you would probably be just fine without PID.


Help improve the RepRap wiki!
Just click "Edit" in the top-right corner of the page and start typing.
Anyone can edit the wiki!
Re: Problem compiling marlin firmware!
March 12, 2014 11:17PM
Be clear. You have to enable PID for using the auto tune M303 sequence. Why? Well those settings you were confused about? They are an example of the section you will create for PID to use. OR you simple use the example one you arbitrarily choose then edit it.

What I mean---

You enable PID then compile/upload.
You run the Auto Tune sequencing to the temperature you choose.
The Auto Tune runs and finishes with its determined values.
You take the Auto Tune values and edit the hot end section or heated bed section in your firmware
You compile/upload the firmware and you are good to go.
This now has PID turned on and set to your auto tune values.
You can then tweak the values to better fit your desire for response OR leave alone.
This too - if you enable EEPROM -- you can change the PID values and save too EEPROM as you work
This will still need to be updated in the firmware if you want persistance from a crash or ???

Hope this helps.
Re: Problem compiling marlin firmware!
March 14, 2014 01:25PM
Ok, still I have a question:

When you auto tune with M303, do you randomly set temperature and round times?

Thanks
Re: Problem compiling marlin firmware!
March 14, 2014 02:02PM
Just follow the instructions in the wiki..

Edited 1 time(s). Last edit at 03/14/2014 02:03PM by cat.farmer.
Re: Problem compiling marlin firmware!
March 14, 2014 04:09PM
Quote
jpan
Ok, still I have a question:

When you auto tune with M303, do you randomly set temperature and round times?

Thanks


You should set the temperature to around your expected operating termperature. The C value in an M303 C3 command is how many times you'd let it cycle around the setpoint before giving you a final answer. All that is happening during the cycles is that it is turning the heater on and off when it crosses the setpoint, and estimating how far it overshoots/undershoots for the amount of change (Ku) and how long it takes to recover (Pu). If you do a M303 C20, it would cycle 20 times re-measuring those values. Large values of C would show you how much the estimate changes from cycle to cycle and help you worry less about the precision of final values. You could use the last set of values, or round some or all of them, but Kp specified to 1/100th of a count per degree C is excessive precision.
Re: Problem compiling marlin firmware!
March 14, 2014 11:52PM
Thank you! That's all I want/need to knowspinning smiley sticking its tongue out
Sorry, only registered users may post in this forum.

Click here to login