leroylights
Level-1
- Beiträge
- 2
- Reaktionspunkte
- 0
-> Hier kostenlos registrieren
Guten Tag,
ich probiere über Modbus TCP eine Dryve D1 zu steuern, dafür benutze ich die Software TouchDesigner und einen Python Skript der über TCP/IP befehle schicken und lesen kann. Bis jetzt bin ich in der Lage die State Machine durchzuführen, sowie den Homing. Es gelingt mir ebenso den Profile Velocity Mode zu benutzen, aber ich habe Probleme mit dem Profile Position Mode: die Fahrten werden leider nicht ausgeführt.
Vielleicht hat jemand von euch Erfahrungen mit der D1 über Modbus TCP sammeln können und hat eine Idee wie ich mein Problem lösen könnte!
Hier ist meine Homing Function:
def HomingD1 (self):
self.Set_mode(6)
#6092h_01h Feed constant Subindex 1 (Feed)
#Setzen des Vorschubs auf 360 (Grad)/U -> Gesetzte Geschwindigkeit entspricht hierdurch U/min; 360==36000 (Byte 19 = 140; Byte 20= 160)
tcpOp.sendBytes(bytearray([0, 0, 0, 0, 0, 15, 0, 43, 13, 1, 0, 0, 96, 146, 1, 0, 0, 0, 2, 140, 160]))
#6092h_02h Feed constant Subindex 2 (Shaft revolutions)
#Setzen der Wellenumdrehung auf 50; ReductionGearing (Byte 19 = 50)
tcpOp.sendBytes(bytearray([0, 0, 0, 0, 0, 14, 0, 43, 13, 1, 0, 0, 96, 146, 2, 0, 0, 0, 1, 50]))
# 6099h_01h Homing speeds Switch
#Vorgabe der Verfahrgeschwindigkeit beim Suchen auf den Schalter wird auf 60 U/min gesetzt (Byte 19 = 112; Byte 20 = 23))
tcpOp.sendBytes(bytearray([0, 0, 0, 0, 0, 15, 0, 43, 13, 1, 0, 0, 96, 153, 1, 0, 0, 0, 2, 112, 23]))
# 6099h_02h Homing speeds Zero
#Setzen Verfahrgeschwindigkeit beim Suchen von Null auf 60 U/min (Byte 19 = 112; Byte 20 = 23))
tcpOp.sendBytes(bytearray([0, 0, 0, 0, 0, 15, 0, 43, 13, 1, 0, 0, 96, 153, 2, 0, 0, 0, 2, 112, 23]))
# 609Ah Homing acceleration
#Setzen der Refernzfahrt-Beschleunigung wird auf 500 U/min² (Byte 19 = 80; Byte 20 = 195)
tcpOp.sendBytes(bytearray([0, 0, 0, 0, 0, 15, 0, 43, 13, 1, 0, 0, 96, 154, 0, 0, 0, 0, 2, 80, 195]))
# 6040h Controlword
#Start Homing
tcpOp.sendBytes(bytearray([0, 0, 0, 0, 0, 15, 0, 43, 13, 1, 0, 0, 96, 64, 0, 0, 0, 0, 2, 31, 0]))
#6040h Controlword
#resetStart
tcpOp.sendBytes(bytearray([0, 0, 0, 0, 0, 15, 0, 43, 13, 1, 0, 0, 96, 64, 0, 0, 0, 0, 2, 15, 0]))
und hier ist meine Profile Position Function:
def TargetModeD1 (self, setPosition0, setPosition1, setPosition2, setPosition3):
self.Set_mode(1)
op('ModeDisplay').run()
#6092h_01h Feed constant Subindex 1 (Feed)
#Setzen des Vorschubs auf 360 (Grad)/U -> Gesetzte Geschwindigkeit entspricht hierdurch U/min; 360 * 100 == 36000 (Byte 19 = 140; Byte 20= 160)
tcpOp.sendBytes(bytearray([0, 0, 0, 0, 0, 15, 0, 43, 13, 1, 0, 0, 96, 146, 1, 0, 0, 0, 2, 140, 160]))
#6092h_02h Feed constant Subindex 2 (Shaft revolutions)
#Setzen der Wellenumdrehung auf 50; ReductionGearing (Byte 19 = 50)
tcpOp.sendBytes(bytearray([0, 0, 0, 0, 0, 14, 0, 43, 13, 1, 0, 0, 96, 146, 2, 0, 0, 0, 1, 50]))
# 6081h Profile Velocity
#Setzen der Geschwindigkeit auf 60 U/min (Byte 19 = 112; Byte 20 = 23)
tcpOp.sendBytes(bytearray([0, 0, 0, 0, 0, 15, 0, 43, 13, 1, 0, 0, 96, 129, 0, 0, 0, 0, 2, 1, 10]))
# 6083h Profile Acceleration
#Setzen der Beschleunigung auf 500 U/min² (Byte 19 = 80; Byte 20 = 195)
tcpOp.sendBytes(bytearray([0, 0, 0, 0, 0, 15, 0, 43, 13, 1, 0, 0, 96, 131, 0, 0, 0, 0, 2, 80, 195]))
# 6084h Profile Deceleration
#Setzen der Beschleunigung auf 0 U/min² (Byte 19 = 0; Byte 20 = 0)
tcpOp.sendBytes(bytearray([0, 0, 0, 0, 0, 16, 0, 43, 13, 1, 0, 0, 96, 132, 0, 0, 0, 0, 3, 0, 80, 100]))
#607Ah Target Position
#Reset target position after each loop; the variables setPositionX are rewritten with the default value after each loop
tcpOp.sendBytes(bytearray([0, 0, 0, 0, 0, 17, 0, 43, 13, 1, 0, 0, 96, 122, 0, 0, 0, 0, 4, setPosition0, setPosition1, setPosition2, setPosition3]))
#Startbefehl zur Bewegung des Motors über Bit 4
#Set Bit 4 true to excecute the movoment of the motor
tcpOp.sendBytes(bytearray([0, 0, 0, 0, 0, 14, 0, 43, 13, 1, 0, 0, 96, 96, 0, 0, 0, 0, 1, 31]))
#self.Send(enableOperation)
#6040h Controlword
#resetStart
tcpOp.sendBytes(bytearray([0, 0, 0, 0, 0, 15, 0, 43, 13, 1, 0, 0, 96, 64, 0, 0, 0, 0, 2, 15, 0]))
Ich freue mich eure Meinungen dazu zu hören!
ich probiere über Modbus TCP eine Dryve D1 zu steuern, dafür benutze ich die Software TouchDesigner und einen Python Skript der über TCP/IP befehle schicken und lesen kann. Bis jetzt bin ich in der Lage die State Machine durchzuführen, sowie den Homing. Es gelingt mir ebenso den Profile Velocity Mode zu benutzen, aber ich habe Probleme mit dem Profile Position Mode: die Fahrten werden leider nicht ausgeführt.
Vielleicht hat jemand von euch Erfahrungen mit der D1 über Modbus TCP sammeln können und hat eine Idee wie ich mein Problem lösen könnte!
Hier ist meine Homing Function:
def HomingD1 (self):
self.Set_mode(6)
#6092h_01h Feed constant Subindex 1 (Feed)
#Setzen des Vorschubs auf 360 (Grad)/U -> Gesetzte Geschwindigkeit entspricht hierdurch U/min; 360==36000 (Byte 19 = 140; Byte 20= 160)
tcpOp.sendBytes(bytearray([0, 0, 0, 0, 0, 15, 0, 43, 13, 1, 0, 0, 96, 146, 1, 0, 0, 0, 2, 140, 160]))
#6092h_02h Feed constant Subindex 2 (Shaft revolutions)
#Setzen der Wellenumdrehung auf 50; ReductionGearing (Byte 19 = 50)
tcpOp.sendBytes(bytearray([0, 0, 0, 0, 0, 14, 0, 43, 13, 1, 0, 0, 96, 146, 2, 0, 0, 0, 1, 50]))
# 6099h_01h Homing speeds Switch
#Vorgabe der Verfahrgeschwindigkeit beim Suchen auf den Schalter wird auf 60 U/min gesetzt (Byte 19 = 112; Byte 20 = 23))
tcpOp.sendBytes(bytearray([0, 0, 0, 0, 0, 15, 0, 43, 13, 1, 0, 0, 96, 153, 1, 0, 0, 0, 2, 112, 23]))
# 6099h_02h Homing speeds Zero
#Setzen Verfahrgeschwindigkeit beim Suchen von Null auf 60 U/min (Byte 19 = 112; Byte 20 = 23))
tcpOp.sendBytes(bytearray([0, 0, 0, 0, 0, 15, 0, 43, 13, 1, 0, 0, 96, 153, 2, 0, 0, 0, 2, 112, 23]))
# 609Ah Homing acceleration
#Setzen der Refernzfahrt-Beschleunigung wird auf 500 U/min² (Byte 19 = 80; Byte 20 = 195)
tcpOp.sendBytes(bytearray([0, 0, 0, 0, 0, 15, 0, 43, 13, 1, 0, 0, 96, 154, 0, 0, 0, 0, 2, 80, 195]))
# 6040h Controlword
#Start Homing
tcpOp.sendBytes(bytearray([0, 0, 0, 0, 0, 15, 0, 43, 13, 1, 0, 0, 96, 64, 0, 0, 0, 0, 2, 31, 0]))
#6040h Controlword
#resetStart
tcpOp.sendBytes(bytearray([0, 0, 0, 0, 0, 15, 0, 43, 13, 1, 0, 0, 96, 64, 0, 0, 0, 0, 2, 15, 0]))
und hier ist meine Profile Position Function:
def TargetModeD1 (self, setPosition0, setPosition1, setPosition2, setPosition3):
self.Set_mode(1)
op('ModeDisplay').run()
#6092h_01h Feed constant Subindex 1 (Feed)
#Setzen des Vorschubs auf 360 (Grad)/U -> Gesetzte Geschwindigkeit entspricht hierdurch U/min; 360 * 100 == 36000 (Byte 19 = 140; Byte 20= 160)
tcpOp.sendBytes(bytearray([0, 0, 0, 0, 0, 15, 0, 43, 13, 1, 0, 0, 96, 146, 1, 0, 0, 0, 2, 140, 160]))
#6092h_02h Feed constant Subindex 2 (Shaft revolutions)
#Setzen der Wellenumdrehung auf 50; ReductionGearing (Byte 19 = 50)
tcpOp.sendBytes(bytearray([0, 0, 0, 0, 0, 14, 0, 43, 13, 1, 0, 0, 96, 146, 2, 0, 0, 0, 1, 50]))
# 6081h Profile Velocity
#Setzen der Geschwindigkeit auf 60 U/min (Byte 19 = 112; Byte 20 = 23)
tcpOp.sendBytes(bytearray([0, 0, 0, 0, 0, 15, 0, 43, 13, 1, 0, 0, 96, 129, 0, 0, 0, 0, 2, 1, 10]))
# 6083h Profile Acceleration
#Setzen der Beschleunigung auf 500 U/min² (Byte 19 = 80; Byte 20 = 195)
tcpOp.sendBytes(bytearray([0, 0, 0, 0, 0, 15, 0, 43, 13, 1, 0, 0, 96, 131, 0, 0, 0, 0, 2, 80, 195]))
# 6084h Profile Deceleration
#Setzen der Beschleunigung auf 0 U/min² (Byte 19 = 0; Byte 20 = 0)
tcpOp.sendBytes(bytearray([0, 0, 0, 0, 0, 16, 0, 43, 13, 1, 0, 0, 96, 132, 0, 0, 0, 0, 3, 0, 80, 100]))
#607Ah Target Position
#Reset target position after each loop; the variables setPositionX are rewritten with the default value after each loop
tcpOp.sendBytes(bytearray([0, 0, 0, 0, 0, 17, 0, 43, 13, 1, 0, 0, 96, 122, 0, 0, 0, 0, 4, setPosition0, setPosition1, setPosition2, setPosition3]))
#Startbefehl zur Bewegung des Motors über Bit 4
#Set Bit 4 true to excecute the movoment of the motor
tcpOp.sendBytes(bytearray([0, 0, 0, 0, 0, 14, 0, 43, 13, 1, 0, 0, 96, 96, 0, 0, 0, 0, 1, 31]))
#self.Send(enableOperation)
#6040h Controlword
#resetStart
tcpOp.sendBytes(bytearray([0, 0, 0, 0, 0, 15, 0, 43, 13, 1, 0, 0, 96, 64, 0, 0, 0, 0, 2, 15, 0]))
Ich freue mich eure Meinungen dazu zu hören!