Using a Due with no shield

Hi again,

I'm trying to run repetier on a Due, but without a shield. Instead, I plug the wires directly onto the Arduino. Instead of normal stepsticks I'm using two ST-6560V3's, which re basically 3 TB6560's with their enable pins combined. With the provided DB25 connector I connected the pins to my arduino. I'm focussing this thread on just the X motor!

Using this sketch the X motor would turn fine:

[code]
#define ORIG_X_STEP_PIN     48
#define ORIG_X_DIR_PIN      50
#define ORIG_X_MIN_PIN      38
#define ORIG_X_MAX_PIN      36
#define ORIG_X_ENABLE_PIN   52
  
void setup() {
  pinMode(ORIG_X_STEP_PIN, OUTPUT);
  pinMode(ORIG_X_DIR_PIN, OUTPUT);
  pinMode(ORIG_X_ENABLE_PIN, OUTPUT);

  digitalWrite(ORIG_X_DIR_PIN, HIGH);
  digitalWrite(ORIG_X_ENABLE_PIN, LOW);
}

void loop() {
  digitalWrite(ORIG_X_STEP_PIN, HIGH);
  digitalWrite(ORIG_X_STEP_PIN, LOW);
  delayMicroseconds(1000000.0 / 1600.0 / 15);
}
[/code]

Now, I took the latest repetier. In configuration.h I set #define MOTHERBOARD 999. My userpins.h looks like this:

[code]
#ifndef __SAM3X8E__
#erro oops! Be sure to have 'due Arduino' selected from the 'tools-> Boards menu'.
 
#define KNOWN_BOARD
#define CPU_ARCH ARCH_ARM
/*****************************************************************
* Arduino Due pin assignments
******************************************************************/
 
//  First TB module
  #define ORIG_X_STEP_PIN     48
  #define ORIG_X_DIR_PIN      50
  #define ORIG_X_MIN_PIN      38
  #define ORIG_X_MAX_PIN      36
  #define ORIG_X_ENABLE_PIN   52
  
  //  Left Y-motor
  #define ORIG_Y_STEP_PIN     44
  #define ORIG_Y_DIR_PIN      46
  #define ORIG_Y_MIN_PIN      34
  #define ORIG_Y_MAX_PIN      32
  #define ORIG_Y_ENABLE_PIN   10
  //  End of left Y-motor
  
  //  Right Y-motor, abusing the second extruder for this
  #define ORIG_E1_STEP_PIN    40
  #define ORIG_E1_DIR_PIN     42
  #define ORIG_E1_ENABLE_PIN  10
  //  End of right Y-motor
// End of first TB module

//  Second TB module
  //  Left Z-motor
  #define ORIG_Z_STEP_PIN     49
  #define ORIG_Z_DIR_PIN      51
  #define ORIG_Z_MIN_PIN      30
  #define ORIG_Z_MAX_PIN      28
  #define ORIG_Z_ENABLE_PIN   53
  //  End of left Z-motor

  //  Right Z-motor, abusing the third extruder for this
  #define ORIG_E2_STEP_PIN    45
  #define ORIG_E2_DIR_PIN     47
  #define ORIG_E2_ENABLE_PIN  53
  //  End of right Z-motor

  //  Phi-motor
  #define ORIG_E0_STEP_PIN    61
  #define ORIG_E0_DIR_PIN     60
  #define ORIG_E0_ENABLE_PIN  62
  //  End of Phi-motor
//  End of second TB module
 
//Note that in due A0 pins on the board is channel 2 on the ARM chip
#define HEATER_0_PIN 10
// Because analog pin #
#define TEMP_0_PIN 11 
#define HEATER_1_PIN 8
// Because analog pin #
#define TEMP_1_PIN 12 
#define HEATER_2_PIN 9
// Because analog pin #
#define TEMP_2_PIN 13
 
#define SDPOWER   -1
// 10 if using HW spi. 53 if using SW SPI
#define SDSS 53 
#define LED_PIN   13
#define ORIG_FAN_PIN   9
#define ORIG_PS_ON_PIN 12
#define KILL_PIN   -1
#define SUICIDE_PIN -1// Pin that has to be turned right after the start, to keep the power flowing.

#define E0_PINS ORIG_E0_STEP_PIN,ORIG_E0_DIR_PIN,ORIG_E0_ENABLE_PIN,
#define E1_PINS ORIG_E1_STEP_PIN,ORIG_E1_DIR_PIN,ORIG_E1_ENABLE_PIN,

#define TWI_CLOCK_FREQ          100000
//  20 or 70
#define SDA_PIN       -1 
// 21 or 71
#define SCL_PIN       -1 
#define EEPROM_AVAILABLE EEPROM_NONE
[/code]

Now the engine is not running anymore! I tried about everything and I am about to give up. I don't see any pins getting overwritten by IO from other parts of the firmware. I used a multimeter to measure the output of the pins 48, 50 and 52 while sending commands like G1 X100 F60 and G28 X. They are all always high, so somewhere in the firmware they're probably overwritten. I'm clueless since these pins are only defined once in pins.h/userpins.h.

Someone please point me in the right direction :S. You will be rewarded with a beer (paypal) and 10 kudos.

Comments

  • edited October 2017

    [code]
    #ifndef __SAM3X8E__
    #erro oops! Be sure to have 'due Arduino' selected from the 'tools-> Boards menu'.
     
    #define KNOWN_BOARD
    #define CPU_ARCH ARCH_ARM
    /*****************************************************************
    * Arduino Due pin assignments
    ******************************************************************/
     
    //  First TB module
      #define ORIG_X_STEP_PIN     48
      #define ORIG_X_DIR_PIN      50
      #define ORIG_X_MIN_PIN      38
      #define ORIG_X_MAX_PIN      36
      #define ORIG_X_ENABLE_PIN   52
      
      //  Left Y-motor
      #define ORIG_Y_STEP_PIN     44
      #define ORIG_Y_DIR_PIN      46
      #define ORIG_Y_MIN_PIN      34
      #define ORIG_Y_MAX_PIN      32
      #define ORIG_Y_ENABLE_PIN   10  //shouldn´t that be 52?
      //  End of left Y-motor
      
      //  Right Y-motor, abusing the second extruder for this
      #define ORIG_E1_STEP_PIN    40
      #define ORIG_E1_DIR_PIN     42
      #define ORIG_E1_ENABLE_PIN  10 //shouldn´t that be 52?
      //  End of right Y-motor
    // End of first TB module

    //  Second TB module
      //  Left Z-motor
      #define ORIG_Z_STEP_PIN     49
      #define ORIG_Z_DIR_PIN      51
      #define ORIG_Z_MIN_PIN      30
      #define ORIG_Z_MAX_PIN      28
      #define ORIG_Z_ENABLE_PIN   53
      //  End of left Z-motor

      //  Right Z-motor, abusing the third extruder for this
      #define ORIG_E2_STEP_PIN    45
      #define ORIG_E2_DIR_PIN     47
      #define ORIG_E2_ENABLE_PIN  53
      //  End of right Z-motor

      //  Phi-motor
      #define ORIG_E0_STEP_PIN    61
      #define ORIG_E0_DIR_PIN     60
      #define ORIG_E0_ENABLE_PIN  62 //shouldn´t that be 53?
      //  End of Phi-motor
    //  End of second TB module
     
    //Note that in due A0 pins on the board is channel 2 on the ARM chip
    #define HEATER_0_PIN 10
    // Because analog pin #
    #define TEMP_0_PIN 11 
    #define HEATER_1_PIN 8
    // Because analog pin #
    #define TEMP_1_PIN 12 
    #define HEATER_2_PIN 9
    // Because analog pin #
    #define TEMP_2_PIN 13
     
    #define SDPOWER   -1
    // 10 if using HW spi. 53 if using SW SPI
    #define SDSS 53 
    #define LED_PIN   13
    #define ORIG_FAN_PIN   9
    #define ORIG_PS_ON_PIN 12
    #define KILL_PIN   -1
    #define SUICIDE_PIN -1// Pin that has to be turned right after the start, to keep the power flowing.

    #define E0_PINS ORIG_E0_STEP_PIN,ORIG_E0_DIR_PIN,ORIG_E0_ENABLE_PIN,
    #define E1_PINS ORIG_E1_STEP_PIN,ORIG_E1_DIR_PIN,ORIG_E1_ENABLE_PIN,

    #define TWI_CLOCK_FREQ          100000
    //  20 or 70
    #define SDA_PIN       -1 
    // 21 or 71
    #define SCL_PIN       -1 
    #define EEPROM_AVAILABLE EEPROM_NONE
    [/code]

    Now the engine is not running anymore! I tried about everything and I am about to give up. I don't see any pins getting overwritten by IO from other parts of the firmware. I used a multimeter to measure the output of the pins 48, 50 and 52 while sending commands like G1 X100 F60 and G28 X. They are all always high, so somewhere in the firmware they're probably overwritten. I'm clueless since these pins are only defined once in pins.h/userpins.h.

    Someone please point me in the right direction :S. You will be rewarded with a beer (paypal) and 10 kudos.

    see comments in bold letters, you wrote "I'm using two ST-6560V3's, which re basically 3 TB6560's with their enable pins combined"
    so the enable pins for each module should be the same number.
    also you multiple used pin 10 and 53

    #define ORIG_Y_ENABLE_PIN   10
    #define HEATER_0_PIN 10

     #define ORIG_Z_ENABLE_PIN   53
    #define SDSS 53

    multiple use of the pins for  enable is ok, but not for different functions.

    next possible error source regarding double use of pins is configuration.h .
    check also the pin numbers there

    be shure to have


    #define X_ENABLE_ON 0
    #define Y_ENABLE_ON 0
    #define Z_ENABLE_ON 0

    in configuration.h



  • I understand what you are saying but I purposely put enables on different pins so there'd be no interference from the Y or Z motor with the X motor. I'm really just focussing on the X motor here right now. You're right about the using of pins for multiple functions. I used a fresh repetier to start over again and forgot to change this. Did this now and I also scanned configuration.h for overlapping pins (there were none). I indeed have all the enable_on's set to 0.

    Still no turning motor :S
  • Have you allowed moving without homing? Also at start x is 0 so you can only move to the right I guess.

    You could check if the enable/dir/step pins get power when moving. Reagarding enable some drivers need it 1 some 0 to deliver power to steppersm so check if inverting helps here.
  • Repetier said:
    Have you allowed moving without homing? Also at start x is 0 so you can only move to the right I guess.

    You could check if the enable/dir/step pins get power when moving. Reagarding enable some drivers need it 1 some 0 to deliver power to steppersm so check if inverting helps here.
    Yes I did indeed allow moving without homing and the homing sensors are connected properly (I checked using M119 check endstop status and they are all LOW when I don't press any of them). But the motors won't even turn when I send the home command. I can indeed only move to the right, but it won't turn in any direction whatsoever. My stepsticks need the enable pin to be LOW in order for it to be enabled, like regular stepsticks. I also tried inverting them though, no result. I measured the enable pin value on the board indeed, but wether it is HIGH or LOW the engines won't freaking turn. Since I have an upcoming deadline I'm probably going to have to make a demo sketch with accelstepper.
  • If they turn only in one direction you might have direction pin not connected/defined wrong. If enable is correct is easy to see. When enabling firmware the motors must have no current so you can turn by hand. When you start a move the motors get enabled.

    Also make sure you have eeprom disabled since you have no eeprom without a board having eeprom.
  • Yes I have eeprom disabled :). The motors will by the way never get enabled. Not on startup, not when sending a G1 command and not when sending M84 (release motors). Since the firmware for this product is not too complex I decided to code a quick custom firmware for it, for now.
Sign In or Register to comment.