Skip to content

recommend settings for very silent and relative high velocitiy #96

@s-light

Description

@s-light

hello community,

i search for recommendations how to get very silent and relative high velocitiy with this library and my setup.

if you have any other idea where to post this question please let me know ;-)

my setup:

and the basic setup works already :-)
i tested with the driver X and the motor is running with this sketch:
(based on MoveAtVelocity.ino and the other examples..)

#include <TMC2209.h>

const int DELAY = 200;
const int32_t VELOCITY = 200000;
// current values may need to be reduced to prevent overheating depending on
// specific motor and power supply voltage
const uint8_t RUN_CURRENT_PERCENT = 11;

// Instantiate TMC2209
TMC2209 driverX;
uint32_t velocityX = 0;

void setup() {
    Serial.begin(115200);

    driverX.setup(Serial2, 115200, TMC2209::SERIAL_ADDRESS_0);
    driverX.setHardwareEnablePin(PIN_XEN);
    
    delay(DELAY);
    driverX.setRunCurrent(RUN_CURRENT_PERCENT);
    // use motor datasheet value: 0,67A
    // and onboard 0.11R resistor
    driverX.setRMSCurrent(670, 0.11f);
    //driverX.useInternalSenseResistors();
    // https://github.com/janelia-arduino/TMC2209?tab=readme-ov-file#standstill-mode
    driverX.setStandstillMode(TMC2209::FREEWHEELING);

    driverX.enableAutomaticCurrentScaling();
    driverX.enableCoolStep();

    // if you want to use the `PIN_XSTOP` (DIAG PIN)  you need to set
    // `setCoolStepDurationThreshold` to enable output on it..
    // https://github.com/janelia-arduino/TMC2209/issues/5#issuecomment-1067109432

    driverX.enable();
    setXVelocity(VELOCITY);

    Serial.print("Moving at velocity ");
    Serial.println(VELOCITY);

    uint32_t interstep_duration = driverX.getInterstepDuration();
    Serial.print("which is equal to an interstep_duration of ");
    Serial.println(interstep_duration);
}

void loop() {
    if (not driverX.isSetupAndCommunicating()) {
        Serial.println("Stepper driver not setup and communicating!");
        return;
    }

    bool hardware_disabled = driverX.hardwareDisabled();
    TMC2209::Settings settings = driverX.getSettings();
    TMC2209::Status status = driverX.getStatus();

    if (hardware_disabled) {
        Serial.println("Stepper driver is hardware disabled!");
    } else if (not settings.software_enabled) {
        Serial.println("Stepper driver is software disabled!");
    } else if ((not status.standstill)) {
        //
    } else {
        if (velocityX > 0) {
            Serial.println("Not moving, something is wrong!");
        }
    }

    Serial.print("stall_guard_result = ");
    Serial.println(driverX.getStallGuardResult());
    

    //Serial.println();

    if (millis() > (60 * 1000)) {
        setXVelocity(0);
    }
    if (millis() > (70 * 1000)) {
        driverX.disable();
    }
    delay(DELAY);
}

void setXVelocity(uint32_t velocity) {
  velocityX = velocity;
  driverX.moveAtVelocity(velocity);
}

currently i have no acceleration implemented. (but that is planed)
with the currently set velocity the motor just starts :-)
higher does not start and would need acceleration and most likely a 24V supply..

however the motor gets relative hot (>= 60°C → can not touch it very long) -
without any kind of load (nothing connected to shaft) after about 4minutes continuous running

and there is a slight audible sound -
and as fare as i remember i had exactly this motor working with another TMC driver back some years absolut silent..

i have tried to dig thru the datasheet -
and currently i feel a bit lost...
maybe i just have to really read it from front to back?!

i have the feeling i am missing some basic settings for getting it to a cool and silent run mode..

so any hints are welcome :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions