How I reduce vibration when tracking

set the 'timed-out below smag' to very low.
it is becaus your smag is going to be close to 0 when you are directly on top of the cable.
Congratulation. What have you changed?
I just see that is 0... check your perimeter plots while tracking.
please also set the transition timeout to 10000.
Possible you don't have any transition for 2 sec
Now I remember the timed-out below smag has to be taken out of the code in robot.cpp for the STATE_PERI_TRACK:

Code:
if (perimeter.signalTimedOut(0))  {      
      if ( (stateCurr != STATE_OFF) && (stateCurr != STATE_MANUAL) && (stateCurr != STATE_STATION) 
      	&& (stateCurr != STATE_STATION_CHARGING) && (stateCurr != STATE_STATION_CHECK) 
      	&& (stateCurr != STATE_STATION_REV) && (stateCurr != STATE_STATION_ROLL) 
      	&& (stateCurr != STATE_STATION_FORW) && (stateCurr != STATE_REMOTE) && (stateCurr != STATE_PERI_OUT_FORW)
        && (stateCurr != STATE_PERI_OUT_REV) && (stateCurr != STATE_PERI_OUT_ROLL) && (stateCurr != STATE_PERI_TRACK)) {
        Console.println("Error: perimeter too far away");
        addErrorCounter(ERR_PERIMETER_TIMEOUT);
        setNextState(STATE_ERROR,0);

that should be on the 1st change list
 
perimeter plot

WP_20170605_20_39_11_Rich.jpg

Attachment: https://forum.ardumower.de/data/media/kunena/attachments/1183/WP_20170605_20_39_11_Rich.jpg/
 
Zuletzt bearbeitet von einem Moderator:
Are you using fixed perimeterMagMax?
Also very nice, if so I have to give a second try.
Try to replace the code I posted below in robot.cpp, to not get a timed-out condition. Your Mag and SMag are going to 0, which will cause an error.
 
@Alda
in the first page of the perimeter setting you have the 'timed-out below smag' try with value=50
Did you use the code on my last post ?
If yes you need to let the transition timeout to 2000, if too hight the mower lost the wire in angle and rotate non stop.
I take a look in the code to understand this error, maybe i forget Something.
 
Bernard schrieb:
@Alda
in the first page of the perimeter setting you have the 'timed-out below smag' try with value=50
Did you use the code on my last post ?
If yes you need to let the transition timeout to 2000, if too hight the mower lost the wire in angle and rotate non stop.
I take a look in the code to understand this error, maybe i forget Something.

YES I used your code from post 12516 and with modification from Holoratte post 12526 it's working. Hope this modification is what you forget :)
Value below smag I set to 0.
Still running with 1.0a6-Azurit . :)

Alex
 
Zuletzt bearbeitet von einem Moderator:
@Alda
Sorry i'am going to see that it's OK .
So don't forget to put the timeoutifbelowsmag to a correct value.
For the transitiontimeout i need to test one other change in the code to smooth in the angle but maybe you don't have angle >60Deg on your area.
I send you the change when i'am sure it's work .
By
 
Gentlemans, one more question on other point. You are using latest sw version, please how is measured motormowrpm ? I can't find it and also I can't find how is handled odometry with two wires (I see only one for left and one for right).
Thanks
Alex
 
@alda
I don't understand
latest sw version
.
For the motormowrpm you need to have a sensor on the mow motor, if yes why not.
Warning that the Mega need to use one interuption to compt so for me it's not useful and what to do with the result ?
odometry with two wires
maybee you want to say the twowayodometry, but it is the same think it's not in use in AZURIT
So only Onewayodometry is used and the only utility is to help the mower in forward mode to go in perfect straight line.
Thanks
 
I made the changes Alex tested written by Bernard and worked best for him and Bernard to the master Branch of my Fork .
Except the perimeterMagMaxValue is again measured during STATE_PERI_FIND.
This should give a sumary of today's work. TO BE TESTED!

Thank's for all the contributions

Enjoy weekend :)
Chris
 
I have followed your development of the tracking algorithm during the whole day - great work.
My Ardumower is now working in the 3rd season and i had acceptetd the oscillation during the perimeter tracking because i could not make it better.
Now i can see it can be done and i look forward to implement the code in my mower and make my mower garage smaller :) .
Thanks to all the contributers for the good work.

Regards
Wolfgang
 
Holoratte schrieb:
I made the changes Alex tested written by Bernard and worked best for him and Bernard to the master Branch of my Fork .
Except the perimeterMagMaxValue is again measured during STATE_PERI_FIND.
This should give a sumary of today's work. TO BE TESTED!

Thank's for all the contributions

Enjoy weekend :)
Chris

I will test when I'm back at home :)

Alex
 
Zuletzt bearbeitet von einem Moderator:
Bernard schrieb:
@alda
I don't understand
latest sw version
.
For the motormowrpm you need to have a sensor on the mow motor, if yes why not.
Warning that the Mega need to use one interuption to compt so for me it's not useful and what to do with the result ?
odometry with two wires
maybee you want to say the twowayodometry, but it is the same think it's not in use in AZURIT
So only Onewayodometry is used and the only utility is to help the mower in forward mode to go in perfect straight line.
Thanks

Last SW version :
I'm vorking with last release from here : https://github.com/Ardumower/ardumower/releases it's 1.0a6-Azurit
but if I will look here : https://github.com/Ardumower/ardumower/tree/master/code/ardumower it's very different version. For me is hard to find all differences to my version, but I also see a big differences in interrupt definitions and how they are handled.
It can be important when mega is used (somebody told me, that my code is more time consuming than new one)
Maybe better will be make a new thread to not mix it with "vibration when tracking".
Alex
 
Zuletzt bearbeitet von einem Moderator:
Be careful, in 1.07a you need to choose the board you are using. Default is the new V1.3 board. It is set in mower.h.
I am not sure if the pinout is any different!

Chris
 
I know, that's why I'm aking, becuase for me with my own board design it's more code changes.
But if there are some optimalisations, which release resources of mega, I can think about update.

Alex
 
So today no outside tests, Weather is very good for swimming but not god for law mowing :-(

Alex
 
@ Holoratte
this Week end i say to Alda
For the transitiontimeout i need to test one other change in the code to smooth in the angle but maybe you don't have angle >60Deg on your area.
I send you the change when i'am sure it's work .
and i test and it's OK on my DENNA.
This update is only when the transitionTimeout is called so when you have angle>60Deg in your perimeter wire.

Again you need to add a variable
in robot.h in perimeter section

Code:
float PeriCoeffAccel;


And make this change in robot.cpp

all the line with MaxSpeedperiPwm / 2 or MaxSpeedperiPwm / 1.5 need to have the same diviser
So if you want a fast tracking it's MaxSpeedperiPwm / 1.5 and soft is MaxSpeedperiPwm / 2
Normaly there is 8 lines with these values.


and in the slow return to wire replace


Code:
// here we have just found again the wire we need a slow return to let the pid temp react by decreasing its action (perimeterPID.y / 2)
  if ((millis() - lastTimeForgetWire ) < trackingPerimeterTransitionTimeOut / 1.5 ) {
    rightSpeedperi = max(0, min(MaxSpeedperiPwm, MaxSpeedperiPwm / 2 +  perimeterPID.y / 2));
    leftSpeedperi = max(0, min(MaxSpeedperiPwm, MaxSpeedperiPwm / 2 -  perimeterPID.y / 2));


By


Code:
if ((millis() - lastTimeForgetWire ) < trackingPerimeterTransitionTimeOut) {
    //PeriCoeffAccel move gently from 3 to 1 and so perimeterPID.y/PeriCoeffAccel increase during 3 secondes
    PeriCoeffAccel = (3000.00 - (millis() - lastTimeForgetWire))/1000.00 ;
    if (PeriCoeffAccel < 1.00) PeriCoeffAccel = 1.00;
    rightSpeedperi = max(0, min(MaxSpeedperiPwm, MaxSpeedperiPwm / 1.5 +  perimeterPID.y / PeriCoeffAccel));
    leftSpeedperi = max(0, min(MaxSpeedperiPwm, MaxSpeedperiPwm / 1.5 -  perimeterPID.y / PeriCoeffAccel));


I hope the PeriCoeffAccel = (3000.00 - (millis() - lastTimeForgetWire))/1000.00 compile correctly in the MEGA because sometime the result of calcul on Float and int is ???

So with this change you can set the PerimeterTimeout to a very low value if you want that your mower follow perfectly the wire

Here the result with this Timeout at 1000ms this mean that the mower never forget the wire more than 1 Seconde.
https://youtu.be/8sDKO0y0YKc
 
Just doing a test with the actual Github Version from Yesterday without the latest input from Bernard. Default settings of Azurit doing well ! Maybe P Value is little high. I will implement the changes of today and try again faster.
 
The test at pwm=220 is ok but when i go in pfod setting the result is bad so i think it's the limit for the DUE.
If you want i can post the video.
For me a good tracking is to have the /1.5 only on the fast tracking and /2 on the rest of the line and adjust the P value in PID.

But remenber If you use the mega maybe it's normal that you can't track the wire very fast and very precisely at the same time.
In the funny video at 255 there is no /2 or/1.5 it was the full maxspeed .

By
 
Oben