Poulpe ethercat grpc server and client
This crate provides a grpc server and client for controlling the poulpe boards over ethercat.
The server creates the ethercat master and creates the gprc api that allows the connection of multiple clients corresponding to the number of poulpe boards connected to the ehtercat master.
Real-time communication
Client server communication in gprc is not real-time and given that we are controlling a real-time system, all the messages exchanged between the server and the client are timestamped and security checks are performed to ensure that the messages are not too old.
- If server reads the clients message that has a timestamp older than 5ms, it will ignore it
- If client reads the server messages that are older than 1second (defined in the configuration file), it will consider that the server is down and will kill the program
- If the feature
stop_client_on_server_timeout
is set the clients will stop their operation if the server is down
- If the feature
Safety features
This crate implements the following safety features:
- Make sure tha the real-time communication is established between the server and the client
- If the server is not responding, the client will stop the operation (if the feature
stop_client_on_server_timeout
is enabled) - All client messages that are older than 5ms are ignored by the server
- If the server is not responding, the client will stop the operation (if the feature
- Make sure that all the slaves are in the operational state
- If the slave is not operational, the server will not respond to the client messages
- Make sure that no actuators are in the error state
- If the actuator is in the error state, the server will display the error message
- It will send an emergency stop to all the actuators, if the feature
qucik_stop_on_slave_fault
is enabled - It will stop the operation of the server, if the feature
stop_server_on_actuator_error
is enabled
feature | description | enabled by default |
---|---|---|
stop_client_on_server_timeout | Stop the client if the server is not responding | yes |
qucik_stop_on_slave_fault | Send the emergency stop to all the actuators if one of them is in the error state | yes |
stop_server_on_actuator_error | Stop the server if one of the actuators is in the error state | no |
See the and configure the features in the Cargo.toml file.
Client-server communication
The server communicates with the ethercat master reading and writing the data to the poulpe boards.
The client sends the PoulpeCommand
message to the server and receives the PoulpeState
message from the server. PoulpeCommand
message contains
id
: id of the poulpe boardemergency_stop
: emergency stop flag (true for emergency stop)compliancy
: activate the board (true for active)mode_of_operation
: mode of operationtarget_position
: target positiontarget_velocity
: target velocitytarget_torque
: target torquevelocity_limit
: velocity limittorque_limit
: torque limitpublished_timestamp
: timestamp of the message (timestamp when the message was sent)
PoulpeState
message contains:
id
: id of the poulpe boardmode_of_operation
: mode of operationactual_position
: actual positionactual_velocity
: actual velocityactual_torque
: actual torqueaxis_sensors
: axis sensorsaxis_sensor_zeros
: axis sensor zerosboard_temperatures
: board temperaturesmotor_temperatures
: motor temperaturesrequested_target_position
: requested target positionrequested_velocity_limit
: requested velocity limitrequested_torque_limit
: requested torque limitstate
: state of the boarderror_codes
: error codescompliant
: compliant flagpublished_timestamp
: timestamp of the message (timestamp when the message was sent)