Skip to content

Examples of contol CiA402 Ethercat servo motors based on NXP real-time-edge-servo software

Notifications You must be signed in to change notification settings

orange2120/ec_servo_examples

Repository files navigation

EtherCAT Servo Motor Examples

EtherCAT servo motor control examples based on NXP real-time-edge-servo (libnservo) library.

Device configuration file

Replace the VendorId and the ProductCode with your devices.

...
<VendorId>#x66668888</VendorId>
<ProductCode>#x20193303</ProductCode>
<Name>IHSS57/60-EC</Name>
...

Build

Configure and build

$ mkdir build
$ cd build
$ cmake ..
$ make

The binaries will be in ./build/bin

Compile specific target

### Make Profile Position control example ###
$ make ec_pp_udp_demo
### Make Profile Velocity control example ###
$ make ec_pv_udp_demo

Usage

The example programs in ./example listen commands from UDP client, the default port is 3000.

Run

### Run Profile Position control server ###
$ ./ec_pp_udp_demo <motor configuration xml>
### Run Profile Velocity control server ###
$ ./ec_pv_udp_demo <motor configuration xml>

Testing using nc

$ nc -u <IP address> <port>
$ nc -u 192.168.50.100 3000

The Python script provides simple GUI for examples

$ python rt_edge_servo_udp_controller.py

ec_pp_udp_demo

Modified from Profile_Position_Mode_Test_2HSS458-EC.c, operate the motor in Profile Position mode.

Message format

P<absolute position>,V<profile velocity>
P12000,V500
P-1000,V10000

ec_pv_udp_demo

Modified from Profile_Velocty_Mode_Test_2HSS458-EC.c, operate the motor in Profile Velocity mode.

Message format

V<target velocity>
V1000
V-30000

Dependencies

C compiler
CMake
IgH EtherCAT Master (EtherLab::ethercat)
libxml2-dev

Reference

About

Examples of contol CiA402 Ethercat servo motors based on NXP real-time-edge-servo software

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published