Scope of this article and attached document:
This article and more comprehensive attached PDF document provides some additional information and limitations which are important to take care in case of any implementation of customized libraries or master’s application code commanding EPOS4’s UART/USB protocol.
This article addresses experienced software developers with some base knowledge about communication protocols and the need to implement the EPOS4 RS232 or USB protocol on their master system.
Hint:
If there is a PC (with Windows or Linux), Raspberry Pi, BegaleBone, or nVIDIA Jetson TX2 as a master system in use, it is possible to use the Epos Command Library, which has the required protocol implementation internally included and provides high level functions for motion control commanding.
If the Epos Command library can be in use, there is no need to investigate in low level RS232 or USB protocol implementation. The development of the master's application code can focus on the complex high level motion control function calls.
Additional documentation:
The attached PDF holds some additional extracts of the "EPOS4 Communication Guide" but it is no(!) replacement of the chapter "2 USB & RS232 Communication" of the "EPOS4 Communication Guide".
It is mandatory that you read the chapter "2 USB & RS232 Communication" of the "EPOS4 Communication Guide" too! It holds the required information about the protocol’s OpCodes, Data Link Layer, Frame Structure, etc.
The "EPOS4 Communication Guide" is located in the following default path on the PC’s local drive after installation of EPOS Studio:
C:\Program Files (x86)\maxon motor ag\EPOS Positioning Controller\EPOS4\04 Programming
Command processing
Communication sequence
Please take care of the following strict order!
Check the corresponding subchapters (e.g. "Frame structure", "Error Control", "Character Stuffing", "Transmission Byte Order") of the chapter "2 USB & RS232 Communication" of the "EPOS4 Communication Guide" too.
- Setup the desired data stream.
- Low byte has to be transmitted first (i.e. high and low bytes have to be swapped).
- Detailed frame structure is described in the “EPOS4 Communication Guide”
- Calculate CRC and add it to the data frame.
- Please ensure that the CRC is calculated correctly.
If the CRC is not correct, the command will not be accepted and processed. - CRC calculation does not(!) include “character stuffing”.
- Please ensure that the CRC is calculated correctly.
- Add “character stuffing” to the data frame.
- Transmit the data
- IMPORTANT: Wait until you receive the reply message of the EPOS4
- The master’s application code must wait for the reply of EPOS4
before the next command is transmitted! - The protocol is based on the following simple principle:
- The master sends a request ot the EPOS4.
- The EPOS4 replies (or the master detects a timed-out communication).
- EPOS4 cannot process data simultaneously!
- Do not send any data before the reply (or a timeout) is present!
- The master’s application code must wait for the reply of EPOS4
- IMPORTANT: Check the content of the EPOS4’s reply and included error code!
- The EPOS4’s reply holds two bytes representing an error code.
- If the error code is unequal ‘0’, the command was not(!) be processed.
- Check chapter “6 Communication Error Code Definition”
of the “EPOS4 Communication Guide” about error details. - Fix the root cause of the error before you send the data frame again.
- Check chapter “6 Communication Error Code Definition”
Trouble shooting: EPOS4 does not respond
- Ensure that the latest EPOS4 firmware is installed
- EPOS Studio -> Wizards -> Firmware Update
- Ensure that the EPOS4’s supply voltage is on and plugged in.
- The green or red LED must be on (or blinking).
- Pure USB bus powering is not(!) sufficient to establish communication.
- Ensure that the identical bit rate is configured by the EPOS4 and the master.
- Check EPOS4’s “RS232 bit rate” by object 0x2002.
- Ensure that the data frame and its complete content is correct.
- Typically a wrong CRC or missing “Character stuffing” is one cause of failing messages.
- Ensure that the motor phase cable are shielded.
- If there is no shielding of the motor phase cable present and it is close (e.g. in the same cable channel) like the RS232 cable, there is a high risk of electromagnetic noise and disturbed RS232 communication (or other signal lines too like encoders and hallsensors).
- Ensure that the shielding of the motor cable is attached to broad Earth potential.
- Record a communication bus trace if further analysis is required.
- If none of the measures and checkpoints mentioned above help to clarify the root cause of a communication problem, there is the need to record the bus communication.
- A bus trace can be recorded by a so-called Sniffer Software and a special adapter connecting the Rx and Tx signal lines.
- Google for “RS232 sniffer” to find software and required cables or wiring diagrams.
- If there is a logic analyzer available, the signals of the Rx and TX lines can be also recorded.
- Submit a request to the maxon support: http://support.maxonmotor.com.
Please provide the following information for analyzing by the maxon experts:- Communication bus trace and / or logic analyzer files.
- EPOS4 *.dcf configuration file.
- Diagrams of the communication cable’s wiring plus photos of the wiring.
- A list of typically processed commands and the commanding cycle time.
- Some notes about the program structure or even program code extracts.
Please take care of the attached PDF below which holds the information above plus some extracts of the "EPOS4 Communication Guide".
Comments
0 comments
Article is closed for comments.