ArduinoGeneral

veyron 1x2a tcm260 release stepper driver shield

userHead lcockell 2020-05-25 04:35:25 1855 Views6 Replies
I am trying to de-energise and release my motor but as a novice cant find a way to do this. Could someone show me how. Here is my code which works fine but doesnt release. Thankyou
Code: Select all
#include <SPI.h>
#include <TMC26XStepper.h>

//we have a stepper motor with 200 steps per rotation,CS pin 6, dir pin 4, step pin 5 and a current of 800mA
TMC26XStepper tmc26XStepper = TMC26XStepper(400,6,4,5,800);
void setup() {
    Serial.begin(9600);
    Serial.println("==============================");
    Serial.println("TMC26X Stepper Driver Demo App");
    Serial.println("==============================");
    //set this according to you stepper
    Serial.println("Configuring stepper driver");
    //char constant_off_time, char blank_time, char hysteresis_start, char hysteresis_end, char hysteresis_decrement
    tmc26XStepper.setSpreadCycleChopper(2,24,8,6,0);
    tmc26XStepper.setRandomOffTime(0);
    tmc26XStepper.SPI_setCoilCurrent(100);
    tmc26XStepper.setMicrosteps(256);
    tmc26XStepper.setStallGuardThreshold(4,0);
    Serial.println("config finished, starting");
    Serial.println("started");

      tmc26XStepper.SPI_setSpeed(55);    //Set speed at 80 RPM
      tmc26XStepper.SPI_step(20);       //set step at -200 steps,  that is to say stepper will turn a circle reverse
               //start stepper
               tmc26XStepper.spi_start() ;
      delay(1000);                         //delay 2s
      tmc26XStepper.SPI_step(400);       // set step at 200 steps,  stepper will turn a circle forward
      tmc26XStepper.spi_start() ;
      delay(2000);

}
void loop() {

          //you can put stepper control code in loop{} to make stepper works circularly
}
2020-06-08 06:07:32 Please could someone explain the tmc26XStepper.setMicrosteps(256) in the example above. I have experimented with this setting and changed it to 1,32, 64. The motor just turns in exactly the same why one full turn. Obviously 256 microsteps should be more accurate but it always turns the same amount what ever I put. I dont think this command works as expected and that was what you sell it on. Please could someone verify. userHeadPic lcockell
2020-05-30 19:11:15 The code works fine but it does not release at the end. Ie holding torque. I need to be able to move the motor by hand at the end. thankyou userHeadPic lcockell
2020-05-27 05:57:26 Thankyou for the reply but it didn't work. userHeadPic lcockell