motor test

This commit is contained in:
Bernd Reuther 2021-03-05 15:26:18 +01:00
parent 090f2ed5d5
commit 0906d34cb6
3 changed files with 10 additions and 7 deletions

View File

@ -26,12 +26,15 @@ pi.write(pins_out['kamera']['nr'], 0)
m1 = motor('drehen', m1_a1, m1_b1, m1_a2, m1_b2, m1_t1, m1_t2, m1_te, m1_es, 1, 180) m1 = motor('drehen', m1_a1, m1_b1, m1_a2, m1_b2, m1_t1, m1_t2, m1_te, m1_es, 1, 180)
m2 = motor('kippen', m2_a1, m2_b1, m2_a2, m2_b2, m2_t1, m2_t2, m2_te, m2_es, 1, 90) m2 = motor('kippen', m2_a1, m2_b1, m2_a2, m2_b2, m2_t1, m2_t2, m2_te, m2_es, 1, 90)
m3 = motor('zoom', m3_a1, m3_b1, m3_a2, m3_b2, m3_t1, m3_t2, m3_te, m3_es, 0, 40)
m1.start() m1.start()
m2.start() m2.start()
m3.start()
m1.eichen() m1.eichen()
m2.eichen() m2.eichen()
m3.eichen()
m1.vorwaerts(100) m1.vorwaerts(100)
#m1.stop() #m1.stop()

View File

@ -1,16 +1,16 @@
freq = 800 freq = 800
freq_halten = 30000 freq_halten = 30000
cyc_halten = 20 cyc_halten = 40
pins_out = { pins_out = {
'kamera' : {'nr' : 2, 'name' : 'Relais, Kamera', 'state' : True}, 'kamera' : {'nr' : 2, 'name' : 'Relais, Kamera', 'state' : 1},
'encoder' : {'nr' : 3, 'name' : 'Relais, Encoder', 'state' : True} 'encoder' : {'nr' : 3, 'name' : 'Relais, Encoder', 'state' : 1}
} }
pins_in = { pins_in = {
'endschalter1' : {'nr' : 23, 'name' : 'Endschalter, Motor 1', 'state' : True}, 'endschalter1' : {'nr' : 23, 'name' : 'Endschalter, Motor 1', 'state' : 1},
'endschalter2' : {'nr' : 26, 'name' : 'Endschalter, Motor 2', 'state' : True}, 'endschalter2' : {'nr' : 26, 'name' : 'Endschalter, Motor 2', 'state' : 1},
'endschalter3' : {'nr' : 25, 'name' : 'Endschalter, Motor 3', 'state' : True} 'endschalter3' : {'nr' : 25, 'name' : 'Endschalter, Motor 3', 'state' : 1}
} }
m1_a1 = 17 m1_a1 = 17

View File

@ -175,7 +175,7 @@ class motor():
print(str(temp_schritte)) print(str(temp_schritte))
if temp_schritte > 0: if temp_schritte > 0:
self.vorwaerts(temp_schritte, 1) self.vorwaerts(temp_schritte)
else: else:
self.rueckwaerts(abs(temp_schritte)) self.rueckwaerts(abs(temp_schritte))