Welcome! Log In Create A New Profile

Advanced

Sprinter M190 (set bed temp and wait) not working

Posted by glyn 
Sprinter M190 (set bed temp and wait) not working
February 08, 2012 01:28PM
I have a Prusa, Sanguinololu, Sprinter set up.
If I fire up Pronterface and click on the set bed temp button then the SG circuit is activated and all works ok.
If I manually type in the gcode M190 S50 (or put that code in a file) then nothing happens.
Looking at the Sprinter source, M190 appears to be implemented, so what is my problem?
Re: Sprinter M190 (set bed temp and wait) not working
February 09, 2012 03:30AM
That is because there is no M190 command (See GCodes in the wiki)!
What you want is M140 S50!


Bob Morrison
Wörth am Rhein, Germany
"Luke, use the source!"
BLOG - PHOTOS - Thingiverse
Re: Sprinter M190 (set bed temp and wait) not working
February 09, 2012 03:42AM
It may not be documented in the wiki (this threw me at first) but the M190 code does exist, see code from sprinter.pde below.
Also if you google M190 you will find other references to it.

      case 190: // M190 - Wait bed for heater to reach target.
      #if TEMP_1_PIN > -1
        if (code_seen('S')) target_bed_raw = temp2analogh(code_value());
        codenum = millis(); 
        while(current_bed_raw < target_bed_raw) {
          if( (millis()-codenum) > 1000 ) //Print Temp Reading every 1 second while heating up.
          {
            tt=analog2temp(current_raw);
            Serial.print("T:");
            Serial.print( tt );
            Serial.print(" B:");
            Serial.println( analog2temp(current_bed_raw) ); 
            codenum = millis(); 
          }
            manage_heater();
        }
      #endif
      break;
Re: Sprinter M190 (set bed temp and wait) not working
February 09, 2012 04:03AM
Then you should compare the code used for M190 to that implemented for M140!

Pronterface uses M140.


Bob Morrison
Wörth am Rhein, Germany
"Luke, use the source!"
BLOG - PHOTOS - Thingiverse
Re: Sprinter M190 (set bed temp and wait) not working
February 09, 2012 05:34AM
Quote

Then you should compare the code used for M190 to that implemented for M140
Good thinking..
Changing
if (code_seen('S')) target_bed_raw = temp2analogh(code_value());
To
if (code_seen('S')) target_bed_raw = temp2analogBed(code_value());
Seems to fix it.

I usually assume I am in error not the code.grinning smiley
Re: Sprinter M190 (set bed temp and wait) not working
February 09, 2012 08:49AM
Actually there is another change required to display the correct temperature so I have included all the code below.
While I was at it I also added some code for the M116 gcode so I can now set my start.gcode file in skeinforge to:
M140 S50 ; set bed temp
M104 S215 ; set extruder temp
M116 ; wait for both temps to be reached

Altered code in sprinter.pde
case 190: // M190 - Wait bed for heater to reach target.
      #if TEMP_1_PIN > -1
        if (code_seen('S')) target_bed_raw = temp2analogBed(code_value());
        codenum = millis(); 
        while(current_bed_raw < target_bed_raw) {
          if( (millis()-codenum) > 1000 ) //Print Temp Reading every 1 second while heating up.
          {
            tt=analog2temp(current_raw);
            Serial.print("T:");
            Serial.print( tt );
            Serial.print(" B:");
            Serial.println( analog2tempBed(current_bed_raw) ); 
            codenum = millis(); 
          }
            manage_heater();
        }
      #endif
      break;
      case 116: // M116 - Wait for bed & extruder to reach target.
        codenum = millis(); 
        while(current_bed_raw < target_bed_raw || current_raw < target_raw ) {
          	if( (millis()-codenum) > 1000 ) //Print Temp Reading every 1 second while heating up.
          		{
	            Serial.print("T:");
	            Serial.print( analog2temp(current_raw) );
	            Serial.print(" B:");
	            Serial.println( analog2tempBed(current_bed_raw) ); 
	            codenum = millis();
          		}
            manage_heater();
        	}
      break;
Re: Sprinter M190 (set bed temp and wait) not working
February 09, 2012 01:44PM
Nice bit of coding M116 would be a useful addition.

On my machine because I have a high resistance bed it takes a time to heat up, so I don't really want my hot end waiting at working temperature for a long time whilst its not extruding as this may cause excessive heat build up in the insulator. It would be nice to avoid this, say wait until bed is 5 degrees below target then switch on the hot end. This way they both arrive at working temperature at about the same time.

This can be done with a few lines in the start code, but it would be nice with a single command implemented in firmware.

Say a command like

M116 S255 B110 D5 // Hot end to 255 , Bed to 110, switch on hot end when bed has 5 degrees to go.

Edited 1 time(s). Last edit at 02/09/2012 01:50PM by martinprice2004.
Re: Sprinter M190 (set bed temp and wait) not working
February 10, 2012 01:58AM
Yes it is probably a good idea to minimise the hot end standing time but I don't really think it is necessary to complicate the codes, what I have now used in my start.gcode file is the following.
M190 S40 ; set bed temp & wait
M140 S45 ; set bed to final temp
M104 S215 ; set extruder temp
M116 ; wait for both temps to be reached
Re: Sprinter M190 (set bed temp and wait) not working
June 10, 2012 06:25PM
I added this to the wiki as it bit me too, when I changed my 10 Ohm thermistor to a 100 Ohm thermistor for the *hot end*:

M190: Wait for bed temperature to reach target temp
Example: M190 S60
This will wait until the bed temperature reaches 60 degrees, printing out the temperature of the hot end and the bed every second.
Please note that some versions of Sprinter firmware have a bug that is triggered if different resistances are chosen for the hot end and bed.

Once again, thanks for the help!
Sorry, only registered users may post in this forum.

Click here to login