Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
|
public:recalbox [08.05.2018 09:55] se [Teileliste] |
public:recalbox [15.05.2018 09:31] (aktuell) se |
||
|---|---|---|---|
| Zeile 11: | Zeile 11: | ||
| * Welcher Emulator auf welcher Plattform: [[https:// | * Welcher Emulator auf welcher Plattform: [[https:// | ||
| \\ | \\ | ||
| - | :!: **Offene Punkte:** | ||
| - | * [[# | ||
| - | * Zweipunkt-Regelung läuft | ||
| - | * Pappmuster im Lego Gehäuse funktioniert gut | ||
| - | * Restarbeiten: | ||
| - | * < | ||
| - | * läuft 1A mit originalen PS3 Controller | ||
| ===== Teileliste ===== | ===== Teileliste ===== | ||
| Zeile 212: | Zeile 205: | ||
| \\ | \\ | ||
| Status: | Status: | ||
| - | * Aktive Kühlung für Raspi 3 nötig! (s.u.) | + | * 5 V Lüfter mit 3,3 Ohm Vorwiderstand |
| - | * Luftkanal | + | * Zweipunkt-Regelung über Python-Script |
| - | * {{:public:fanductv2raspi.png? | + | |
| - | * Lüfter an 5 V mit Vorwiderstand von ca. 27 - 51 Ohm | + | * {{:public:rpi_fan.jpg|}} |
| - | * warum nicht gleich [[https:// | + | * {{:public:rpi_fan_assembled.jpg|}} |
| - | * Testen -> Widerstand raus -> Vorteil: Nerfpegel per Software einstellbar | + | |
| - | * Temperaturgeregelt | + | |
| - | * [[https:// | + | |
| - | * umgebaut zum " | + | |
| - | * Temp_on = 75°C <- evtl. auf 80°C setzen | + | |
| - | * Temp_off = 60 °C | + | |
| * Beobachtungen: | * Beobachtungen: | ||
| * Kein wahrnehmbarer Unterschied zwischen "ohne Kühlung" | * Kein wahrnehmbarer Unterschied zwischen "ohne Kühlung" | ||
| Zeile 240: | Zeile 227: | ||
| < | < | ||
| mount -o remount rw, / | mount -o remount rw, / | ||
| - | / | + | cd / |
| + | </ | ||
| + | Dort eines der fan_ctrl...py scripte hinkopieren (pscp) oder neu anlegen und abtippen.\\ | ||
| + | Mit pscp (putty secure copy) wenn das script " | ||
| + | < | ||
| + | pscp d: | ||
| </ | </ | ||
| Zeile 301: | Zeile 293: | ||
| ==== Boot-Video austauschen ==== | ==== Boot-Video austauschen ==== | ||
| - | Im letzten | + | //**ALT!** -> aktuelle Versionen haben ein zufälliges Bootvideo.// |
| + | Im release (Stand 4.3.2018) wurde ein Weihnachts-Start-Video eingeführt. Etwas spät für Februar ...\\ | ||
| Infos aus dem [[https:// | Infos aus dem [[https:// | ||
| Als erstes das Filesystem umstellen, Standard ist read-only. Und die Animation löschen/ | Als erstes das Filesystem umstellen, Standard ist read-only. Und die Animation löschen/ | ||
| Zeile 318: | Zeile 311: | ||
| ===== Eigene Scripte ===== | ===== Eigene Scripte ===== | ||
| ==== Temperatur-Logging ==== | ==== Temperatur-Logging ==== | ||
| + | Dieses Script liest alle X (hier: 5) sekunden die CPU Temperatur aus und schreibt diese mit einem Zeitstempel in eine txt-Datei im csv Format. Bei Excel einfach über " | ||
| <file python temp_log.py> | <file python temp_log.py> | ||
| # Templogging Script | # Templogging Script | ||
| Zeile 355: | Zeile 349: | ||
| ==== Lüfterregelung ==== | ==== Lüfterregelung ==== | ||
| + | Die super einfache Zweipunkt-Regelung schaltet den Lüfter an Pin X bei überschreiten der Temperatur Y ein und bei unterschreiten der Temperatur Z wieder aus.\\ | ||
| + | Der Pin X schaltet natürlich einen Transistor durch, welcher den Lüfter schaltet... | ||
| + | |||
| <file python fan_ctrl.py> | <file python fan_ctrl.py> | ||
| # Fan bang-bang control | # Fan bang-bang control | ||
| Zeile 399: | Zeile 396: | ||
| </ | </ | ||
| + | |||
| + | ==== Lüfterregelung mit PWM==== | ||
| + | Gleicher Ablauf wie oben, jedoch kann die Lüftergeschwindigkeit im ON-Zustand über den Parameter " | ||
| + | Getestet: funktioniert prinzipiell, | ||
| + | |||
| + | <file python fan_ctrl_pwm.py> | ||
| + | # Fan bang-bang control with pwm | ||
| + | import os | ||
| + | import time | ||
| + | import RPi.GPIO as GPIO | ||
| + | |||
| + | # Settings | ||
| + | M_TIME = 5 # Measure time interval | ||
| + | ON_TEMP = 70 # upper temp value -> Fan turned on | ||
| + | OFF_TEMP = 60 # lower temp value -> Fan turned off | ||
| + | FAN_PIN = 14 # Transistor for the cooling fan is connected to pin 14 | ||
| + | PWM_F = 1000 # PWM frequency in kHz. Change only when fan makes fancy noises | ||
| + | DC = 50 # PWM duty cycle for the FAN (0 ... 100, where 100 is the maximum) | ||
| + | |||
| + | # setup GPIO | ||
| + | GPIO.setwarnings(False) | ||
| + | GPIO.setmode(GPIO.BCM) | ||
| + | GPIO.setup(FAN_PIN, | ||
| + | |||
| + | # Activate PWM on the FAN_PIN | ||
| + | p = GPIO.PWM(FAN_PIN, | ||
| + | |||
| + | # funtion for reading the cpu temperatur and return it as float | ||
| + | def getCPUtemp(): | ||
| + | res = os.popen(' | ||
| + | return (res.replace(" | ||
| + | |||
| + | # main loop for the bang-bang control | ||
| + | while True: | ||
| + | # get temperature | ||
| + | temp_float = float(getCPUtemp()) | ||
| + | |||
| + | try: | ||
| + | # if actual temp axceeded the upper value, turn fan on | ||
| + | if (temp_float > ON_TEMP): | ||
| + | p.start(DC) | ||
| + | # if actual temp drop below the lower value, turn fan off | ||
| + | elif (temp_float < OFF_TEMP): | ||
| + | p.stop() | ||
| + | |||
| + | except: | ||
| + | # for debugging | ||
| + | print " | ||
| + | |||
| + | # cycle time of the control. for temperature it dont have to be fast | ||
| + | time.sleep(M_TIME) | ||
| + | </ | ||