EasyManua.ls Logo

Moog SmartMotor - Page 847

Moog SmartMotor
909 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Part 3: Examples
Moog Animatics SmartMotor Developer's Guide,Rev. L
Page 847 of 909
NMT(0,128) GOSUB10 ' Network broadcast to go pre-operational state.
' Setup the sync producer/consumers and set timebase. Provides time sync so
' motor clocks keep in step, and data is transmitted/accepted on sync also.
SDOWR(mmm,x1006,0,4,10000) GOSUB10 ' define Cycle period object 0x1006:0,
' size 4, 10ms
SDOWR(eee,x1006,0,4,10000) GOSUB10 ' define Cycle period object 0x1006:0,
' size 4, 10ms
IF mmm!=fff
' If follow motor is not the master.
SDOWR(fff,x1006,0,4,10000) GOSUB10 ' define Cycle period object
' 0x1006:0, size 4, 10ms
ENDIF
SDOWR(mmm,x1005,0,4,128) GOSUB10 ' define Cycle ID x0000 0080 (required
' to avoid error in next line.)
SDOWR(mmm,x1005,0,4,1073741952) GOSUB10 ' define Cycle ID, producer
' x4000 0080
SDOWR(eee,x1005,0,4,128) GOSUB10 ' define Cycle ID, consumer x0000 0080
IF mmm!=fff
' If follow motor is not the master.
SDOWR(fff,x1005,0,4,128) GOSUB10 ' define Cycle ID, consumer x0000 0080
ENDIF
' Time sync
' Setup PDO mapping so that master transmits 32-bit actual position
' (0x6064), and follow motor receives as 32-bit encoder data (0x2208:3)
IF t==2
' We need to map a motor completely to get the position data.
SDOWR(eee,x1800,1,4,-1073741439) GOSUB10 ' set Transmit Com Parameter
' START xC000 0181
SDOWR(eee,x1800,2,1,1) GOSUB10 ' set Transmit Com Parameter
' on every Sync x000 0001
SDOWR(eee,x1A00,0,1,0) GOSUB10 ' set Transmit map number of
' entries x00
SDOWR(eee,x1A00,1,4,1617166368) GOSUB10 ' set Transmit map x6064 00 20
SDOWR(eee,x1A00,0,1,1) GOSUB10 ' set Transmit map number of
' entries x01
SDOWR(eee,x1800,1,4,1073742209) GOSUB10 ' set Transmit Com Parameter
' COB-ID x4000 0181
ELSEIF t==1
' Using an encoder. An encoder should have these mappings already.
' Comment these out if the encoder has read-only PDO parameters/mappings.
' Note PDO2 is used; it is default sync type in the encoder 406 profile.
SDOWR(eee,x1801,1,4,-1073741439) GOSUB10 ' set Transmit Com Parameter
' START xC000 0181
SDOWR(eee,x1801,2,1,1) GOSUB10 ' set Transmit Com Parameter
' on every Synch x000 0001
SDOWR(eee,x1A01,0,1,0) GOSUB10 ' set Transmit map number of
' entries x00
SDOWR(eee,x1A01,1,4,1617166368) GOSUB10 ' set Transmit map x6064 00 20
Part 3: Examples: CAN Bus - Time Sync Follow Encoder

Table of Contents

Related product manuals