Acting crazy...

petelake

New member
Hi,
When I do the motor test (->d ->1) and the odometrie (->d ->2) in the serial console, everything goes well. Wheels are turning like they should...
But, when I use the arduremote or the pfod, my robot acts crazy...
see video (and results in serial console) in attachement.
When I push "Mower is on" or "mower is off", in the arduremote, the mower motor (no odometrie) is acting normal.

I have:
PCB 1.3
Arduino DUE
Azurit 1.0a7
2 wheel motors from the Marotronics shop. (connected the black, green and blue wire, not the purple)

I did not do the workaround rev. 20150607 (with capacitor, ELKO and so...)

Is this an Arduremote problem?
Odometrie problem?
Azurit 1.0a7 problem?
Something else?

Arduremotekorter.mp4








Full video on: https://youtu.be/rO52XwTGe3g

Thanks for the help, greetz, Peter
 
Hi Peter
odometrie (->d ->2)
Please check in this menu that 1 full rev of the motor increase the ticks count by 1060.
Into manual redo the test with Odometry Use = NO so without the odometry.

If it's OK without Odometry and the Odometry work well 1060 Ticks / Rev you need to adjust the PID motor.

I explain:
In manual and if you have activate the Odometry the wheel rotation is controled in RPM and not PWM and use the Odometry and Pid to work well.

For the Battery :
Did the ADC Calibration is OK and did you use a DUE from marotronics or original one ?
I use a version with other ADC, so if the issue persist you can test it.

By.
 
Hi Bernard,

Console -> d (menu) -> 2 (odometrie) -> o (one revolution) => left=535 right=533, difference =2 ticks

(result this morning was: left=535 right=532)

So, this is less then 1060… (but just about the half… +/- 530 x 2 = 1060…???)

I have to say, when I build the PCB, I soldered on the back of the PCB the left marks of ODO Right and ODO Left (as seen on video 7 from the Ardumower-site)
(See picture from elektronikjogi)




I disabled Odometrie in the Arduremote app (Settings -> Odometry -> use NO -> Save settings)

Then I tried “manual” again in Arduremote => wheel motors responded ok

? Should I change values in Settings -> Odometry? (Like: Value l,r,0,0 or RPM_P 1.5, RPM_I 0.28 and RPM_D 0.25 or other values…)
(I don’t know the meaning of all those parameters… is there somewhere an explanation of the Arduremote?)


I also see at the bottom of Settings -> Odometry on the Arduremote: “Testing is OFF”…
When I push that, it goes to “testing is left motor forw” -> left wheel is turning ok…
When I push again, it goes to “testing is right motor forw -> right wheel is turning ok…

So, if I understand well, I have to do something about the ticks?... How?...
And maybe I have also something to do about the PID motor?... Where and how?... Is it explained in the wiki?...

(My wheel size is 80cm, distance between wheels 40cm)



For Battery:
I have an original DUE on the PCB (I have also a clone in my possession)
I am not sure about what to do for ADC calibration…
I see “ADC calibration” in the menu of Arduremote, but I did not connect the perimeter sender yet…
But I also see “ADC calibration” in the menu of the serial console (8= ADC calib (perimeter sender, charger must be off))…
I clicked both things… So is that ok then?... Are should I see or do something else?...
I do not find many explanation when I search for ADC (is that analogue-digital converter?...

Sorry if I am asking stupid questions and doing stupid things…
I am so far already, and I want to learn and succeed…

Thanks anyway, greetz, Peter

elektronikjogiIMG_120521.JPG

Attachment: https://forum.ardumower.de/data/media/kunena/attachments/1206/elektronikjogiIMG_120521.JPG/
 
Zuletzt bearbeitet von einem Moderator:
Hi Peter,

i just managed to get my PCB 1.3 working yesterday night - so i am more or less working with the same things as you at the moment, but do not have the same issues.
On the software side, i use the latest firmware from github - 1.0a10-dev

- Did you make the necessary changes in mower.cpp for your wheel diameter and wheel base?
- Have you disabled all sensors and options in mower.cpp - sonar, bumper, RC, drop, GPS, Wlan, perimeter etc.?
(You can also do it in Arduremote)
- Do you get exact one revolution, when you test it from the seriel monitor? Btw - i have the same no. of ticks (535) and the same odometry divider on the PCB

Regarding PID parameters, i would not change anything to start with, because you have the configuration from the shop. That always worked for me on the PCB 1.2 in the beginning and then you can fine tune later. Also for the PCB 1.3 it worked for me right out of the box.

...and one last question: where did you buy your wheels - they look god for rough terrain?

Regards
Wolfgang
 
Hi Peter.
For AZURIT 1.0a7:
So, this is less then 1060… (but just about the half… +/- 530 x 2 = 1060…???)
Sorry 530 or 535 is the correct value for AZURIT 1.0A7 with Diviser solder like tou do.
So the hardware odometry is perfect.
In software with arduremote you need to adjust this:
Ticks per cm.
wheel 80CM, i suppose it's the perimeter and not the diameter
if your wheel is 80CM perimeter it' mean that 535 Ticks=80CM so you need to put the value 6.68 into Ticks per cm.


So for Odometry:
Ticks per one full revolution=535
Ticks per cm=6.68
Wheel base cm=40

Now you don't have the same Wheel as Ardumower so maybe you need to adjust the PID and PWM and RPM for motor.

First you need to adjust into motor setting the max Pwm speed.
Deactivate the odometry and test in manual differents value to find a correct speed for the mower (maybe between 180 and 250).
When OK put again the odometry use to Yes.
and go into setting odometry to adjust the rpm and pid(not very easy to find perfect value)
First try with RPM_P=1 I=0.2 D=0 and change the value until you find a correct wheel working in manual forward (the behaviour is not the same if the Wheel are not on the floor)
(The default value are for the Wheel diameter of the ardumower Platform) so maybe you need to find your value.
Verify that the (RPM Motor l, r) actual value on left or right wheel is the setting one.
If you have set max PWM at 150 (low) for example and max RPM at 30(high) it's possible that the actual value for RPM never go over 20RPM so maybe you need to increase the PWM value.

Do not hesitate to put a video with the arduremote into odo setting and motor setting during the manual forward mode.

In all case remember that AZURIT 1.0a7 use odometry only to go in straight line on slope.
So maybe you can simply test your mower without Odometry and adjust the PID complex chapter later.


For the ADC calibration, simply follow the WIKI normaly no particular issue (arduremote and console do the same think)
Yes it's analog digital converter use on analog input of the DUE(eg battery voltage motor sense etc.....)

Hope it can help.
 
Hi Wolfgang,

Thank you for your respons...
I don't know how I missed this,... but I didn't know that I could change all the numbers in mower.cpp... stupid, I know...
Thank you for this info...
I think it gives one revolution, but check the answer of Bernard. I think the divider reduces the 1060 to +/- 530...
Concerning PID, I do not understand exactely and I don't find much information in wiki...

Concerning the wheels, they are from my old mower (Wiper one X = Ambrogio L300).
Was difficult to fix to the ax of the motors from the Marotronicsshop...
They also catch a lot of gras and sand and are difficult to clean...
The newer models of Ambrogio have more interesting wheels... (see picture)

greetz, Peter


download.jpg

Attachment: https://forum.ardumower.de/data/media/kunena/attachments/1206/download.jpg/
 
Zuletzt bearbeitet von einem Moderator:
Hi.
I can not find "speed max rpm"... not in Arduremot
Normaly into setting Odometry and there is also the PID.

Note that the change you made into mower.cpp are the factory setting so Nothing change until you do a factory setting.

When you power the DUE the mower.cpp are read and after the RTC eprom is read and replace the mower.cpp data.
So mower.cpp value are use only if you have issue with RTC eeprom or imediatly after a factory setting.

To change a value : simply adjust with Arduremote and do a save setting before power Off the mower.
On the next startup value are the new one..

To Adjust odometry setting:
Simply put the mower into grass and in manual mode and forward try diffrent value on the PID.

Into WIKI you can take a look on the PCB1.2 for more explanation.

What is exactly the diameter of your Wheel?

By.


.
 
Hi,
When I look in mower.cpp (Azurit 1.0a7), I only see (in motorAccel) parameters for left motor... Is this normal?...
See copy...

// ------- wheel motors -----------------------------
motorAccel = 1000; // motor wheel acceleration - only functional when odometry is not in use (warning: do not set too low)
#if defined (ROBOT_ARDUMOWER)
motorPowerMax = 75; // motor wheel max power (Watt)
motorSpeedMaxPwm = 255; // motor wheel max Pwm (8-bit PWM=255, 10-bit PWM=1023)
motorSpeedMaxRpm = 25; // motor wheel max RPM (WARNING: do not set too high, so there's still speed control when battery is low!)
motorLeftPID.Kp = 1.5; // motor wheel PID controller
motorLeftPID.Ki = 0.29;
motorLeftPID.Kd = 0.25;
motorZeroSettleTime = 3000 ; // how long (ms) to wait for motors to settle at zero speed
motorReverseTime = 1200; // max. reverse time (ms)
motorRollTimeMax = 1500; // max. roll time (ms)
motorRollTimeMin = 750; // min. roll time (ms) should be smaller than motorRollTimeMax
#else // ROBOT_MINI
motorPowerMax = 2.0; // motor wheel max power (Watt)
motorSpeedMaxPwm = 127; // motor wheel max Pwm (8-bit PWM=255, 10-bit PWM=1023)
motorSpeedMaxRpm = 50; // motor wheel max RPM (WARNING: do not set too high, so there's still speed control when battery is low!)
motorLeftPID.Kp = 0.2; // motor wheel PID controller
motorLeftPID.Ki = 0.0;
motorLeftPID.Kd = 0.0;
motorZeroSettleTime = 0 ; // how long (ms) to wait for motors to settle at zero speed
motorReverseTime = 2200; // max. reverse time (ms)
motorRollTimeMax = 2000; // max. roll time (ms)
motorRollTimeMin = 750; // min. roll time (ms) should be smaller than motorRollTimeMax
#endif
motorSenseRightScale = ADC2voltage(1)*1905; // ADC to right motor sense milliamp
motorSenseLeftScale = ADC2voltage(1)*1905; // ADC to left motor sense milliamp
motorPowerIgnoreTime = 2000; // time to ignore motor power (ms)
motorForwTimeMax = 80000; // max. forward time (ms) / timeout
motorBiDirSpeedRatio1 = 0.3; // bidir mow pattern speed ratio 1
motorBiDirSpeedRatio2 = 0.92; // bidir mow pattern speed ratio 2

motorRightSwapDir = 0; // inverse right motor direction?
motorLeftSwapDir = 0; // inverse left motor direction?

Could this be the problem?...

greetz, Peter
 
Hi.
The maxRPM is into setting Odometry and not setting Motor like in your picture B)
For the code left and right use same value see into motor.h
line 281 to 332 the motorcontrol function and 304 to 306 copy the left param to tight one.

So try to find the correct value into setting ODOMETRY .

If you can't find a correct value into PID i can send you an other version of azurit for Platform other than Ardumower.

By.
 
Sorry Bernard, you are right...
I found it in odometrie of Arduremote... :blush:
The value is 78...
changed it to 25 now...

But, still acting strange...

For example: with Arduremote manual...
forward (F) -> left wheel goes forward
Stop/reverse (R) -> no change
R-> right wheel backwards... after 10 sec also left wheel slowly backwards in litle steps (by 1 cm later by 5 cm..)
R-> wheels stop
F -> left wheel goes forward
R-> right wheel backwards... after 15 sec also left wheel verry slowly backwards in litle steps(by 1 cm later by 5 cm..)
R-> left wheel Forward????

If I shut down and restart,
I have sometimes the same pattern, sometimes the opposite or something different...

Do want a video to see?...

about the lines,304 to 306, do you mean I have to copy something???

For odometry, do I have to change the values of RMP_P (1.00), RPM_I (0.20) and RPM_D (0.00) at random? Like (0.10-5-4) or (5-0.40-0.20) and so on?...
There are thousands of combinations, and I have no reference or feeling to raise or lower one of these factors...

Or is this project just to difficult for me?... :unsure:

If you want, I can write in French too...

Thanks
 
Hi Peter.
What is the diameter of your Wheel ?
No problem in English, if it's easier for you in french we can use private message.
First the value 78 is not normal.:evil:
In precedent post you show the mower.cpp with :motorSpeedMaxRpm = 25; // motor wheel max RPM (WARNIN...
So normaly if you have loaded factory setting and don't change it into arduremote the result need to be 25 and not 78 ?????.

So first do again a factory setting, power off wait 10 sec power ON.
Go into arduremote into setting and check everywhere the value need to be exactly the same as mower.cpp.
If it's OK change only one value (for example RMP_P set to 1 instead of 1.5)
Do a save setting and power off.
On next power ON check that the value is again 1 and not 1.5
If all this is OK:

Yes you need to change the RMP_P (1.00), RPM_I (0.20) with other value ,you can do this while the mower is running and view the result immediatly.
First start with the P value and I after,The D value can stay at 0 for the moment.
With Odometry = NO i hope the mower work well ?
Did The value (into arduremote setting odometry) of odometry left and right change when the motor rotate ?

If again issue you can put a video on YouTube while the mower run in forward with the view of the Setting odometry.

For line 304 to 306 (and into all the code) don't change anything it's only to explain you that the right motor use the setting of the left one.

By.
 
Thank you Bernard,

At the moment, my battery is empty...
But, I see that it is empty very quick... (now, when I came back from shopping, after the testings of today: 15.1V, and, maybe the wheels were turning for 15 min in total today... )
I use the old battery of my Wiper one X mower...
I was charging now for 10 minutes and I mesure again: 27.1V...

Could't all the mistakes, crazy behaviour and batt_error, come from bad battery?


factory reset, via console or arduremote?

wheel diameter = +/- 25.5 cm ( 25.5 x л = +/- 80 cm circumference)

I did factory reset in console and in arduremote, just to be sure...

If I compare all valuas of mower.cpp and arduremote, I see:

In odometry, all values are the same, only:
in .cpp: motorLeftPID.Ki = 0.29 in arduremote it is 0.28
ticks per cm is wrong and wheel base too

In Motor, all values are the same...

With odometry = off, wheels are turning ok and "arduremote manual" works perfect.

with wheels turning forward (with arduremote manual), when I skip to odometry, i see the values l,r change and practicaly the same...

with odometry on, the same as in de first video...

Now, I left tick per one revolution on 530, and changed ticks per cm to 6.60 (530 ticks/80 cm = 6.625) and wheel base 40,00.

Still not good at all...

I also pushed acd calibration again on arduremote...

tommorow, I will play with the settings, one by one and show it to you.

For communications, for me French and English are the same. But I don't know for the forum what is best...

greetz, Peter
 
Hi.
Charge from 15 to 27 V in 10 Min = Certainly the battery is dead.
For the Factory reset you can use Arduremote.
Adc Calibration i don't think it's the problem (If bad calibration the perimeter or voltage and sense are false).
Maybe check the battery voltage when the wheel rotate (if not stable maybe the main problem).

All this is strange or maybe a bug into the 1.0a7 and the odometry.

I put into the ZIP a version using ODOMETRY and Without ADC Calibration and excel file with help on menu.
After upload the firmware you need to do a factory setting (from console at 115200bps use d and v to work) or from arduremote. and reboot.
Into setting Odometry put the real value tick per one revolution =1060, and change ticks per cm to 13.2
Do not forget to disable all the option you don't use.
Into arduremote in the main menu use the Test ODO to see if the 1rev is good etc... https://www.ardumower.de/index.php/...odometry-mouvement-control?limitstart=0#13796
Don' t hesitate to test the Dev 1.10 version on github.

And send video of the result(Bad or Good)
280418_2018-04-28.zip


By.
Attachment: https://forum.ardumower.de/data/media/kunena/attachments/3545/280418_2018-04-28.zip/
 
Zuletzt bearbeitet von einem Moderator:
Before I start...

I did this...

Odometry No
Test wheels forward to see Voltage on wires of battery... 26.3V -> 25.7V (stays stable for minutes).
question: I have a Velleman LABPS3005D 30V 5A power supply. Is it better to use that for power instead of the battery? (I will order the Marotronics battery pack and charger, or do you have a beter option?)
Eventually, What V and A do I choose on the Velleman?

Now..
If I open the ardumower.ino of the file you have sent, it opens with 9 lines of code.
I can use d or v in the console.
If I change the baudrate from 19200baud to 115200baud, I only see: ⸮⸮⸮⸮⸮......
Should I change the baudrate then?...

I understand I have to:

- do factory reset - save - shut of 10 sec - reboot robot
- disable all sensors and options I don't use... I think I have to do that in
mower.cpp, correct???
- save an reboot
- go to arduremote and change one revolution ticks to 1060 and ticks/cm to 13.2
- go to "test ODO"
- I think I have to do this with "Odomertry = ON"?

- If the result is not ok, I have to make video and try Dev 1.10

Am I right?

Thanks and greetz, Peter
 
Hi.
Sorry i didn't see your first post.
Now..
If I open the ardumower.ino of the file you have sent, it opens with 9 lines of code.
I can use d or v in the console.
If I change the baudrate from 19200baud to 115200baud, I only see: ⸮⸮⸮⸮⸮......
Should I change the baudrate then?...

9 lines of code ????
Download the ZIP file.
Into your downloads folder you need to find the zip.
Right click on it and unzip.
into the new unzipped folder double click on ardumower.ino and normaly it's open and you view a lot of sheet (ardumower,dht,Duetimer etc......)
Use Ctrl+R to check and Ctrl+U to upload into the DUE.

Into the console you can do this : (BUT IT'S BETTER TO USE ARDUREMOTE)
Use Ctrl+Shift+M to open the Serial monitor and in bottom right, choose 115200 Bps
Normaly the console return the starting page .
In the upper line put a 0 and enter to stop all.
Put V and enter to change the value you want to see.
Put D and enter to go into setting and 0 to close the setting page.
This need to work without particular issue.

For the other question all is OK except that you have Nothing to change into the Code or mower.cpp.

All the change are made with Arduremote.

Go into setting and factory setting and click on set factory Setting (require reboot).
After restart into setting Odometry put the 1060 etc.... (The Odometry is always ON into this firmware and you can't stop it)
And into motor the PWM RPM etc like in the link and test the 1 wheel rotation like in the precedent linked video.

Hope you can manage this.

By.
 
Oben