Hardware connections


Connect CAN-H to CAN-H and CAN-L to CAN-L. A 120 Ω termination resistor must be installed between CAN-H and CAN-L on the CAN bus.



CAN Open configuration


Enable CANopen on both the drive and the magnetic sensor, and configure both devices with the same bit rate. Configure TPDO 1 of the MGS to transmit the tape position at the desired rate. A transmission interval of 10 ms is recommended, as the sensor does not update the tape position more frequently.


Motor Drive
MGS


The MGS will automatically transmit the following parameters through TPDO 1, using COB-ID 0x182:





Therefore, the motor drive's RPDO must be configured to receive COB-ID 0x182 and map the 4-byte left-track and right-track position data to a user variable, for example VAR 9.


To extract the left and right track data from the used var, a script like the following can be used:


option explicit

 

dim leftTrack as integer

dim rightTrack as integer

 

start:

 

leftTrack getvalue(_VAR,9and 0xFFFF

rightTrack = (getvalue(_VAR,9) >> 16and 0xFFFF

 

If leftTrack 100 then 'manipulate negative numbers

 

leftTrack leftTrack 65536

 

end if

 

 

if rightTrack 100 then 'manipulate negative numbers

 

rightTrack rightTrack 65536

 

end if

 

print(leftTrack,"\t",rightTrack,"\n")

 

wait(10'loop period is 10 ms

 

goto start