Driving the Onsala 20m via CANopen

Introduction

The old control system used GBV 5410 amplifiers and KSY 548.30-1 motors (0.51 Nm/A) to drive the antenna via an analog output signal in the range of ±5000 DAC units from the digital control loop. The DAC signal yields a voltage ±10V at 16bit resolution (i.e. 10V/32768). The amplifier produces 6A per 5V.

The new system uses DSM 4-11.1 motors from SAD GmbH with a rated current of 4.9A and rated torque of 3.7Nm (i.e. 0.7551 Nm/A). They are driven by tendo DD4 servo amplifers from Mayr GmbH (now Pilz). The current output from the amplifiers is (rated current)*(setpoint/1640). We get

(new setpoint) = (old DAC unit)*(10.0V/32768)*(6A/5V)*(0.51Nm/A)*(4.9A/3.7Nm)*(1640/4.9A)
	       = (old DAC unit)*0.0828

The four amplifiers in azimuth and elevation are connected via CANbus as nodes 10-13 and 14-17, respectively, to our VMEbus crate running ELinOS. The VMEbus system is equipped with a M65 CANbus interface from MEN GmbH and the corresponding CANopen Driver Interface System (MDIS4) for M65/P5. The M65 module has one single CANbus port. The master (VMEbus) is supposed to be node 1 on the bus. The baudrate used is 500 kb/s.

The amplifiers need to be configured once with correct node numbers and a rated current of 4.9A and max current of 9.8A through a PC based configuration utility.

In the following we'll use xx for the (hex code) for the slave node (0x0a - 0x11) and n is the number of the slave (0-7). The following PDO setup is to be used:

  • TPDO n on master ↔ RPDO 1 on slave n to set control word on amplifier(s)
  • TPDO n+8 on master ↔ RPDO 2 on slave n to set setpoint in digital current mode
  • RPDO n on master ↔ TPDO 1 on slave n to read status word of amplifier(s)

RPDO 1 for the control word is already set up by default: cobId 0x200+xx, 16 bit word at index 0x6040. Also, TPDO 1 on the slaves is ready to be used (cobId 0x180+xx, 16 bit word at index 0x6041). PDO 32 on the slaves is what we need as RPDO 2 for the setpoint (cobId 0x300+xx, 32 bit word at index 0x2060):

  • SDO write to node: index 0x2601, sub 0, 1 byte: 32 (dec) (to select PDO 32 as RPDO 2)

In addition the following configuration is required on each slave during startup or error recovery.

  • SDO write to node: index 0x6040, sub 0, 1 byte: 0x80 (to clear error conditions)
  • SDO write to node: index 0x6040, sub 0, 1 byte: 0x0F (to enable and activate)
  • SDO write to node: index 0x6060, sub 0, 1 byte: 0xFD (to configure digital current mode)

To set up the corresponding PDOs on the master we do the following (for each node):

  • SDO write to master: index 0x1400+n, sub 1, 4 bytes: 0x80000000 (reset of RPDO node)
  • SDO write to master: index 0x1800+n, sub 1, 4 bytes: 0x80000000 (reset of TPDO node)
  • SDO write to master: index 0x1808+n, sub 1, 4 bytes: 0x80000000 (reset of TPDO node + 8)

Now, we are ready to configure the cobId's of our slave nodes:

  • SDO write to master: index 0x1400+n, sub 1, 4 bytes: 0x180+xx (TPDO 1 cobId of node)
  • SDO write to master: index 0x1800+n, sub 1, 4 bytes: 0x200+xx (RPDO 1 cobId of node)
  • SDO write to master: index 0x1808+n, sub 1, 4 bytes: 0x300+xx (RPDO 2 cobId of node)

We need a mapping into the process image of the master, so that we can access inputs and outputs from our C application (loop.c):

  • map TPDO n to index 0x6100 (16 bit output, control word)
  • map TPDO n+8 to index 0x6120 (32 bit output, setpoint)
  • map RPDO n to index 0x6300 (16 bit input, status word)

Finally, we start monitoring of the slaves by the master:

  • SDO write to master: index 0x1f80, sub 0, 4 bytes: 0x00000001 (enable NMT master)
  • SDO write to master: index 0x1f81, sub xx, 4 bytes: 0x00000001 (assign slave, for each node!)
  • SDO write to master: index 0x1f82, sub 128, 1 byte: 5 (put all slaves into operational state)

Resulting PDO setup on slaves and master

Slave setup        
Index Sub Value Description Comment
0x2600     selection RPDO 1
  0 1 receive control word default setup
0x1400     communication parameter  
  1 0x200 + xx cobId default setup
0x1600     mapping parameter  
  1 0x6040 00 10 index 0x6040, sub 0, 16 bit default setup
0x2601     selection RPDO 2
  0 32 receive setpoint requires configuration
0x1401     communication parameter  
  1 0x300 + xx cobId default setup
0x1601     mapping parameter  
  1 0x2060 00 20 index 0x2060, sub 0, 32 bit default setup
0x2a00     selection TPDO 1
  0 1 send status word default setup
0x1800     communication parameter  
  1 0x180 + xx cobId default setup
0x1a00     mapping parameter  
  1 0x6041 00 10 index 0x6041, sub 0, 16 bit default setup
Master setup        
Index Sub Value Description Comment
      send control word TPDO 1-8
0x1800 + n     communication parameter  
  1 0x200 + xx cobId requires configuration
0x1a00 + n     mapping parameter  
  1 0x6100 n 10 index 0x6100, sub n, 16 bit requires configuration
      send setpoint TPDO 9-16
0x1808 + n     communication parameter  
  1 0x300 + xx cobId requires configuration
0x1a08 + n     mapping parameter  
  1 0x6120 n+8 20 index 0x6120, sub n+8, 32 bit requires configuration
      receive status word RPDO 1-8
0x1400 + n     communication parameter  
  1 0x180 + xx cobId requires configuration
0x1600 + n     mapping parameter  
  1 0x6300 n 10 index 0x6300, sub n, 16 bit requires configuration