Welcome! Log In Create A New Profile

Advanced

Repetier, Gen7 1.5 and the heating bed

Posted by Diphthong 
Repetier, Gen7 1.5 and the heating bed
May 17, 2013 08:56AM
Hello everybody,
after today I printed the first time successfully with a Prusa Mendel, Gen7 v1.5 board and the repetier firmware, I would like connect the heating bed to the Gen7 v1.5 PCB make it controling the temperature. Since I have nothing else here, I want to use a standard 10k NTC temperature sensor. The repetier documentation says that 10kOhm NTCs are supported. So I connected the sensor temporarily for testing purposes and enabled the heating bed in Pronterface. Unfortunately, Pronterface displayed a temperature of -35°C. This temperature is also displayed if the sensor is disconnected. I think there's a bug in the repetier firmware. If I load, using arduino, a simple program (not the repetier firmware) printing out only the raw ADC value at the corresponding ADC on the serial port, I get ​​at room temperature values to 736. If I hold my hand on the NTC the values ​​drops to 650. This behavior is correct. However, if I put out the value at the end of void setup of the repeater firmware, I get values ​​around 1022. I think this corresponds to the -35°C of the NTC 10k temperature.
I sent the analog value with aduino analogRead at different points in void setup. I discovered, that directly after initExtruder(); everything is ok, the values are at 736. Directly after initExtruder the value is ALWAYS 988, the temperature doesn’t matters. After epr_init() the value raises to 1022, as said above.
I think there are problems at the analog settings in initExtruder(). What can I do to make the sensor work?
Thank you very much!
Regards
Jan
Re: Repetier, Gen7 1.5 and the heating bed
May 17, 2013 12:49PM
I think the analog reading is fine since it is the same as for all other thermistors. I think some function uses the same pin for digital output and that is configured later on, so after that the reading is that of the digital output. Check what the corresponding digital pin function is and look into pins.h what function lies on that. Set th epin to -1 or move it to on another free pin and it should work.


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: Repetier, Gen7 1.5 and the heating bed
May 19, 2013 12:21PM
Hello repetier,
that was my first thought, too. But the pins.h seems to be ok:
[...]
/****************************************************************************************
* Sanguino/RepRap Motherboard with direct-drive extruders
*
*                        ATMega644P
*
*                        +---\/---+
*            (D 0) PB0  1|        |40  PA0 (AI 0 / D31)
*            (D 1) PB1  2|        |39  PA1 (AI 1 / D30)
*       INT2 (D 2) PB2  3|        |38  PA2 (AI 2 / D29)
*        PWM (D 3) PB3  4|        |37  PA3 (AI 3 / D28)
*        PWM (D 4) PB4  5|        |36  PA4 (AI 4 / D27)
*       MOSI (D 5) PB5  6|        |35  PA5 (AI 5 / D26)
*       MISO (D 6) PB6  7|        |34  PA6 (AI 6 / D25)
*        SCK (D 7) PB7  8|        |33  PA7 (AI 7 / D24)
*                  RST  9|        |32  AREF
*                  VCC 10|        |31  GND 
*                  GND 11|        |30  AVCC
*                XTAL2 12|        |29  PC7 (D 23)
*                XTAL1 13|        |28  PC6 (D 22)
*       RX0 (D 8)  PD0 14|        |27  PC5 (D 21) TDI
*       TX0 (D 9)  PD1 15|        |26  PC4 (D 20) TDO
*  INT0 RX1 (D 10) PD2 16|        |25  PC3 (D 19) TMS
*  INT1 TX1 (D 11) PD3 17|        |24  PC2 (D 18) TCK
*       PWM (D 12) PD4 18|        |23  PC1 (D 17) SDA
*       PWM (D 13) PD5 19|        |22  PC0 (D 16) SCL
*       PWM (D 14) PD6 20|        |21  PD7 (D 15) PWM
*                        +--------+
*
****************************************************************************************/
[...]
/****************************************************************************************
* Gen7 1.4.1 pin assignment
*
****************************************************************************************/
#if MOTHERBOARD == 71
#define KNOWN_BOARD 1

#if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega644__) && !defined(__AVR_ATmega1284P__)
    #error Oops!  Make sure you have 'Gen7' selected from the 'Tools -> Boards' menu.
#endif

//x axis pins
  #define X_STEP_PIN      29
  #define X_DIR_PIN       28
  #define X_ENABLE_PIN    25
  #define X_MIN_PIN       0
  #define X_MAX_PIN       -1
    
  //y axis pins
  #define Y_STEP_PIN      27
  #define Y_DIR_PIN       26
  #define Y_ENABLE_PIN    25
  #define Y_MIN_PIN       1
  #define Y_MAX_PIN       -1
    
  //z axis pins
  #define Z_STEP_PIN      23
  #define Z_DIR_PIN       22
  #define Z_ENABLE_PIN    25
  #define Z_MIN_PIN       2
  #define Z_MAX_PIN       -1
    
  //extruder pins
  #define E0_STEP_PIN      19     
  #define E0_DIR_PIN       18     
  #define E0_ENABLE_PIN    25     
  #define TEMP_0_PIN      0 
  #define TEMP_1_PIN      1    
  #define HEATER_0_PIN    4    
  #define HEATER_1_PIN    3    
    
    
  #define SDPOWER          -1
  #define SDSS            -1 
  #define LED_PIN         -1    
       
  #define FAN_PIN         -1    
  #define PS_ON_PIN       15    
    //our pin for debugging.
    
  #define DEBUG_PIN        0
    
    //our RS485 pins
  #define TX_ENABLE_PIN	12
  #define RX_ENABLE_PIN	13

  #define SDPOWER          -1
  #define SDSS          -1
  #define SDSSORIG         4  // Needs to set this to output to enable SPI even if other SS is used!

  #define SCK_PIN          7
  #define MISO_PIN         6
  #define MOSI_PIN         5
  #define E0_PINS E0_STEP_PIN,E0_DIR_PIN,E0_ENABLE_PIN,
  #define E1_PINS
#endif
[...]

It’s really strange. It isn’t clear to me, which number is meant as analog and which as digital.
What should I change?
Thank you!
Regards
Jan
Re: Repetier, Gen7 1.5 and the heating bed
May 19, 2013 12:28PM
The analog inputs 0 and 1 you seem to use equals digital pins 31 and 30 which are at least in pins.h unused. Check you configuration.h if you find these numbers somewhere, e.g. by enabling a display (FEATURE_CONTROLER 0 for testing) or any other option where you select a pin.


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: Repetier, Gen7 1.5 and the heating bed
May 19, 2013 01:22PM
Hi,
FEATURE_CONTROLLER was set to 0.

I sent the analog value at different points in initExtruder():
  out.println_P(PSTR("A"));out.println(analogRead(1));
  
  for(i=0;ienablePin > -1) {
      pinMode(act->enablePin,OUTPUT);
      if(!act->enableOn) digitalWrite(act->enablePin,HIGH);
    }
    out.println_P(PSTR("B"));out.println(analogRead(1));
    act->tempControl.lastTemperatureUpdate = millis();
    out.println_P(PSTR("C"));out.println(analogRead(1));
#ifdef SUPPORT_MAX6675
    if(act->sensorType==101) {
      WRITE(SCK_PIN,0);
      SET_OUTPUT(SCK_PIN);
      WRITE(MOSI_PIN,1);
      SET_OUTPUT(MOSI_PIN);
      WRITE(MISO_PIN,1);
      SET_INPUT(MISO_PIN);
      digitalWrite(act->tempControl.sensorPin,1);
      pinMode(act->tempControl.sensorPin,OUTPUT);
    }
#endif
  }
  out.println_P(PSTR("D"));out.println(analogRead(1));
#if HEATED_BED_HEATER_PIN>-1
  out.println_P(PSTR("E"));out.println(analogRead(1));
  SET_OUTPUT(HEATED_BED_HEATER_PIN);
  out.println_P(PSTR("F"));out.println(analogRead(1));
  initHeatedBed();
#endif
 out.println_P(PSTR("G"));out.println(analogRead(1));
  
  extruder_select(0);
#if ANALOG_INPUTS>0
  ADMUX = ANALOG_REF; // refernce voltage
  for(i=0;ienablePin > -1) {
      pinMode(act->enablePin,OUTPUT);
      if(!act->enableOn) digitalWrite(act->enablePin,HIGH);
    }
    act->tempControl.lastTemperatureUpdate = millis();
    delay(50);
    out.println_P(PSTR("B"));out.println(analogRead(1));

"B" is now 1022 => It takes a short time until the value reaches 1022, the fault MUST be in this loop. I think you are completely right, repetier, this means, that tere is is activated a pullup or the pin is set as output. But wehre can i unactivate that? What is "enablePin"?

Thank you very much!
Regards
Jan

Edited 1 time(s). Last edit at 05/19/2013 02:06PM by Diphthong.
Re: Repetier, Gen7 1.5 and the heating bed
May 19, 2013 02:27PM
You should add a delay(50); before each write command. I see raising values until G so it looks like something is pulling up the voltage and you measure that. So the reason might already be before C. With the delay you give each action time to raise the voltage and read that.

The code behind H is the initalization for analog raadings via interrupt. From that point on you should not use the readAnalog any more.


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: Repetier, Gen7 1.5 and the heating bed
May 21, 2013 05:32AM
Hi repetier,
thanks for your answer.
I just solved the problem by commenting out
if(act->enablePin > -1) {
  pinMode(act->enablePin,OUTPUT);
  if(!act->enableOn) digitalWrite(act->enablePin,HIGH);
in the for-loop. What is that for? I don’t see any pin constants... What stands "enablePin" for?
Regards
Jan
Re: Repetier, Gen7 1.5 and the heating bed
May 21, 2013 11:59AM
That code disables the extruder stepper motor. According to

#define E0_ENABLE_PIN    25

there should be no influence, if you didn't change it in the configuration.h

You might add an output for debugging there, what the pin number really contains.


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!
Sorry, only registered users may post in this forum.

Click here to login