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

Continuos rotation servo cannot control its position #752

Open
ZakharovAndrey1980 opened this issue Jul 20, 2020 · 1 comment
Open

Continuos rotation servo cannot control its position #752

ZakharovAndrey1980 opened this issue Jul 20, 2020 · 1 comment

Comments

@ZakharovAndrey1980
Copy link

  • ev3dev version: 4.14.117-ev3dev-2.3.4-ev3
  • ev3dev-lang-python version: INSERT ALL VERSIONS GIVEN BY dpkg-query -l {python3,micropython}-ev3dev*
    ii micropython-ev3dev2 2.0.0 all Python language bindings for ev3dev for MicroPython
    ii python3-ev3dev 1.2.0 all Python language bindings for ev3dev
    ii python3-ev3dev2 2.0.0 all Python language bindings for ev3dev

I am trying to control MG995 servo - it is continuous rotation hobby-type servo. All I do is

    self.shoulderMotor = ServoMotor('in4:i2c88:sv7')
    self.shoulderMotor.position_sp = -100
    self.shoulderMotor.run()

I expected the servo rotate counter-clockwise for some degrees and stop, but when executed the servo is starting to rotate and doesn't stop.
If I set position_sp=-20 then the servo rotates more slowly but doesn't stop as well.

Please advise, how could I make the servo rotate for say 90 and 180 degrees (approximately)

BTW, when I manually rotate the servo and read position_sp after that It shows -150 value. Could you please explain this.

Thanks!

@dlech
Copy link
Member

dlech commented Jul 20, 2020

That is the way continuous rotation servos work. You can only control the speed, not the position. They do not have any mechanism for position feedback.

To know the position, you will need an additional sensor such as limit switches or a rotary encoder.

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

2 participants