I want to find...

Search

Shares

Table of Content

EthercatDevice_DmpStepper.machineDisableSoftLimit()

[EthercatDevice_DmpStepper_Generic]

Description

Disable the software limit function for the machine on the EtherCAT slave device. For more information about software limits, please refer to configMachineSoftLimit().

Derived Class:

Class NameVendor IDProduct Code
EthercatDevice_QECR11MP3S0x00000bc30x0086d0d6
EthercatDevice_QECR00MP3S0x00000bc30x0086d0d9

Syntax

int machineDisableSoftLimit();

Parameters

None.

Return Value

Return an error code. If the returned value is zero, it indicates a successful execution of this function.

Comment

This function must be called after a successful execution of EthercatMaster::start() and before EthercatMaster::stop(). This function is blocking and cannot be called within the callback functions.

This function only works in G-code Controller mode on the EtherCAT slave device. For more details, please refer to configDeviceMode(). This function does not work in the following case:

  • The machine is servo-off.

Example

#include "Ethercat.h"

EthercatMaster master;
EthercatDevice_QECR11MP3S slave;

void CyclicCallback() {
  slave.update();
}

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

  master.begin();
  slave.attach(0, master);
  slave.configMachineSoftLimit(ECAT_MACHINE_X_AXIS, -50, 50);
  slave.configMachineSoftLimit(ECAT_MACHINE_Y_AXIS, -50, 50);
  slave.configMachineSoftLimit(ECAT_MACHINE_Z_AXIS, -50, 50);
  master.attachCyclicCallback(CyclicCallback);
  master.start();

  slave.machineServoOn();
  while (slave.machineIsServoOn() == 0);

  slave.machineDisableSoftLimit();

  slave.machineGcode("G1 X-100 Y-100 Z-100");
  slave.machineGcode("G1 X100 Y100 Z100");
  delay(10);

  while (slave.machineIsMoving()) {
    Serial.print("Acutal Position => ");
    Serial.print("X: ");
    Serial.print(slave.machineActualPosition(ECAT_MACHINE_X_AXIS), 2);
    Serial.print(", Y: ");
    Serial.print(slave.machineActualPosition(ECAT_MACHINE_Y_AXIS), 2);
    Serial.print(", Z: ");
    Serial.println(slave.machineActualPosition(ECAT_MACHINE_Z_AXIS), 2);
    delay(10);
    // ...
  }

  slave.machineServoOff();
  while (slave.machineIsServoOn() == 1);
}

void loop() {
  // ...
}

Please see EthercatDevice_DmpStepper_Generic Class for more QEC Stepper Drivers instructions and API usage.

Scroll to Top