You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

139 lines
5.5 KiB
C

2 years ago
// Motor_8164.h: interface for the CMotor_8164 class.
//
//////////////////////////////////////////////////////////////////////
#pragma once
#include "MotorAdlinkBase.h"
class CMotor_8164 : public CMotorAdlinkBase
{
public:
CMotor_8164(const CMtrProfile& mtrProfile, double* dpPos, CMotionControllerBase* pBaseController);
2 years ago
virtual ~CMotor_8164();
// **************************************************************
// Methods declaration
// **************************************************************
// method to close the axis
void CloseAxis() override;
// method to initialize and configure the axis
void ConstructMotor() override;
// method to On/Off motor
bool OnMotor() override;
bool OffMotor() override;
// method to stop motor with decceleration
bool DecelStop() override;
// method to trigger Emergency stop the motor int EStop();
bool EmergStop() override;
// method to get commanded position
3 months ago
bool GetMotorCommandedPosition(int iMtrNo, double& dRaw) override;
2 years ago
// method to get the motor axis IO status
int GetMotionIOStatus(const CMtrProfile& mtrProfile) override;
// method to get Other axis motor ready status
BOOL IsMotorReady(const CMtrProfile& mtrProfile) override;
// method to get Other axis home sensor status
bool IsMtrOn(const CMtrProfile& mtrProfile) override;
// method to get other motor axis current position
3 months ago
bool GetMotorPosition(const CMtrProfile& mtrProfile, double& dRawPosition) override;
2 years ago
// method to get motor axis current position error
3 months ago
bool GetMotorPositionError(double& dRawPositionError) override;
2 years ago
// method to process interrupt to decode what happen to the motor
void ProcessInt(int nIntCode = 0) override;
// method to reset single trigger
int ResetSingleTrigger(double dPosition = 0.0) override;
// method to set the commanded position register
bool SetMotorCommandedPosition(double dPosition) override;
// method to set the mechanical coversion factor
bool RefreshMotorConversionFactor() override;
// method to set homing modes
bool SetMotorHomeMode(int iHomeMode) override;
// method to set multiple trigger
bool SetMotorMultipleTrigger(const multiple_trigger& trigger) override;
// method to force set the current position
bool SetMotorPosition(double dPosition) override;
// method to arm controller axis for single trigger
int SetSingleTrigger(double dPosition, int nCmpSource = 1, int nPulseStretch = STRETCH_NON) override;
// method to arm multiaxis for simultaneous motion
bool SetupSimultaneousMoveOption() override;
bool SetupAbsoluteSimultaneousMove(int nNoOfAxis, short* sAxis, double* dPosition, double* dStartVel, double* dMaxVel, double* dAcc, double* dDec) override;
bool SetupRelativeSimultaneousMove(int nNoOfAxis, short* sAxis, double* dPosition, double* dStartVel, double* dMaxVel, double* dAcc, double* dDec) override;
3 months ago
bool StartSimultaneousMove(const std::vector<short>& vecAxis) override;
2 years ago
bool StopSimultaneousMove(int nFirstAxisNo) override;
// Method to force a compare output pulse
int TriggerCompareOutput() override;
// method to set the motor type and encoder input type
bool SetMotorType(int iMtrType) override;
// method to set the motor alarm signal logic
bool SetMotorAlarmLogic(int iALM) override;
// method to set the home sensor signal logic
bool SetMotorHomeSensorLogic(int iORGI) override;
// method to set the encoder Index signal logic
bool SetMotorIndexLogic(int iIndexLogic) override;
// method to set the in position signal logic
bool SetMotorINPLogic(int iINP) override;
// method to set clk type, out/dir or cw/ccw
bool SetMotorClk(int iClk) override;
bool SetHomingResetPosition(bool bEnable) override;
bool StartHomeMove(double dStartSpeed, double dMaxSpeed, double dAcc) override;
bool StartContinuousMove(double dStartSpeed, double dMaxSpeed, double dAcc) override;
bool StartSContinuousMove(double dStartSpeed, double dMaxSpeed, double dAcc, double dSAcc) override;
bool StartAbsoluteMove(double dPosition, double dStartSpeed, double dMaxSpeed, double dAcc, double dDec) override;
bool StartSAbsoluteMove(double dPosition, double dStartSpeed, double dMaxSpeed, double dAcc, double dDec, double dSAcc, double dSDec) override;
bool StartRelativeMove(double dPosition, double dStartSpeed, double dMaxSpeed, double dAcc, double dDec) override;
bool StartSRelativeMove(double dPosition, double dStartSpeed, double dMaxSpeed, double dAcc, double dDec, double dSAcc, double dSDec) override;
bool SetFixSpdRange(double dMaxVel, bool bRealWorldUnit = false);
bool UnFixSpdRange();
bool ResetMotorPositionError();
bool FindLimit(HOME_DIR homeDir, MOTION_SPEED speed);
bool EnableLimitInterrupt();
bool DisableLimitInterrupt();
bool IsSimultaneousMoveSupported(void) override;
// LERP - Linear Interpolation
bool StartXYRelMoveLinear(double dDistX, double dDistY, double dStartVel, double dMaxVel, double dAcc, double dDec) override;
bool StartZURelMoveLinear(double dDistZ, double dDistU, double dStartVel, double dMaxVel, double dAcc, double dDec) override;
bool StartXYSRelMoveLinear(double dDistX, double dDistY, double dStartVel, double dMaxVel, double dAcc, double dDec, double dSAcc, double dSDec) override;
bool StartZUSRelMoveLinear(double dDistZ, double dDistU, double dStartVel, double dMaxVel, double dAcc, double dDec, double dSAcc, double dSDec) override;
private:
short m_sMtrNo;
};