move_home

This function aligns each axis of the robot to its home position when the robot’s axes have been twisted or offset due to internal or external errors in the robot controller. It restores the mechanical home state and ensures all axes are synchronized for subsequent motion commands.

Definition
DRFLEx.h within class CDRFLEx, public section (line 759)

bool move_home(MOVE_HOME eMode = MOVE_HOME_MECHANIC, unsigned char bRun = (unsigned)1) {
    return _move_home(_rbtCtrl, eMode, bRun);
};

Parameter

Parameter Name

Data Type

Default Value

Description

eMode

MOVE_HOME

MOVE_HOME_MECHANIC

Specifies the homing mode
Refer to the Definition of Enumeration Type

bRun

unsigned char

1

Motion execution flag
0: Stop, 1:Motion (Execute homing)

Return

Value

Description

0

Error

1

Success

Example

#include "DRFLEx.h"
#include <thread>
#include <chrono>
using namespace DRAFramework;

int main() {
    CDRFLEx drfl;

    // 1) Execute homing motion to realign all axes mechanically
    drfl.move_home(MOVE_HOME_MECHANIC, (unsigned char)1);
    std::this_thread::sleep_for(std::chrono::seconds(8)); // wait during motion

    // 2) Stop homing motion prematurely if needed
    drfl.move_home(MOVE_HOME_MECHANIC, (unsigned char)0);

    // 3) Resume operation only after homing is completed and stabilized
    drfl.mwait();  // wait until homing is complete
    drfl.movej({0, -30, 90, 0, 90, 0}, 50, 50);  // start a new move

    return 0;
}

This example demonstrates a typical homing workflow:
the robot performs a full mechanical alignment using MOVE_HOME_MECHANIC, optionally stops mid-process if needed, and then resumes normal motion once homing is complete.
It is recommended to call mwait() or get_robot_state() after homing to confirm the motion completion and state stability.