Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverse mower-motor direction doesn't work #53

Open
alexvaut opened this issue Aug 8, 2023 · 11 comments
Open

Reverse mower-motor direction doesn't work #53

alexvaut opened this issue Aug 8, 2023 · 11 comments

Comments

@alexvaut
Copy link

alexvaut commented Aug 8, 2023

Behavior:
sometimes it feels the robot is not mowing anything.

Test:
I made several tests where I enable/disable mowing and I change the direction

  1. (normal) rosservice call mower_service/mow_enabled 1 1
  2. (reverse) rosservice call mower_service/mow_enabled 1 0
  3. (stand-by) rosservice call mower_service/mow_enabled 0 0

Normal state 1 works very well, the motor is consuming close to 1A and the motor speed is quite high.
Reverse state 2 doesn't work well at all.

  • After a stand-by, it turns but very slowly and it's not making much sound.
  • After a normal state, motor is stopped.

The problem is coming from : #43

@alexvaut alexvaut changed the title Reverse mowing doesn't work Reverse mower-motor direction doesn't work Aug 8, 2023
@Apehaenger
Copy link
Collaborator

Switching the motor direction to opposite direction at full speed sound risky! (Did you also tried it with your car? ;-))

I guess you've tested with xESC2-mini (STM based ESC)?
Because: STM based xESC has much better over-current- protection.
In the case of xESC-2040 you may kill the MOSFETs on first try.

Please try again, but stopping before:

  1. (normal) rosservice call mower_service/mow_enabled 1 1
  2. (stop) rosservice call mower_service/mow_enabled 0 0 (and wait 2-3 seconds)
  3. (reverse) rosservice call mower_service/mow_enabled 1 0
  4. (stop) rosservice call mower_service/mow_enabled 0 0

@alexvaut
Copy link
Author

alexvaut commented Aug 8, 2023

This is what I tried at the beginning but I got the same results, it was always super slow on reverse. Note that I came to use the mower_service after the robot didn't mow. So if the electronic is fired somehow, it happens by the ros code.

@ClemensElflein
Copy link
Owner

Interesting, the mowing motor and the ESCs don't really have a "direction", so it's weird that it behaves differently when switching directions.

The ROS code can't fry electronics by itself, it just tells the motor controller "go at x% speed clockwise / anti-clockwise", both of which should be safe options to send. The speed controller does the actual switching of the MOSFETs.

Which robot and motor controllers are you using?

@alexvaut
Copy link
Author

alexvaut commented Aug 8, 2023

Original mower is a yardforce 500B and I received the full electronic kit 2 weeks ago.

@Apehaenger
Copy link
Collaborator

How's about checking if it's the ESC, by exchanging with one of your drive ESC's?
Probably more complicated as you need to load the mower-config to the drive ESC via VESC tool?!

In the case that you already assembled your mowers cover, you may temporary hardcode your working direction here (till you need to open it anyways):

mow_srv.request.mow_direction = started.sec & 0x1; // Randomize mower direction on second

via mow_srv.request.mow_direction = 1

@alexvaut
Copy link
Author

alexvaut commented Aug 8, 2023

@Apehaenger I never played with ESC yet. I'm currently testing that branch where I made the random direction configurable: 4ed8e79

@alexvaut
Copy link
Author

alexvaut commented Aug 14, 2023

I confirm it was a wrong ESC setup, the 3 ESC on the main board were configured the same when I received them. I didn't check. Now that the mower motor config has been configured on TTYAMA3, I realise that it's much more powerfull even in the "normal" direction ! And the reverse seems to work as well very well. But, I still recommend this PR to make it optional.

@Apehaenger
Copy link
Collaborator

Quite thanks for being that plain!!
Thought about it the last days, but couldn't imagine what's wrong with it.
Now I can kick it out of my brain ;-)

@michifischer
Copy link

I confirm it was a wrong ESC setup, the 3 ESC on the main board were configured the same when I received them. I didn't check. Now that the mower motor config has been configured on TTYAMA3, I realise that it's much more powerfull even in the "normal" direction ! And the reverse seems to work as well very well. But, I still recommend this PR to make it optional.

How did you check the configuration of the ESCs? Which config files did you use in the end and how did you update it?

@alexvaut
Copy link
Author

@michifischer I just use this doc: https://github.com/ClemensElflein/openmower.de/pull/26/files

@michifischer
Copy link

Thanks!

I got the upgrade kit last week, too. I can confirm that the configuration for the mower motor driver was not working well - you could barely hear the mower motor and the motor current did not exceed 250mA. The mowing result was not satisfying. After updating the mower motor config the mower works fine with a motor current of about 1A.

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

No branches or pull requests

4 participants