Move client foler
This commit is contained in:
parent
4c24717278
commit
c02cfcd71c
75 changed files with 0 additions and 329 deletions
64
docs/source/other/hardware.rst
Normal file
64
docs/source/other/hardware.rst
Normal file
|
@ -0,0 +1,64 @@
|
|||
.. _other_bardware:
|
||||
|
||||
Hardware
|
||||
########
|
||||
|
||||
Sensorarray
|
||||
***********
|
||||
|
||||
|SensorarrayImage|
|
||||
|
||||
.. |SensorarrayImage| image:: images/Sensorarray.png
|
||||
|
||||
Specs V4
|
||||
--------
|
||||
|
||||
| **Processor:** `STM32G030F6P6 <https://mou.sr/3UxW49B>`_ - 32-bit ARM Cortex M0 CPU @ 64 MHz
|
||||
| **I/O:** 1x I2C, 1x SWD
|
||||
| **Sensors:** 5x `QRE1113GR <https://mou.sr/3TWGYdI>`_
|
||||
|
||||
Specs V2
|
||||
--------
|
||||
|
||||
| **Processor:** `ATMEGA328P-AU <https://mou.sr/3FxhPC5>`_ - 8-bit CPU @ 16 MHz
|
||||
| **I/O:** 1x I2C, 1x UART, 1x ISP
|
||||
| **Sensors:** 5x `QRE1113GR <https://mou.sr/3TWGYdI>`_
|
||||
|
||||
Details
|
||||
-------
|
||||
|
||||
Das Sensorarray wird verwendet um Linienen vor dem Roboter zu erkennen. Es agiert als I2C Slave und muss dementsprechend aktiv gepollt werden.
|
||||
Zusätzlich besteht die möglichkeit alle Emitter zu deaktiviern um einen eventuellen Messfehler durch Sonneneinstralung oder andere Störquellen zu erkennen.
|
||||
|
||||
Version 4 unterscheidet sich zu Version 2 im Mikroprozessor, da es zu Lieferengpässen des ATMEGA gekommen ist.
|
||||
Zusätzlich wurde die möglichkeit alle Emitter einzeln an bzw. auszuschalten entfernt, da diese keinen signifikanten Mehrwert brachte.
|
||||
|
||||
Motorboard
|
||||
**********
|
||||
|
||||
|MainboardImage|
|
||||
|
||||
.. |MainboardImage| image:: images/Mainboard.png
|
||||
|
||||
Specs
|
||||
-----
|
||||
**Motor-Treiber:** `LV8548MC-AH <https://mou.sr/3TXbFzu>`_
|
||||
|
||||
Details
|
||||
-------
|
||||
Das Motorboard kann an einen der 4 Ports am Roboter angesteckt werden und ermöglicht das Ansteuern von Motoren und auslesen von Encodern.
|
||||
|
||||
Mainboard
|
||||
*********
|
||||
|
||||
Specs
|
||||
-----
|
||||
|
||||
| **Processor:** `STM32L051C8T6TR <https://mou.sr/3fuaAQv>`_ - 32-bit ARM Cortex M0 @ 32MHz
|
||||
| **I/O:** 4x I2C (3x Bus 1, 1x Bus 2), 1x 40 Pin GPIO Header, 2x SPI (Verbunden mit GPIO), 4x Motor-/Servo-connector, 1x SWD, 1x USB-C
|
||||
|
||||
Details
|
||||
-------
|
||||
|
||||
Das Mainboard wird auf den GPIO-Header eines Raspberry Pi gesteckt und ermöglicht die Steuerung eines Roboters mittels 4 Motor- bzw. Servo-Ports. Der RaspberryPi kommuniziert dabei mittels SPI mit dem Mainboard und steuert die einzelnen Sensoren oder Module an.
|
||||
Zusätzlich befinden sich auf der Unterseite des Mainboards Lötstellen, welche direkt mit der Stromversorgung der Motoren verbunden sind und geben so die möglichkeit Motoren mit mehr als 5V anzusteuern.
|
BIN
docs/source/other/images/Mainboard.png
Normal file
BIN
docs/source/other/images/Mainboard.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 278 KiB |
BIN
docs/source/other/images/Sensorarray.png
Normal file
BIN
docs/source/other/images/Sensorarray.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 254 KiB |
166
docs/source/other/usage.rst
Normal file
166
docs/source/other/usage.rst
Normal file
|
@ -0,0 +1,166 @@
|
|||
.. _other_usage:
|
||||
|
||||
Beispiele
|
||||
#########
|
||||
|
||||
Vorwärts und rückwärts fahren
|
||||
*****************************
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
import time
|
||||
from compLib.Motor import *
|
||||
|
||||
def forward():
|
||||
Motor.power(0, -30)
|
||||
Motor.power(3, 30)
|
||||
|
||||
|
||||
def backward():
|
||||
Motor.power(0, 30)
|
||||
Motor.power(3, -30)
|
||||
|
||||
def main():
|
||||
print("hallo ich bin ein roboter beep buup")
|
||||
|
||||
forward()
|
||||
time.sleep(1)
|
||||
backward()
|
||||
time.sleep(1)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
|
||||
Eine Linie verfolgen
|
||||
********************
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
import time
|
||||
from compLib.Motor import Motor
|
||||
from compLib.Encoder import Encoder
|
||||
from compLib.IRSensor import IRSensor
|
||||
|
||||
COLOR_BREAK = 850
|
||||
DRIVE_SPEED = 35
|
||||
|
||||
IRSensor.enable()
|
||||
|
||||
def drive(left, right):
|
||||
right *= -1
|
||||
Motor.multiple_power((0, right), (3, left))
|
||||
print(f"{left} {right}")
|
||||
|
||||
def follow():
|
||||
while True:
|
||||
sensors = IRSensor.read_all()
|
||||
|
||||
if sensors[0] > COLOR_BREAK:
|
||||
# turn left
|
||||
drive(-DRIVE_SPEED, DRIVE_SPEED)
|
||||
elif sensors[4] > COLOR_BREAK:
|
||||
# turn right
|
||||
drive(DRIVE_SPEED, -DRIVE_SPEED)
|
||||
else:
|
||||
# straight
|
||||
drive(DRIVE_SPEED, DRIVE_SPEED)
|
||||
|
||||
if sensors[0] > COLOR_BREAK and sensors[4] > COLOR_BREAK:
|
||||
break
|
||||
|
||||
drive(0, 0)
|
||||
time.sleep(1)
|
||||
|
||||
def main():
|
||||
follow()
|
||||
|
||||
drive(DRIVE_SPEED, DRIVE_SPEED)
|
||||
time.sleep(0.5)
|
||||
follow()
|
||||
|
||||
drive(DRIVE_SPEED, DRIVE_SPEED)
|
||||
time.sleep(0.5)
|
||||
follow()
|
||||
|
||||
drive(DRIVE_SPEED, DRIVE_SPEED)
|
||||
time.sleep(0.5)
|
||||
follow()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
Funktionalität des Roboters überprüfen
|
||||
**************************************
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
import time
|
||||
from compLib.Motor import Motor
|
||||
from compLib.Encoder import Encoder
|
||||
from compLib.IRSensor import IRSensor
|
||||
|
||||
|
||||
def testIR():
|
||||
print("Enabling Infrared Sensor")
|
||||
IRSensor.enable()
|
||||
time.sleep(1)
|
||||
|
||||
print("Writing sensor values...")
|
||||
for i in range(0, 50):
|
||||
print(IRSensor.read_all())
|
||||
time.sleep(0.1)
|
||||
|
||||
print("Disabling Infrared Sensor")
|
||||
IRSensor.disable()
|
||||
|
||||
def testEncoders():
|
||||
Motor.multiple_pulse_width((0, 50), (3, -50))
|
||||
|
||||
print("Writing encoder positions...")
|
||||
for i in range(0, 50):
|
||||
print(Encoder.read_all_positions())
|
||||
time.sleep(0.1)
|
||||
|
||||
time.sleep(2)
|
||||
print("Writing encoder velocities...")
|
||||
for i in range(0, 50):
|
||||
print(Encoder.read_all_velocities())
|
||||
time.sleep(0.1)
|
||||
|
||||
Motor.multiple_pulse_width((0, 0), (3, 0))
|
||||
|
||||
|
||||
def testMotors():
|
||||
print("Setting pulse_with")
|
||||
Motor.multiple_pulse_width((0, 50), (3, -50))
|
||||
time.sleep(3)
|
||||
|
||||
print("Setting power")
|
||||
Motor.multiple_power((0, 50), (3, -50))
|
||||
time.sleep(3)
|
||||
|
||||
print("Setting pulse_with")
|
||||
Motor.multiple_speed((0, 5), (3, -5))
|
||||
time.sleep(3)
|
||||
|
||||
for i in range(0, 100):
|
||||
Motor.multiple_power((0, i), (3, -i))
|
||||
time.sleep(0.1)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print("Make sure robot is turned on it's back!")
|
||||
time.sleep(5)
|
||||
|
||||
print()
|
||||
print("----------------- Testing Infrared Sensor -----------------")
|
||||
testIR()
|
||||
|
||||
print()
|
||||
print("----------------- Testing Encoder -----------------")
|
||||
testEncoders()
|
||||
|
||||
print()
|
||||
print("----------------- Testing Motors -----------------")
|
||||
testMotors()
|
Reference in a new issue