Hi.
For the perimeter.
The main coil is the Left One ,so connect your coil to the P12 P.Left.
Into PFOD SETTING
into Perimeter set use to YES
Into Read 2 Coil set NO.
Save setting
Restart the mower.
For the Sonar .
Not tested with SR04 but normaly it's OK.
Maybe You need to adjust value:
Into robot.cpp near line 3940, you need to adjust the min max distance detection of your sonar..
For SR04 value 10 instead of 30 and 80 instead of 150 but you need to verify.
Don't forget into Pfod Sonar to activate and set the value for trigger.
For example if you set 45CM into trigger when the sonar detect object at 45CM it start to brake and stop at 0CM before reverse.
Also
If your sonar is directly on front of the mower into robot.cpp
Change the distance (25) value near line 2900:
If you find the correct working value do not hesitate to tell me so i can add test on the firmware.
IF PFOD can' t work you can change the value into mower.cpp but need upload sketch and a firmware reset.
Hope it's OK.
For the perimeter.
The main coil is the Left One ,so connect your coil to the P12 P.Left.
Into PFOD SETTING
into Perimeter set use to YES
Into Read 2 Coil set NO.
Save setting
Restart the mower.
For the Sonar .
Not tested with SR04 but normaly it's OK.
Maybe You need to adjust value:
Into robot.cpp near line 3940, you need to adjust the min max distance detection of your sonar..
For SR04 value 10 instead of 30 and 80 instead of 150 but you need to verify.
Don't forget into Pfod Sonar to activate and set the value for trigger.
For example if you set 45CM into trigger when the sonar detect object at 45CM it start to brake and stop at 0CM before reverse.
Code:
if (sonarDistCenter < 30 || sonarDistCenter > 150) sonarDistCenter = NO_ECHO; //need to be adjust if sonar is directly in front of mower 25Cm in my case
if (sonarDistRight < 30 || sonarDistRight > 150) sonarDistRight = NO_ECHO; // Object is too close to the sensor JSN SR04T can't read <20 CM . Sensor value is useless
if (sonarDistLeft < 30 || sonarDistLeft > 150) sonarDistLeft = NO_ECHO;
Also
If your sonar is directly on front of the mower into robot.cpp
Change the distance (25) value near line 2900:
Code:
case STATE_SONAR_TRIG: //in auto mode and forward slow down before stop and reverse different than stop because reduce speed during a long time and not immediatly
justChangeLaneDir = !justChangeLaneDir;
distToObstacle = distToObstacle - 25; // 25 cm is the distance between sonar and front of mower
UseAccelLeft = 0;
UseBrakeLeft = 1;
UseAccelRight = 0;
If you find the correct working value do not hesitate to tell me so i can add test on the firmware.
IF PFOD can' t work you can change the value into mower.cpp but need upload sketch and a firmware reset.
Hope it's OK.