Welcome! Log In Create A New Profile

Advanced

PID units tranlation from marlin to repetier FW

Posted by 111oct111 
PID units tranlation from marlin to repetier FW
September 10, 2012 01:37PM
Hi, I'm in the process of migrating from marlin to repetier FW to
try the advanced features for retraction, as I'm having trouble with slicer generated retraction.
One thing that i miss is PID autotune using M303.
Autotune worked fine on marlin, and the numbers I got from it for PID kd ki and kp
made it faster to get to target temperatures and remain constant around it.
I tried to input the values straight from marlin into repetier configuration.h file, but the whole units/per commented
warnings made me confused (0.001 and 0,01...confusing)
Also, even after finding the best EXT0_PID_INTEGRAL_DRIVE_MAX at around 170 for my 245ºC abs hoted printing, it is
wondering around the target temp a lot more than marlin with PID was. I think maybe it is because of the way reptier config
expects the input numbers to be different from what I got out of marlin's PID autotune.
Below the two for comparison, from both config files used:

marlin:
// PID autotune numbers with S230 for my hotend
#define DEFAULT_Kp 24.64
#define DEFAULT_Ki 1.57
#define DEFAULT_Kd 96.50

repetier FW:
#define EXT0_PID_INTEGRAL_DRIVE_MAX 170
/** \brief lower value for integral part

The I state should converge to the exact heater output needed for the target temperature.
To prevent a long deviation from the target zone, this value limits the lower value.
A good start is 30 lower then the optimal value. You need to leave room for cooling.
Overridden if EEPROM activated.
*/
#define EXT0_PID_INTEGRAL_DRIVE_MIN 50
/** P-gain in 0,01 units. Overridden if EEPROM activated. */
#define EXT0_PID_PGAIN 24.64
/** I-gain in 0,001 units
WATCH OUT: This value was in 0,01 units in earlier versions!
Overridden if EEPROM activated.
*/
#define EXT0_PID_IGAIN 1.57
/** Dgain in 0,01 units. Overridden if EEPROM activated.*/
#define EXT0_PID_DGAIN 96.50
// maximum time the heater is can be switched on. Max = 255. Overridden if EEPROM activated.
#define EXT0_PID_MAX 255

any help apreciated, and I'd like to say that repetier host RULES!
thanks!
Re: PID units tranlation from marlin to repetier FW
September 10, 2012 05:50PM
I'm currently working on some improvements for the firmware. Autotune is one I like to implement.

Back to your problem. The values are completely wrong, you wont get lucky with the numbers.
First, the PID values are integers for fast computation, so forget your floating point values.

Second, the default values work fairly good on average extruder. I get one overswing and that's it. Try them as starting point.
#define EXT0_PID_PGAIN 500
#define EXT0_PID_IGAIN 1
#define EXT0_PID_DGAIN 3000

If you get too much swinging, increase DGAIN. IGAIN can be increased to 2 if needed.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: PID units tranlation from marlin to repetier FW
September 10, 2012 08:38PM
amazing!
thank you for the reply and amazing work!
Cheers!
Re: PID units tranlation from marlin to repetier FW
November 15, 2012 02:10PM
Hey Repetier,
just to let you know, testing this with 0.80-dev branch on my ramps 1.4 and works beautifully!
After autotune with M303 and S230, and inputing the results on eeprom I'm able to reach target temps faster
with little to no swinging!
If only we could do that for the heated printbed...
Anyway, thanks a lot!
Re: PID units tranlation from marlin to repetier FW
November 15, 2012 05:03PM
111oct111 Wrote:
-------------------------------------------------------
> Hey Repetier,
> just to let you know, testing this with 0.80-dev
> branch on my ramps 1.4 and works beautifully!
> After autotune with M303 and S230, and inputing
> the results on eeprom I'm able to reach target
> temps faster
> with little to no swinging!
Very good!
> If only we could do that for the heated
> printbed...

Who said you can't? M303 P1 S110 for autotune of heated bed on 1 extruder system. Then set the pid values for the heated bed.


> Anyway, thanks a lot!


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: PID units tranlation from marlin to repetier FW
November 15, 2012 08:34PM
Re: PID units tranlation from marlin to repetier FW
November 22, 2012 04:34AM
Hi,

im a little confused how to get my Gen6 (deluxe) running with the dev. version which seems to require
Arduino 1.0.1

The master version compiles fine in 0023 using the board files from mendel-parts and adding the wiring_serial.c as suggested. (and adding the Heatbed pins (PIN 1) and Temperature Probe (PIN 0))
(And fully works once upploaded to the printer)

But im realy confused about the transition from Arduino 0023 to 1.0.1 or does the dev version compile on Gen6 with Arduino 23?

help appreciated

Chris
Re: PID units tranlation from marlin to repetier FW
November 22, 2012 05:20AM
If you use the sd card you will definitely need Arduino 1.0.1. This is because I updated to the latest sd fat library which requires the Arduino 1 or later. All other parts should compile with 023 as well (also not tested lately).

Copying the wiring files is not needed any more. The dev version has it's own serial communication to get 127 byte buffer on all Arduino versions (except printrboard which has no serial com but usb instead). Make sure you have patched the Arduino 1 sanguino files as described in boards.

Btw, what is the difference between gen6 and gen6 pro. I have no special handling for the pro version but can add it if I knew the difference.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: PID units tranlation from marlin to repetier FW
November 22, 2012 07:40AM
Hi,

thanks for quick reply smiling smiley

with deactivated SD (set to false) i still get this error (im only using 1 extruder) (Arduino 0023)

Extruder.cpp: In function 'void initExtruder()':
Extruder.cpp:296: error: 'DIOE1_DIR_PIN_DDR' was not declared in this scope
Extruder.cpp:296: error: 'DIOE1_DIR_PIN_PIN' was not declared in this scope
Extruder.cpp:297: error: 'DIOE1_STEP_PIN_DDR' was not declared in this scope
Extruder.cpp:297: error: 'DIOE1_STEP_PIN_PIN' was not declared in this scope

when using Arduino 1.0.1 with the Sanguino files from -> [code.google.com]

and after replacing the boards.txt with the yours from ..\Repetier-Firmware-development\boards\Sanguino 1.0+\Sanguino for 023\boards.txt
(didn't replace any other files) i get this errror
In file included from C:\Program Files\arduino-1.0.1\hardware\sanguino\cores\arduino/Arduino.h:213,
                 from /Reptier.h:169,
                 from Commands.cpp:22:
C:\Program Files\arduino-1.0.1\hardware\sanguino\variants\standard/pins_arduino.h:62: error: expected unqualified-id before numeric constant
C:\Program Files\arduino-1.0.1\hardware\sanguino\variants\standard/pins_arduino.h:63: error: expected unqualified-id before numeric constant


for the diffrence between gen6 and gen6 deluxe, it now has a onboard temperature controll and switch for heated bed
an no longer has the RS485 (with little soldering we could use the pins D12 and D13 for pwm fan controll winking smiley )

marlin has a differenziation in its firmware naming the boards 5 and 51

but the only thing i needed to do to have working heatbed support on repetier firmware 0.73 was changing following lines in the pins.h

#define HEATER_1_PIN    1    //changed @ rkoeppl 20110410 (bed)
#define TEMP_1_PIN      0    //changed @ rkoeppl 20110410


marlin uses this nice wrapper to do the trick

#if MOTHERBOARD == 5 || MOTHERBOARD == 51
#define KNOWN_BOARD 1

    #if MOTHERBOARD == 5
    #define HEATER_BED_PIN -1 //changed @ rkoeppl 20110410
    #define TEMP_BED_PIN -1 //changed @ rkoeppl 20110410
    #else
    #define HEATER_BED_PIN 1 //changed @ rkoeppl 20110410
    #define TEMP_BED_PIN 0 //changed @ rkoeppl 20110410
    #endif

i realy like your binary protokoll, with marlin on high poly the printer slows down a lot, and i have the impression my printer is now a bit quiter (stepper motor humming)

kind regards

Chris
Re: PID units tranlation from marlin to repetier FW
November 22, 2012 08:23AM
I see the problem. In the develop tree I do not watch which configuration option I use for upload. In this case you got the version with 2 extruder and the pin configuration for the second extruder is now missing. Check in Configuration.h and set NUM_EXTRUDER to 1. Also check uiconfig.h where a display/keyboard is currently enabled.

Speaking of faster communication make sure to increase the buffer size to 127 in the host for this firmware.

I will add a motherboard 51 for the gen6 deluxe for the next update :-)


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: PID units tranlation from marlin to repetier FW
December 29, 2012 11:01AM
Ok, Repetier, I´m re-hijacking this thread that I started,
since I´m having lots of communication issues and freezes during print. I already
found quite a few threads and solutions, but none seems to work.
So here is my question in regards to the dev branch of the firmware(0.80) and RAMPS 1.4,
Can I use this combo with the 127 receive/send bytes you mentioned above? in that case do I have to replace
the HardwareSerial.cpp as usual or not? do I need to do anything else to compile without sd/lcd/buttons interface using arduino 1.0.3?

I´m about to test things on a different computer, a pc this time, to see if it is my mac that is giving me trouble. Otherwise, I´ll open a thread with
the details, logs

Thanks for your help
oct
Re: PID units tranlation from marlin to repetier FW
December 29, 2012 11:35AM
The 0.80 branch das it's own serial driver overriding the arduino one, so you no longer have to copy files around. The new version also differs in the fact that it has a 127 byte buffer like in the old days.

One point you have to watch are the configs. I always check in when changes are made, but do not reedit config files. So based on luck the uiconfig.h has most probably display/keys enabled which you have to set to 0. Also the Configuration.h differs depending on the last board/printer used for testing. But you have to go through it anyway as it has many differences to the old version.

Good luck!


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: PID units tranlation from marlin to repetier FW
December 29, 2012 03:49PM
I'm recompiling as we speak. Will report back!
Thank you, once again
Re: PID units tranlation from marlin to repetier FW
December 29, 2012 05:06PM
Ok, this is what I have after carefully going thru the configs and trying to compile:
Extruder.cpp:32: error: expected primary-expression before ';' token
Extruder.cpp:33: error: expected primary-expression before ';' token
comparing the 0.80-dev version I've used before and the one I'm trying to compile (downloaded today) , the Extruder.cpp is quite different.
Any way around this?

Edit - I tried changing NUM_EXTRUDER from 0 to 1 and then to 2 and more errors occurring further down Extruder.cpp, this time:

Extruder.cpp:198: error: expected primary-expression before ',' token
Extruder.cpp:221: error: expected primary-expression before ',' token

Edited 1 time(s). Last edit at 12/29/2012 05:11PM by 111oct111.
Re: PID units tranlation from marlin to repetier FW
December 30, 2012 02:32AM
I checked compile of the currently uploaded dev version with 1.0.3 and it worked with 2extruder and 2 extruder + heated bed.

I guess you changed something in the original config that causes this. As I said the config differs from older versions so perhaps you copied something that is no longer valid in that form. It must be something in the Extruder/heated bed config. My guess is more heated bed stuff.

make sure to use the latest dev version I used today for testing.

Try to replace the parts with the original parts until it starts working and then see what the difference is.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: PID units tranlation from marlin to repetier FW
December 30, 2012 09:28AM
Going thru the github repository commit history to see what is causing this.
I tried compiling as downloaded, not touching any files, and had the same trouble. the older 0.80 I was using compiles fine.
Will let you know.
Thanks!
Re: PID units tranlation from marlin to repetier FW
January 04, 2013 11:45AM
ok now its working again
reinstalled arduino IDE and was able to compile for some odd reason.
Now it starts fine, but heats for a little while and then I get:

< 2:11:01 PM: extruder 0: working
< 2:11:01 PM: heated bed: working
< 2:11:01 PM: Printer set into dry run mode until restart!

Watching the power output graph in the temperature curve screen I can tell it is powering the heaters for around 5 seconds,
then it shuts the output completely off and returns the above messages. Any clues?
Thanks and happy new year.
Re: PID units tranlation from marlin to repetier FW
January 04, 2013 12:03PM
Sorry for that error. Please load the latest Extruder.cpp from dev tree for a fix. I have added a check if the sensors are defect/not connected and have forgotten a C in one place causing that error.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: PID units tranlation from marlin to repetier FW
January 04, 2013 12:42PM
relaced with the lattest and now it is not compiling again, this time I get (arduino IDE 1.0.3):
Extruder.cpp:32: error: 'EXT0_SELECT_COMMANDS' was not declared in this scope
Extruder.cpp:33: error: 'EXT0_DESELECT_COMMANDS' was not declared in this scope
Extruder.cpp:165: error: too many initializers for 'Extruder'
Extruder.cpp: In function 'bool reportTempsensorError()':
Extruder.cpp:966: error: 'PRINTER_FLAG0_TEMPSENSOR_DEFECT' was not declared in this scope
Extruder.cpp: In function 'void manage_temperatures()':
Extruder.cpp:996: error: 'PRINTER_FLAG0_TEMPSENSOR_DEFECT' was not declared in this scope
Extruder.cpp:1000: error: 'PRINTER_FLAG0_TEMPSENSOR_DEFECT' was not declared in this scope
Extruder.cpp:1045: error: 'PRINTER_FLAG0_TEMPSENSOR_DEFECT' was not declared in this scope
Re: PID units tranlation from marlin to repetier FW
January 04, 2013 02:56PM
You are mixing different versions. The error I responded to was the latest in dev tree before i updated the fix. The new compile errors are because you inserted the new extruder.cpp into an older source version.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: PID units tranlation from marlin to repetier FW
January 04, 2013 03:12PM
true, this time I am the one apologizing!
thanks for the patience and for looking further into it!
already test printing.
Sorry, only registered users may post in this forum.

Click here to login