EtherCAT Control Framework v0.9
Implementation of EtherCAT protocol using IgH EtherCAT library for robot controller.
ecat_globals.hpp File Reference
Include dependency graph for ecat_globals.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define NUM_OF_SLAVES   1
 
#define CUSTOM_SLAVE   0
 
#define FREQUENCY   1000
 
#define MEASURE_TIMING   1
 
#define DISTRIBUTED_CLOCK   0
 
#define GEAR_RATIO   49
 
#define ENCODER_RESOLUTION   1000
 
#define INC_PER_ROTATION   GEAR_RATIO*ENCODER_RESOLUTION*4
 
#define FIVE_DEGREE_CCW   int(INC_PER_ROTATION/72)
 
#define THIRTY_DEGREE_CCW   int(INC_PER_ROTATION/12)
 
#define PERIOD_NS   (g_kNsPerSec/FREQUENCY)
 
#define PERIOD_US   (PERIOD_NS / 1000)
 
#define PERIOD_MS   (PERIOD_US / 1000)
 

Variables

const uint32_t g_kNumberOfServoDrivers = 1
 Number of connected servo drives.
More...
 
static int8_t g_kOperationMode = kProfileVelocity
 Select operation mode for motors, default: Profile Velocity. More...
 
const struct timespec g_cycle_time = {0, PERIOD_NS}
 
const struct timespec g_half_cycle_time = {0, PERIOD_NS/2}
 

Macro Definition Documentation

◆ CUSTOM_SLAVE

#define CUSTOM_SLAVE   0

Set this to 1 if you have custom EtherCAT slave other than servo drive.

Note
That if you have different custom slave than EasyCAT you have to modify PDO mapping by yourself.

◆ DISTRIBUTED_CLOCK

#define DISTRIBUTED_CLOCK   0

◆ ENCODER_RESOLUTION

#define ENCODER_RESOLUTION   1000

◆ FIVE_DEGREE_CCW

#define FIVE_DEGREE_CCW   int(INC_PER_ROTATION/72)

◆ FREQUENCY

#define FREQUENCY   1000

◆ GEAR_RATIO

#define GEAR_RATIO   49

◆ INC_PER_ROTATION

#define INC_PER_ROTATION   GEAR_RATIO*ENCODER_RESOLUTION*4

◆ MEASURE_TIMING

#define MEASURE_TIMING   1

◆ NUM_OF_SLAVES

#define NUM_OF_SLAVES   1

◆ PERIOD_MS

#define PERIOD_MS   (PERIOD_US / 1000)

◆ PERIOD_NS

#define PERIOD_NS   (g_kNsPerSec/FREQUENCY)

◆ PERIOD_US

#define PERIOD_US   (PERIOD_NS / 1000)

◆ THIRTY_DEGREE_CCW

#define THIRTY_DEGREE_CCW   int(INC_PER_ROTATION/12)

Variable Documentation

◆ g_cycle_time

const struct timespec g_cycle_time = {0, PERIOD_NS}

◆ g_half_cycle_time

const struct timespec g_half_cycle_time = {0, PERIOD_NS/2}

◆ g_kNumberOfServoDrivers

const uint32_t g_kNumberOfServoDrivers = 1

Number of connected servo drives.

USER SHOULD DEFINE THIS AREAS ///

◆ g_kOperationMode

int8_t g_kOperationMode = kProfileVelocity
static

Select operation mode for motors, default: Profile Velocity.