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.
213 lines
6.3 KiB
C++
213 lines
6.3 KiB
C++
// Motor_ETEL.h: interface for the CMotor_ETEL class.
|
|
//
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
#if !defined(AFX_MOTOR_ETEL_H__FC570503_D3D0_404B_91B5_62C2067BD698__INCLUDED_)
|
|
#define AFX_MOTOR_ETEL_H__FC570503_D3D0_404B_91B5_62C2067BD698__INCLUDED_
|
|
|
|
#if _MSC_VER > 1000
|
|
#pragma once
|
|
#endif // _MSC_VER > 1000
|
|
|
|
#include "MotorBase.h"
|
|
|
|
class CMotor_ETEL : public CMotorBase
|
|
{
|
|
public:
|
|
CMotor_ETEL(CMtrProfile mtrProfile, double *dpPos);
|
|
virtual ~CMotor_ETEL();
|
|
|
|
//**************************************************************
|
|
// Methods declaration
|
|
//**************************************************************
|
|
|
|
// method to close the axis
|
|
void CloseAxis();
|
|
|
|
// method to initialize and configure the axis
|
|
void ConstructAxis(CMtrProfile mtrProfile);
|
|
|
|
// method to On/Off motor
|
|
int OnMtr(bool bOn);
|
|
|
|
// method to stop motor with decceleration
|
|
int DecStop();
|
|
|
|
// method to trigger Emergency stop the motor int EStop();
|
|
int EStop();
|
|
|
|
// method to get commanded position
|
|
double GetCommandPosition();
|
|
|
|
// method to get the motor axis IO status
|
|
int GetMotionIOStatus();
|
|
|
|
// method to get the Motor Ready Status
|
|
BOOL IsMotorReady();
|
|
|
|
// method to get the Motor Alarm Status
|
|
BOOL IsMotorAlarm();
|
|
|
|
// method to get the Motor Negative/CCW Limit Status
|
|
BOOL IsNegLmtHit();
|
|
|
|
// method to get the Motor Positive/CW Limit Status
|
|
BOOL IsPosLmtHit();
|
|
|
|
// method to get the Motor Home Sensor Status
|
|
BOOL IsHomed();
|
|
|
|
// method to check if the Motor is TURN ON
|
|
bool IsMtrOn();
|
|
|
|
// method Check other axis home sensor
|
|
BOOL IsHomed(CMtrProfile mtrProfile);
|
|
|
|
// method to get other motor axis IO status
|
|
int GetMotionIOStatus(CMtrProfile mtrProfile);
|
|
|
|
// method to get Other axis motor ready status
|
|
BOOL IsMotorReady(CMtrProfile mtrProfile);
|
|
|
|
// method to get Other axis Alarm status
|
|
BOOL IsMotorAlarm(CMtrProfile mtrProfile);
|
|
|
|
// method to get Other axis negative/ccw limit status
|
|
BOOL IsNegLmtHit(CMtrProfile mtrProfile);
|
|
|
|
// method to get Other axis positive/cw limit status
|
|
BOOL IsPosLmtHit(CMtrProfile mtrProfile);
|
|
|
|
// method to get Other axis home sensor status
|
|
bool IsMtrOn(CMtrProfile mtrProfile);
|
|
|
|
// method to get other motor axis current position
|
|
double GetOtherAxisPosition(CMtrProfile mtrProfile);
|
|
|
|
// method to get motor axis current position error
|
|
double GetPosErr();
|
|
|
|
// method to get the current motor position
|
|
double GetPosition();
|
|
|
|
// method to do homing by limit sensor
|
|
bool HomingByLimit();
|
|
|
|
// method to do homing by sensor as well as index
|
|
BOOL HomeBySensorAndIndex();
|
|
|
|
// method to do homing by index signal
|
|
BOOL HomeByIndex();
|
|
|
|
// method to do homing by Home Sensor
|
|
BOOL HomeBySensor();
|
|
|
|
// method to move absolute
|
|
int MoveAbs(double dPosition, int nPos=-1, int nMode=0);
|
|
|
|
// method to move continuously
|
|
int MoveContinuously(bool bCW=true);
|
|
|
|
// method to move relative distance
|
|
int MoveRel(double dDistance, int nPos=-1);
|
|
|
|
// method to process interrupt to decode what happen to the motor
|
|
void ProcessInt(int nIntCode=0);
|
|
|
|
// method to reset single trigger
|
|
int ResetSingleTrigger();
|
|
|
|
// method to set the commanded position register
|
|
int SetCommandPosition(double dPosition);
|
|
|
|
// method to set homing modes
|
|
int SetHomeMode();
|
|
|
|
// method to set the mechanical coversion factor
|
|
int SetConversionFactor(double dUPR, double dPPR, double dEPPR);
|
|
|
|
// method to set multiple trigger
|
|
int SetMultipleTrigger(double dStartPosition, double dStopPosition, double dIntervalDistance, int nNoOfTrigger, int nCmpSource=1);
|
|
|
|
// method to force set the current position
|
|
int SetPosition(double dPosition);
|
|
|
|
// method to arm controller axis for single trigger
|
|
int SetSingleTrigger(double dPosition, int nCmpSource=1, int nPulseStretch=STRETCH_NON);
|
|
|
|
// method to arm multiaxis for simultaneous motion,
|
|
// nMode = 0 : Normal multi-axis move
|
|
// nMode = 1 : Gantry move
|
|
int SimultaneousMove(int nNoOfAxis, CMtrProfile *mtrProfile, double *dPosition, double *dStartVel, double *dMaxVel, double *dAcc, int nMode = 0);
|
|
|
|
// method to move absolute with s-curve profile
|
|
int SMoveAbs(double dPosition, int nPos=-1, int nMode=0);
|
|
|
|
// method to move motor in s-curve continuously
|
|
int SMoveContinuously(bool bCW=true);
|
|
|
|
// method to move relative distance with s-curve profile
|
|
int SMoveRel(double dDistance, int nPos=-1);
|
|
|
|
// return: success = MOTION_END; error = MOTION_ERROR; Force Stop = MOTION_FORCE_STOP
|
|
DWORD WaitHomeDone();
|
|
|
|
// wait for motion stop based on pulse send out or in-position signal
|
|
// call this function after calling a move operation
|
|
// return: success = MOTION_END; error = MOTION_ERROR; Force Stop = MOTION_FORCE_STOP
|
|
// positive limit = MOTION_LIMIT_POS_HIT; negative limit = MOTION_LIMIT_NEG_HIT
|
|
DWORD WaitMotionDone(DWORD dwTimeout=1000);
|
|
|
|
// method to get the encoder index signal
|
|
BOOL IsIndex();
|
|
|
|
// method to move profile
|
|
int UpdateProfile();
|
|
|
|
// Stop Motion Time Counter and return the time
|
|
long StopMotionTimeCounter();
|
|
|
|
// Logging of messages
|
|
void Log(CString csMsg);
|
|
|
|
private:
|
|
// Get Axis Status, Polling, Bus Busy
|
|
dword GetAxisStatusM60();
|
|
|
|
// Get Other Axis Status M60, Polling, Bus busy
|
|
dword GetAxisStatusM60(CMtrProfile mtrProfile);
|
|
|
|
// Get Axis Status M63
|
|
|
|
// Get Other Axis Status M63
|
|
|
|
// Get Axis Home Complete Status
|
|
bool IsAxisHomeSequenceCompleted();
|
|
|
|
// Check if axis is in Homing Sequence
|
|
bool IsAxisInHoming();
|
|
|
|
bool m_bBenchDebugWithActualHardware;
|
|
|
|
BOOL GenerateNewHomePosition();
|
|
|
|
DSA_DRIVE_GROUP *m_group;
|
|
|
|
// method to move profile
|
|
int UpdateProfile(CMtrProfile mtrProfile, int nDepth, double dAcc, double dSpd, double dJerk);
|
|
|
|
// Gary 28Sep11, V1.29.03 added separate method to set gantry move profile
|
|
int UpdateGantryProfile(int nDepth, double dAcc, double dSpd, double dJerk);
|
|
|
|
int ResetAlarm(bool bReset);
|
|
|
|
int GantryEnable(int nNoOfAxis, CMtrProfile *mtrProfile);
|
|
|
|
int GantryDisable(int nNoOfAxis, CMtrProfile *mtrProfile);
|
|
// MIT BT 0000030, Gary Lam 17Jan13, V1.29.08
|
|
int iso_upi_converter(double isovalue, long &lInc);
|
|
int trigger_pulse_generator_event_setting(int ntrigger_event_number, double dtrigger_start_on_position, double dtrigger_direction, long lgenerator_used, double ddelta_position);
|
|
};
|
|
|
|
#endif // !defined(AFX_MOTOR_ETEL_H__FC570503_D3D0_404B_91B5_62C2067BD698__INCLUDED_)
|