Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add dynamic motor control for mow motor and for moving motors #24

Merged
merged 8 commits into from
Oct 11, 2021

Conversation

felixganzer
Copy link
Contributor

Hi,

Ich habe im Quellcode die Möglichkeit hinzugefügt die Drehgeschwindigkeit des Mähmotors dynamisch an die Last (Current) des Mähmotors anzupassen.

Des Weiteren kann auch die Geschwindigkeit automatisch an die Last des Mähmotors angepasst werden.

Des Quellcode ist getestet und bei mir im Betrieb.

@felixganzer
Copy link
Contributor Author

ich habe ein paar kleine Fehler behoben und die Dokumentation in den config.h erweitert.

@stephwe
Copy link

stephwe commented Aug 3, 2021

Heute getestet mit # definiere USE_MOWMOTOR_CURRENT_AVERAGE true, funtioniert jetzt super.
Restlichen Werte alle auf Standard gelassen.
PCB1.3 mit brushed
Ab und an macht der Mover beim Beschleunigen einen leichten Satz, aber wirklich nur leicht.
Ansonsten regelt er bei hohem Gras sehr gut die Geschwindigkeit runter (ab ca. 0,9A laut App) und wenn das Gras wieder etwas weniger wird regelt er auch wieder sehr gut hoch.

@stephwe
Copy link

stephwe commented Aug 5, 2021

Nächster Test, heute mit etwas höherem Gras und # definiere USE_MOWMOTOR_CURRENT_AVERAGE false
Die restlichen Werte habe ich wieder unverändert gelassen.
Hat wieder alles super funktioniert, bei dem höheren Gras hat der Mähvorgang natürlich etwas länger gedauert. Auch heute wieder schön die Geschindigkeit bei hohem Gras runtergeregelt und hinterm haus, wo das Gras nicht so stark wächst, wieder auf volle Geschwindigkeit hochgeregelt.
Regelung fängt auch heute wieder bei ca. 0,9A laut App an, einzugreifen und zu drosseln, bei ca. 0,7A laut App wird die Geschwindigkeit wieder schrittweise erhöht.

@BEPK
Copy link

BEPK commented Aug 8, 2021

Ich habe alles wie hier hochgeladen getestet und es läuft bislang ohne Probleme:

  • Due
  • PCB 1.4
  • DC-Motoren (bürstenbehaftet)

Ein Softstart des Mähmotors wäre sicherlich noch sinnvoll - was meint Ihr?

Bevor wir es in dem Master übernehmen, wäre ein Test mit BLDC-Motoren wichtig. Hat das schon jmd. getestet?

@felixganzer
Copy link
Contributor Author

Ich habe noch einen Bug gefunden. Wenn man den Mower Manuell über die App steuert, spinnt er beim geradeaus fahren rum. Die Ursache muss ich noch suchen.

@BEPK
Copy link

BEPK commented Aug 8, 2021 via email

@stephwe
Copy link

stephwe commented Aug 14, 2021

Den Bug bei der manuellen Steuerung habe ich auch, allerdings nicht immer.
Ansonsten funktioniert alles sehr gut, viele Male mit den verschiedensten Einstellungen getestet.

@felixganzer
Copy link
Contributor Author

Ich habe den Fehler gefunden und bei mir schon behoben. Habe gleichzeitig noch einen Fehler gefunden, dass die Mähscheibe nicht mehr die Richtung wechselt, wenn der Motor anspringt.

Ich werde dieses Wochenende noch alles einmal testen und dann den commit aktualisieren.

bugfix mower speed at manual control of mower
@felixganzer
Copy link
Contributor Author

ich habe die aktuelle Version gepullt

@stephwe
Copy link

stephwe commented Aug 15, 2021

Wollte gerade testen ...
Beim kompilieren bekomme ich folgende Fehlermeldung:
Arduino: 1.8.13 (Windows 10), Board: "Adafruit Grand Central M4 (SAMD51), Enabled, 120 MHz (standard), Small (-Os) (standard), 50 MHz (standard), Arduino, Off"

'motorLeftRpmSetLast' was not declared in this scope; did you mean 'motorLeftRpmLast'?

@felixganzer
Copy link
Contributor Author

Ups.

Sowas passiert, wenn man code aufräumt und ihn nicht noch einmal testet. Und das auch noch schnell mal zwischendurch macht.

@stephwe
Copy link

stephwe commented Aug 20, 2021

Mittlerweile die Bugfixes mehrmals getestet und alles lief sauber, konnte bisher keine Fehler feststellen.
Ein wenig schwierig ist, die Leistungsanpassung des Mähmotors zu testen bzw. zu überwachen. Bei mitlaufender Konsolenausgabe sieht man aber das geregelt wird.

@fracii
Copy link

fracii commented Aug 22, 2021

I was tried for 2 weeks ago. Works good! Thx!

@greymfm
Copy link
Member

greymfm commented Aug 24, 2021

Excellent contribution! +1: I think we are very close to merging this into the Master :-) PS: Anyone tried it with brushless motors so far? :-)

@stephwe
Copy link

stephwe commented Aug 24, 2021

I only tried it in the test setup on a table with brushless motors + PCB1.4 and then checked in the serial monitor for a while.
As far as I could see everything was going there.

@stephwe
Copy link

stephwe commented Aug 29, 2021

Kleineres Problem, was ich festgestellt habe:
Ist die Regelung aktiv bzw. hat gegriffen und wechselt dann die Betriebsart von MOW z.B zu Dock durch den Regensensor, bleibt die runtergeregelte Geschwindigkeit bestehen. Er fährt dann dementsprechend sehr langsam zurück zur Ladestation.
Da fehlt irgendein reset der Leistungsmodulation.

@felixganzer
Copy link
Contributor Author

felixganzer commented Aug 31, 2021

Recht haste. Da ich noch keine Ladestation habe, habe ich nicht daran gedacht. Werde das am Wochenende implementieren.

@greymfm
Copy link
Member

greymfm commented Sep 1, 2021

Btw, is this code meant for everyone use? The code will produce a lot of CONSOLE messages, doesn't it? The motors are controlled 50 times a second (50 Hz) and there are a lot of CONSOLE messages in these frequent called motor control functions :-)

@felixganzer
Copy link
Contributor Author

Die consoleneinträge werde ich auch deaktivieren.

felixganzer and others added 2 commits September 4, 2021 15:07
@stephwe
Copy link

stephwe commented Sep 26, 2021

Konnte jetzt über 2 Wochen keiner Fehler feststellen, funktioniert zu 100% und wäre reif für den Master

@greymfm
Copy link
Member

greymfm commented Sep 26, 2021

Super. Ich teste morgen mal mit Brushless-Motoren :-)

@W1976
Copy link

W1976 commented Sep 29, 2021

Ich teste schon ein paar Tage mit Brushless Motoren. Einmal ist mir aufgefallen, das er losgefahren ist ohne das der Mähmotor lief. Ich hatte ihn da per Einschaltknopf gestartet. Ansonsten scheint es gut zu funktionieren. Mal sehen wie es diesen Freitag wird. Zuletzt habe ich am Montag mähen lassen.

@greymfm greymfm merged commit adcd986 into Ardumower:master Oct 11, 2021
@greymfm
Copy link
Member

greymfm commented Oct 12, 2021

merged and tested, if it can be deactivated (ENABLE_DYNAMIC_MOWMOTOR false, ENABLE_DYNAMIC_MOWER_SPEED false) - it seems the OFF-options are not 100% considered all the time, the robot is sporadically driving slowly for longer times? Any ideas? :-)

@greymfm
Copy link
Member

greymfm commented Oct 12, 2021

addendum: if you look at the lines in "speedPWM()" in motor.cpp, one is considering "ENABLE_DYNAMIC_MOWMOTOR", however "ENABLE_DYNAMIC_MOWER_SPEED" is not even mentioned in the motor.cpp code...? :-)

@greymfm
Copy link
Member

greymfm commented Oct 12, 2021

never mind- found the missing code (for ENABLE_DYNAMIC_MOWER_SPEED) and added it ;-)

@felixganzer
Copy link
Contributor Author

Danke. Hätte ich sonst heute abend gemacht. Hatte ich wohl vergessen.

This was referenced Oct 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants