User Tools

Site Tools


eeros_architecture:control_system:available_blocks:canopensend

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
eeros_architecture:control_system:available_blocks:canopensend [2024/05/27 17:18] ursgrafeeros_architecture:control_system:available_blocks:canopensend [2024/05/30 17:13] (current) ursgraf
Line 4: Line 4:
 [{{ :eeros_architecture:control_system:available_blocks:canopencontrolsystem.png?600 |//Control system for CANopen together with timeline// }}] [{{ :eeros_architecture:control_system:available_blocks:canopencontrolsystem.png?600 |//Control system for CANopen together with timeline// }}]
  
-The block for sending will periodically (given by its time domain) send a ''synq'' message followed by several PDO's. It is important that this block is run after the block for receiving CAN messages. This ensures that the drives can send their messages upen receiving the ''synq'' message and the receive block already has these messages in its receive buffer and does not block when running.+The block for sending will periodically (given by its time domain) send a ''synq'' message followed by several PDO's. It is important that this block is run after the block for receiving CAN messages. This ensures that the drives can send their messages upon receiving the ''synq'' message and the receive block already has these messages in its receive buffer and does not block when running.
  
-Each time the block is run by its time domain, a ''sync'' message is sent followed by RPDO1 (carrying the control word) and RPDO2 (velocity). While the control word can be set by the method+===== Data Transfer ===== 
 +Each time the block is run by its time domain, a ''sync'' message is sent followed by one or several RPDOs to all connected nodes. Each PDO carries one or more CANopen objects. See [[https://gitlab.ost.ch/tech/inf/public/canopenlib/-/blob/master/demo/demo.md#demo-1]] for the configuration of the PDOs. Make sure, that you send the RPDO exactly as your drive expects it. The //CANopen Send// block has several inputs as shown below. 
 +[{{ :eeros_architecture:control_system:available_blocks:canopensend.png?600 |//Signal Inputs// }}] 
 +Each drive has its own node id and its specific input index (0 to N-1). After the block has been created you have to configure the PDOs which are sent to each drive. While doing this you must specify which of the signal inputs (floating point or fixed point) get included into which PDO. Both signals can be vectors. The method 
 <code cpp> <code cpp>
-setCtrl(Matrix<nofNodes,1,uint16_t>);+configureRPDO(uint8_t nodeIduint8_t RPDOnrstd::vector<coObject_tobjs, std::vector<int8_t> idx)
 </code>  </code> 
-the velocity is taken from its input ''vel''\\ +includes a vector of all CANopen objects which are mapped into this RPDO together with a corresponding vector of indices. These indices determine which signal is taken for this RPDOTo give an example: idx=1 takes the floating point signal at index 0idx=2 takes the floating point signal at index 1, idx=0 takes the control word and idx=-1 takes the integer signal at index 0. 
-The velocity input expects a signal in SI unitse.g. rad/sTo account for encoder resolution of the actual drive together with a gearbox, it is possible to set scaling factor with+How could this be used? Let us assume, that the drive with node id = 37 should receive RPDO1 with control word and velocity setpoint and RPDO2 with digital output word (steering some enable pins or leds). Let's further assume that the floating point input signal is a vector consisting of position setpoint and velocity setpoint. The configuration would then be 
 <code cpp> <code cpp>
-setVelScale(Matrix<nofNodes,1,double>);+configureRPDO(37, RPDO1, {controlObj, velModeSetValObj}, {0,1}); 
 +configureRPDO(37RPDO2, {digOutStateObj}, {-1});
 </code>  </code> 
-This blocks uses the [[http://github.com/ntb-ch/canopenlib|canopenlib]]. The connection to the CAN bus must be first established through a [[eeros_architecture:control_system:available_blocks:canhandle|]] block.+ 
 +The control word has no input but can be set by the method 
 +<code cpp> 
 +setCtrl(uint8_t index, uint16_t ctrl>); 
 +</code>  
 + 
 +The floating point input signals expect signals in SI units, e.g. rad/s. To account for encoder resolution of the actual drive together with a gearbox, it is possible to set a scaling factor with 
 +<code cpp> 
 +setScale(Matrix<N,M,double>); 
 +</code>  
 + 
 +This blocks uses the [[https://gitlab.ost.ch/tech/inf/public/canopenlib|CANopen Library]]. Make sure to install this library following [[https://wiki.eeros.org/getting_started/install_wrapper#canopen|]].
eeros_architecture/control_system/available_blocks/canopensend.1716823092.txt.gz · Last modified: 2024/05/27 17:18 by ursgraf