MCUXpresso SDK Documentation

soem_servo_motor_rt1180_bm

soem_servo_motor_rt1180_bm#

Overview#

This example demonstrates how to use the Simple Open EtherCAT Master (SOEM) Library to control motor.

In this example there are 2 NXP board:

SOEM as EtherCAT MainDevice running on EVK board(i.MXRT1180/FRDM-1186/i.MX943)

ecat_servo_motor example as EtherCAT SubDevice running on i.MXRT1180 EVK/XSERVO-MTR-DRV RT1180/i.MX943 EVK board

Note: 

	ecat_servo_motor path: 
	For i.MXRT1180 EVK: .../examples/_boards/evkmimxrt1180/ecat_examples/servo_motor
	For XSERVO-MTR-DRV RT1180: https://github.com/nxp-appcodehub/rd-motion-control-slave-servo-mimxrt1180
	For i.MX943 EVK: .../examples/_boards/imx943evk/ecat_examples/dual_cores_servo_motor

Running the demo#

If the test passes, the motor will start to retate.

When the demo is running, the serial port will output:

NETC EP frame loopback example start.
Starting motion task
ec_init on netc0 succeeded.
ec_config_init 0
...
1 slaves found and configured.
ec_config_map_group IOmap:20000664 group:0
>Slave 1, configadr 1001, state  2
...
Slaves mapped, state to SAFE_OP.
Request operational state for all slaves
Calculated workcounter 3
Request operational state for all slaves
Calculated workcounter 3
Operational state reached for all slaves.

Supported Boards#

MIMXRT1180-EVK
Hardware requirements
  • Mini/micro USB cable

  • Network cable RJ45 standard

  • MIMXRT1180-EVK board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Power up the servo-motor and connect it to the target board(ENET4) via an Ethernet Cable.

  3. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  4. Write the program to the flash of the target board.

  5. Start the demo.

FRDM-MIMXRT1186
Hardware requirements
  • Type-C USB cable

  • Network cable RJ45 standard

  • FRDM-IMXRT1186 board

  • BECKHOFF EK1100 EtherCAT Coupler *1

  • BECKHOFF EL2008 *1

  • BECKHOFF EL1018 *1

  • Personal Computer

Board settings
  • J12(1-2)/J13(2-3): ETH0 Function Via J56A.

  • J18(1-2)/J17(2-3): ETH2 Function Via J56B.

Prepare the Demo
  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Power up the EtherCAT Coupler and connect it to the target board(J56-A) via an Ethernet Cable.

  3. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  4. Write the program to the flash of the target board.

  5. Press the reset button on your board to start the demo.

IMX943-EVK
Hardware requirements
  • Mini/micro USB cable

  • Network cable RJ45 standard

  • i.MX943-EVK board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Power up the servo-motor and connect it to the target board(J26) via an Ethernet Cable.

  3. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  4. Write the program to the flash of the target board.

  5. Start the demo.