Skip to content

Conversation

@Svol0
Copy link
Contributor

@Svol0 Svol0 commented Jul 30, 2022

In case of continuously triggering the bumper sensor, e.g. sensor is mechanically stuck, the mower tries to avoid the supposed obstacle permanently.
The parameter BUMPER_MAX_TRIGGER_TIME in config.h sets the allowed continuously trigger time during movements in seconds. If trigger time exceeded, mower will stop with bumper error.
Set parameter to 0 (zero) to disable the monitoring of the bumper sensor.

@disaster123
Copy link

disaster123 commented Jul 30, 2022

good idea and good request - i made some notes - just my personal opinion - i'm not related to this project - just a user.

@greymfm
Copy link
Member

greymfm commented Jul 30, 2022

Nice implementation. How about creating a new general bumper class (like we do for battery, sonar, buzzer etc.) instead of changing Ardumower-specific driver/main code? Same as here btw: #44

@Svol0
Copy link
Contributor Author

Svol0 commented Jul 30, 2022

Thank you @disaster123. Comments to make the code better are always welcome to me. But unfortunately I can't find any notes from you on what I could improve in this pull request. I should perhaps also say that I am not yet 100% familiar with github. Please give me a hint how to find/see your notes.

@Svol0
Copy link
Contributor Author

Svol0 commented Jul 30, 2022

Having an own class for the bumper is a good idea. I will try to implement that. But if there are volunteers who would like to do that, I wouldn't be sad about it.

sunray/robot.cpp Outdated
if ((bumperStayActivTime) > (BUMPER_MAX_TRIGGER_TIME * 1000)){ // maximum trigger time reached -> set error
if (stateOp != OP_ERROR){
stateSensor = SENS_BUMPER;
CONSOLE.println("ERROR BUMPER BLOCKED");

This comment was marked as outdated.

Copy link
Contributor Author

@Svol0 Svol0 Jul 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like this?
CONSOLE.println("ERROR BUMPER BLOCKED - BUMPER_MAX_TRIGGER_TIME exceeded. See config.h for further information");

This comment was marked as outdated.

sunray/robot.cpp Outdated
}
}
} else bumperStayActivTime = 0;
lastCallBumperObstacle = millis();

This comment was marked as outdated.

#ifdef BNO055
#define MPU9250 // just to make mpu driver happy to compile something
#endif

This comment was marked as outdated.

@disaster123
Copy link

Thanks! Please remove the old commit and the revert to keep the branch clean.

@Svol0 Svol0 force-pushed the svol0-1.0.287_bumper-error-if-stays-triggered branch from 040c9b6 to f9c1491 Compare August 1, 2022 18:01
@Svol0
Copy link
Contributor Author

Svol0 commented Aug 1, 2022

Hello @disaster123,
google is my friend. First, I don’t know how to delete the commits, now I have a git cli installed and it seems I find the correct instructions.
Is it Ok like this?

@disaster123
Copy link

@greymfm looks good to me ;-) but your code and your design

own bumper class with BUMPER_TRIGGER_DELAY and
BUMPER_MAX_TRIGGER_TIME.

In case of continuously triggering the bumper sensor, e.g. sensor is mechanically stuck, the mower tries to avoid the supposed obstacle permanently.
The parameter BUMPER_MAX_TRIGGER_TIME in config.h sets the allowed continuously trigger time during movements in seconds. If trigger time exceeded, mower will stop with bumper error.
Set parameter to 0 (zero) to disable the monitoring of the bumper sensor.

The Parameter BUMPER_TRIGGER_DELAY adds a switch on delay, to suppress short triggers of the bumper. The value for the suppress time can be set in config.h in milliseconds.
@Svol0 Svol0 force-pushed the svol0-1.0.287_bumper-error-if-stays-triggered branch from f9c1491 to b23ed50 Compare August 1, 2022 19:43
@Svol0
Copy link
Contributor Author

Svol0 commented Aug 1, 2022

I updated the commit.
Hello @greymfm,
I left the reading of the bumper inputs in the driver file to stay compatible with the serial and sim driver. Hope this is not a problem. The output of both bumper inputs at sensortest without considering the BUMPER_TRIGGER_DELAY is also added.

@greymfm greymfm merged commit b378c20 into Ardumower:master Aug 10, 2022
@disaster123
Copy link

disaster123 commented Aug 15, 2022

@Svol0 / @greymfm i've some problems with the new bumper class - i'm not sure if this is the culprit:
" if ((abs(motor.linearSpeedSet) >= 0.05) || (abs(motor.angularSpeedSet) >= 0.05)) { // if no movement, bumperStayActivTime paused
"

i saw multiple times that the mower cycles around a pole (in my case two flagpoles). With the old code this never happens. In this case the mower cycles around the pole until the new obstacle error triggers. But it never goes into obstacle escape to reverse back from pole.

@disaster123
Copy link

in all of those cases - the bumper never triggers / gets never fired

@Svol0
Copy link
Contributor Author

Svol0 commented Aug 21, 2022

@disaster123
Sorry for my late answer. Didn’t saw your comment.
I have seen now, that the delay and permanent trigger features are disabled in the actual master.

When the mower hits the pole he tries to keep going forward without the reverse obstacle avoidance movement? And then he somehow struggles around the mast?
The mower only reverses when the bumper is triggered again?
Did I understand that correctly?

Can you please send me your config.h without IP addresses and passwords? Maybe there's a combination of bumper, sonar, and obstacle avoidance settings that I haven't tested yet.
Has the problem occurred with an ArduMower and/or Alfred?

Could you see/hear if the mowmotor stops at the first bumper trigger? Or do have a log from that event? Can you easily reproduce this error?

Best regards
Sven

@Svol0
Copy link
Contributor Author

Svol0 commented Aug 21, 2022

@disaster123, @greymfm
I have tested it today with a pole from the rotary clothes dreyer. I made a smale mow area around the pole and let the robot start mowing. In one case i had the situation that the mower tries to go on forward after hitting the pole. But this was because the pole was hit with the middle of the mower and the bumper was not trigged by the pole. The top cover of the mower was in contakt with the pole and the bumper was not pushed enough backwards to trigger it. Maybe this is what you have observed.
I will go on testing, but until now i was not able to create a scenario in which the bumper failed if he really was triggered.
I really appreciate any information in which situations the bumper software failed.

Best regards
Sven

@disaster123
Copy link

Sorry for the late reply. I've currently no free time to debug this depper but yes the bumper is pressed but the mower keep going forward. This is alfred so no sonar attached. config.h is the default one in the git repository.

There is no way to reproduce this easily. It just happens while mowing not excluded trees or pole.

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.

3 participants