Teacup issues and questions... June 08, 2013 06:10AM |
Registered: 11 years ago Posts: 40 |
Re: Teacup issues and questions... June 08, 2013 06:28AM |
Registered: 11 years ago Posts: 40 |
Re: Teacup issues and questions... June 09, 2013 09:29AM |
Registered: 13 years ago Posts: 7,616 |
Quote
In the structs the PID factors were declared as int32 but in the functions where they are being written to and/or read from EEPROM they we're being accessed as uint32.
Generation 7 Electronics | Teacup Firmware | RepRap DIY |
Re: Teacup issues and questions... June 10, 2013 04:04AM |
Registered: 11 years ago Posts: 40 |
Re: Teacup issues and questions... June 10, 2013 05:57AM |
Registered: 13 years ago Posts: 7,616 |
G1 E9.1416 F1800
Generation 7 Electronics | Teacup Firmware | RepRap DIY |
Re: Teacup issues and questions... April 23, 2014 02:04PM |
Registered: 12 years ago Posts: 258 |
Quote
HaniC
I've got an application where I wan't to use an atmega328 to drive a printer so I've decided to give teacup FW a test. I tested it on my current printer that uses sanguinololu electronics with an atmega1284p running at 16Mhz and have come across a few issues. Wondering if anyone can offer some pointers, advice or explanations.
Issue 1
PID doesn't seem very stable. I have a J-Head MKIV-b hotend and have previously calibrated the PID values in Marlin. Running the printer under Marlin I get almost perfect control of temperature (i.e only 2-3 deg overshoot and then +/-1 deg drift).
Here are the value I use:
#define DEFAULT_Kp 27.52
#define DEFAULT_Ki 1.79
#define DEFAULT_Kd 105.52
I first tried entering these values as is into heater.c as the default scaled factor #defines (obviously scaled by 1024). I did this the first time I programmed the micro, so was certain they were stored correctly into EEPROM. When running the printer, the temperature was overshooting by over 10degrees and then just oscillating +/- 5 degrees about 5 degrees higher than the set temperature. It never settled.
I then tried modifying the values using M13x commands and nothing I tried had a real positive effect on the PID performance other than setting the I factor to zero. However, nothing I did replicated or even came close to the performance I get under Marlin. I also noticed that big numbers greater than 16bits (i.e. the D factor) weren't being stored correctly. I was getting negative values when reading them back using M136.
I dug into the code and noticed something that I'm not sure about. In the structs the PID factors were declared as int32 but in the functions where they are being written to and/or read from EEPROM they we're being accessed as uint32. Something seems a little odd here.
a. Am I missing something?
b. Can anyone get stable PID using teacup?
c. Ways to improve what I'm getting?
/// default scaled P factor, equivalent to 27.52/4*1024 #define DEFAULT_P 7045 /// default scaled I factor, equivalent to 1.79/16*1024 #define DEFAULT_I 114 /// default scaled D factor, equivalent to 105.52/8*1024 #define DEFAULT_D 13507 /// default scaled I limit = 255/114*1024 #define DEFAULT_I_LIMIT 2209