Sunray modding Spielwiese

Das mache ich ja aus eigeninteresse, und freut mich wenn andere das dann auch nutzen und es besser funktioniert.

Bei dir wäre die 319.6 interessant, denn ich habe obstaclerotation auch während einer obsacle avoidance funktion eingefügt. Vorher war es so, das obstaclerotation nur im mowOp abgefragt wurde, aber nicht während einer Obstacleavoidance operation wo er ein polygonhinderniss in der karte einfügt. (escapereverse with polygon)

Die ganzen obstacle avoidance funktionen sind leider sehr stumpf und eigentlich eines der größten probleme des sunray codes.
 
so, nun habe ich mit der 319.6 einige Daten zusammen.
Ich habe den Mowmotor händisch eingeschaltet und mittels Drehzahlmesser eine Drehzahl von exakt 3700 ermittelt.

Definiert ist folgendes:
#define MOWSPINUPTIME 20000
#define MOW_PWM 200
//... Mowmotor ticks per revolution:
#define MOTOR_MOW_TICKS_PER_REVOLUTION 12 /2 //ACT BLDC MOTOR from Shop = 6! (DRV8308/JYQD)


Code:
13:21:25.700 -> 0:22:56 ctlDur=0.02 op=Idle(initiatedByOperator 0) freem=230511 sp=200019AC bat=27.03,-0.004(0.85) chg=0.04,0(0.00) diff=-27.006 tg=0.00,0.00 x=2.90 y=-3.98 delta=-1.11 tow=472903400 lon=9.79847395 lat=53.41957592 h=57.4 n=0.00 e=0.00 d=0.00 sol=0 age=1376.30
13:21:29.349 -> checkmotorMowRPMStall: WARNING mow motor did not spun up to RPM set.
13:21:29.396 -> Increase SPINUPTIME or consider mow motor not reaching or overspinning specific RPM set by more than +- 150 RPM.
13:21:29.396 -> DATA: SPINUPTIME (ms), driverPWM, mowRPM, mowRPMSet, RPM difference: 20000, 255, 1057.20, 3000.00, 1942.80
13:21:30.190 ->
13:21:30.190 -> TUNING_LOG (disable in config.h):
13:21:30.237 -> ---------------------------------------------------->
13:21:30.237 -> motor.cpp: adaptive_speed() -- motorMowRpmSet: 3000.00 RPM, Batt: 27.01 V, mowMotorPower: 16.23 Watt
13:21:30.237 ->                                speedcurr: 0.00 m/s, Speedfactor: 1.00
13:21:30.237 ->
13:21:30.237 -> motor.cpp: sense()          -- mowPowerAct: 16.23 Watt, motorMowSense: 0.60 A, motorMowSenseLP: 0.68 A
13:21:30.284 ->                                motorLeftSense: 0.11 A, motorLeftSenseLP: 0.06 A
13:21:30.284 ->                                motorRightSense: 0.14 A, motorRightSenseLP: 0.13 A

Warum zeigt mir das Log eine driverPWM von 255 an?
Da die MowRPM auch nicht stimmt, müsste ich die MOTOR_MOW_TICKS_PER_REVOLUTION ändern, richtig?

Danke
Gruß Volker
 
Ja, also deshalb fährt er auch langsam. Der Motor gibt nicht mehr RPM her oder die ticks sind falsch. Du könntest mit dem Handy und einer entsprechenden App versuchen die RPM durch Sound herauszufinden, und dann die ticks entsprechend.

Oh Mist, hab gerade gelesen das du das ja schon gemacht hast ^^
Bei 255 habe ich auch ca. 3700 RPM. Also die ticks anpassen.
 
Hi Mr. Tree,

I tried you code and it uploaded fine but with the brushed motors nothing works. Is there any adaptation to get it to work with the brushed mowers and all your features?
 
Yes, I am working on a more fail safe config. Please post a log and the config.h. probably, you have a function turned on that needs rpm. The log should be with tuning log enabled and output_enabled false.

Beside, it won't work with all functions. But in some time it will and the escape_lawn Operations will use power of mow motor too instead of rpm
 
Here is the output with brushed motors
I turned off because it was giving me a repititive motor error before. Interestingly svolo's code needs the ENABLE_FAULT_DETECTION to be true to notice when the mower motor fails and then resets it.

#define ENABLE_FAULT_DETECTION false // use this if you keep getting 'motor error'
//#define ENABLE_RPM_FAULT_DETECTION true // use mowing rpm signal to detect a motor fault (requires mowing motor with rpm output!)
#define ENABLE_RPM_FAULT_DETECTION false // do not use mower rpm signal to detect a motor fault
// should the robot trigger obstacle avoidance on motor errors if motor recovery failed?
#define ENABLE_FAULT_OBSTACLE_AVOIDANCE false


enableCharging 0

ChargeOp: charging completed (DOCKING_STATION=1, battery.isDocked=0, dockOp.initiatedByOperator=1, maps.mowPointsIdx=0, DOCK_AUTO_START=0, dockOp.dockReasonRainTriggered=0, dockOp.dockReasonRainAutoStartTime(min remain)=0, timetable.mowingCompletedInCurrentTimeFrame=0, timetable.mowingAllowed=1, finishAndRestart=0)

CHARGER DISCONNECTED chgV=0.25 batV=27.81

ChargeOp::eek:nChargerDisconnected - retryTouchDock

traction motors enabled

ChargeOp: retryTouchDock failed

==> changeOp:Idle(initiatedByOperator 0)

OP_IDLE

IdleOp::begin switch off all motors

Motor::setMowState PWM OFFERROR: odometry error - rpm too low (left, right)=0.00,0.00

I wondering if it's something to do with the brushless drivers you have built into the code.

Maybe in this section?

// ----- gear motors --------------------------------------------------
// for brushless motors, study the sections (drivers, adapter, protection etc.) in the Wiki (https://wiki.ardumower.de/index.php?title=DIY_Brushless_Driver_Board)
#define MOTOR_DRIVER_BRUSHLESS 1 // uncomment this for new brushless motor drivers
//#define MOTOR_DRIVER_BRUSHLESS_MOW_DRV8308 1 // uncomment for brushless DRV8308 driver and mowing motor
//#define MOTOR_DRIVER_BRUSHLESS_MOW_A4931 1 // uncomment for brushless A3931 driver and mowing motor
//#define MOTOR_DRIVER_BRUSHLESS_MOW_BLDC8015A 1 // uncomment for brushless BLDC8015A driver and mowing motor
#define MOTOR_DRIVER_BRUSHLESS_MOW_JYQD 1 // uncomment for brushless JYQD driver and mowing motor (https://forum.ardumower.de/threads/jyqd-treiber-und-sunray.24811/)
//#define MOTOR_DRIVER_BRUSHLESS_MOW_OWL 1 // uncomment for brushless owlDrive mowing motor
#define MOTOR_DRIVER_BRUSHLESS_GEARS_DRV8308 1 // uncomment for brushless DRV8308 driver and gear/traction motors
//#define MOTOR_DRIVER_BRUSHLESS_GEARS_A4931 1 // uncomment for brushless A4931 driver and gear/traction motors
//#define MOTOR_DRIVER_BRUSHLESS_GEARS_BLDC8015A 1 // uncomment for brushless BLDC8015A driver and gear/traction motors
//#define MOTOR_DRIVER_BRUSHLESS_GEARS_JYQD 1 // uncomment for brushless JYQD driver and gears/traction motor
//#define MOTOR_DRIVER_BRUSHLESS_GEARS_OWL 1 // uncomment for brushless owlDrive gears/traction motor

Finally, if I were to convert the mower to brushless motors, should I source these from marotronics or is there somewhere else I can find the mowers and convertor modules?

Best,

Michael Fethe
 
Here is the output with brushed motors
I turned off because it was giving me a repetitive motor error before. Interestingly svolo's code needs the ENABLE_FAULT_DETECTION to be true to notice when the mower motor fails and then resets it.






I wondering if it's something to do with the brushless drivers you have built into the code.

Maybe in this section?



Finally, if I were to convert the mower to brushless motors, should I source these from marotronics or is there somewhere else I can find the mowers and convertor modules?

Best,

Michael Fethe
My last comment help up if running brushed motors you need to comment out the brushless motor section and that gets it working. Still need to test the mowing but atleast I'm able to get to start it now. Thanks for the solutions you've built.
 
Of course. You still need to configure your hardware. The motor driver defines and options is original sunray, I didn't put anything in there, besides mow motor PID and ticks.
 
So I uploaded the firmware and started charging as we are getting rain right now. The mower constantly moves while charging. Do you think this is the PID settings or is there anything else you can think of that would make the mower move slightly every few seconds.
 
Please read the tuningsection in config.h, also deactivate move_regulary and if it moves alone in the dock because the drivers switch off in dock then set this option to false too
 
Zuletzt bearbeitet:
@Horsi70

Du benötigst einen Raspi, z.b den Zero 2W --> am besten gleich mit ufl Antennenanschluss ... der nimmt wenig Leistung und ist klein
Du hast dann mehrere Optionen, ich schreibe jetzt wie ich es zum laufen bekommen habe, leider habe ich die ganzen Befehle dafür nicht mehr:

- das nackte Bullseye installieren, ohne Oberfläche .. ZERO stromversorgung erstmal an der steckdose
- Terminus auf dem PC und/oder Handy installieren
- Terminus HOST Konsolenverbindung anlegen und verbindung herstellen, ist dann auch auf deinem Handy falls du dir einen Terminusaccount anlegst
- Terminus SFTP Verbindung in Terminus zum ZERO anlegen
- Python 2 vom zero deinstallieren und python 3 installieren, updaten und dem zero erklären dass das jetzt sein python ist...
- arduino_reset.py aus dem github laden und mittels SFTP auf den ZERO schieben, einfach nach home
- kompilierte .bin vom sunraycode auf den Zero schieben, einfach nach home

- snippets in terminus anlegen:

Reset and Flash snippet
Code:
~/arduino_reset.py /dev/ttyACM0

sleep 2

bossac -i --port=/dev/ttyACM0 -U -i --offset=0x4000 -w ~/sunray.ino.grand_central_m4.bin -R

Arduino Console
Code:
stty 115200 -F /dev/ttyACM0 raw -echo
cat /dev/ttyACM0

- USB vom ZERO zum M4 Board herstellen
- Consolensnippet testen, wenn hier was kommt....
- Reset and flash snippet testen

Falls alles funktioniert:
- Festspannungsquelle 24V --> 5Volt besorgen und an P17 vom Mowerboard verbinden --> 5Volt Output dann als Versorgungsspannung für den ZERO
- Zero und Antenne deiner wahl einbauen
 
Super beschrieben Mr. Tree.
Im Thread "OTA flashen" hat @haham geschrieben, dass der Reset des M4 zum Abschalten vom P17 führt. Der Mower muss dann per Knopfdruck wieder gestartet werden. Besser wäre die Benutzung von P16, da hier der Effekt nicht auftritt und echtes OTA möglich wäre.
P16 hat allerdings keine Unterspannungsabschaltung.
Viele Grüße,
Jürgen
 
Hi,

wenn ich die 319.6 kompiliere, bekomme ich folgenden Fehler:
Code:
Arduino: 1.8.19 (Windows Store 1.8.57.0) (Windows 10), Board: "Adafruit Grand Central M4 (SAMD51), Enabled, 120 MHz (standard), Small (-Os) (standard), 50 MHz (standard), Arduino, Off"

rcmodel.cpp:11:1: error: invalid use of template-name 'RunningMedian' without an argument list

   11 | RunningMedian CHAN_1x_med = RunningMedian(3);

      | ^~~~~~~~~~~~~

Ich kompiliere mit der 1.8.19 IDE, die kann vielleicht C++17 nicht. Liegt es an meinen Einstellungen? Wie kompilierst Du das?

Viele Grüße,
Jürgen
 
Also, ich nehme den Mist demnächst raus... Bis dahin (zum x-ten mal ;) ) einfach die Bibliothek RunningMedian @ 0.3.7 installieren oder die rcmodel.cpp und .h mit der originalen ersetzen!
 
Hi,
na ja, bisher ging's ja. Ich sehe aber grad meine Bibliothek ist die 0.3.6. Nach update auf die 0.3.7 ändert sich der Fehler zu:
Code:
Arduino: 1.8.19 (Windows Store 1.8.57.0) (Windows 10), Board: "Adafruit Grand Central M4 (SAMD51), Enabled, 120 MHz (standard), Small (-Os) (standard), 50 MHz (standard), Arduino, Off"

In file included from C:\Users\GV9492\Box Sync\Ardumower\Sunray-master_follow_working - 319.6mod\Sunray-master\sunray\rcmodel.cpp:11:

RunningMedian.h:24:36: error: 'RunningMedian' is not a template

   24 | template <typename T, int N> class RunningMedian {

      |                                    ^~~~~~~~~~~~~

Ich stelle aber, nach einigem Rumprobieren, fest, dass es mit der IDE 2.3.2 geht. Ich war wieder zurück zur alten 1.8.19 IDE, Warum weiß ich aber nicht mehr.
Egal. Hauptsache geht.
 
Hmmm, seltsam. Im Zweifelsfall nimm erstmal die originalen Dateien. Das ist eh für meine futaba Funke. Demnächst schmeiß ich running median raus, ich wollte damit Funk Zucker eliminieren, Brauch man aber nicht wirklich.
 
@kaido hat mich quasi darauf hingewiesen dass die Logik für das MOVE_REGULARY für den DRVFIX verkehrt herrum ist. Meine Hinweise das auf false zu setzen
wenn man nicht will das er zyklisch abdockt waren also völlig daneben.
Das bedeutet:
MOVE_REGULARY = true ist also deaktiviert und MOVE_REGULARY = false ist aktiviert...

Ich muss später mal gucken was da los ist.

Sorry für die Verwirrung XD
 
Oben