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

NXTServo 8 channel and ev3dev-lang-demo #57

Closed
cho934 opened this issue Apr 23, 2015 · 9 comments
Closed

NXTServo 8 channel and ev3dev-lang-demo #57

cho934 opened this issue Apr 23, 2015 · 9 comments

Comments

@cho934
Copy link
Contributor

cho934 commented Apr 23, 2015

Hello,

Just to confirm before testing servomotors, should I connect NXTServo-V3 above (motor out port) or below (sensor in port) to the ev3brick, because it is notice to not connect to motor port (doing so may damage NXTServo-V3) ?

I tested using sensor port following this page http://www.ev3dev.org/docs/sensors/mindsensors.com-8-channel-servo-controller/

ev3dev-lang-demo recognized it writing:
(1) ms-8ch-servo (device ms-8ch-servo, port in1, mode V3)

but the value is only voltage ?

Choice: 1
*** ms-8ch-servo (V3) actions ***
(s)how modes
(c)hange mode
(v)alue
(m)onitor
(b)ack

Choice: v
value is 0.037 V

Can I move the servo using ev3dev-lang-demo ?

@dlech
Copy link
Member

dlech commented Apr 23, 2015

The ms-8ch-servo device in /sys/class/lego-sensors/ is the controller itself. And yes the only useful thing there is the battery voltage.

There should also be 8 devices in /sys/class/servo-motor/. These are are used to actually control the motors.

I don't know if the demo has anything implemented for the servo-motor class or not.

@cho934
Copy link
Contributor Author

cho934 commented Apr 23, 2015

I don't see anything.
Thanks for the quick answer. It works like a charm using /sys/class/servo-motor/

For information, we need to use 2 servos and try to finish to build our secondary robot this week-end. The French cup of robotic will occure in mid-May, and I will promote ev3dev ;)

@ddemidov
Copy link
Member

There is a servo motor test in ev3dev-lang-test.cpp. It does not do much, just dumps the motor's properties. Does it work for you?

@cho934
Copy link
Contributor Author

cho934 commented Apr 24, 2015

Yes, it works and it shows information about connected servomotors. I'm going to work now on our program in C++ using ev3dev.cpp and I will check if I can add a test to move servos in ev3dev-lang-demo.

@cho934
Copy link
Contributor Author

cho934 commented Apr 26, 2015

I did'nt succeed to drive several servos using ev3dev.h. The code from ev3dev-lang-test just detected only the first servo.
Have you got a small test to show me how to control several servos using ev3dev.h ?
For information, servos are working using shell command on /sys/class/servo-motor/.

@ddemidov
Copy link
Member

I don't have any experience with servo motors, but the code in the demo does not specify an output port to use. So its happy with the first servo motor it sees. Did you try to specify an output port, as in

m1 = servo_motor(OUTPUT_A);
m2 = servo_motor(OUTPUT_B);

?

@cho934
Copy link
Contributor Author

cho934 commented Apr 26, 2015

I use January version of ev3dev.
In fact, servo_motor() don't take OUTPUT_X, but the id (0 to 7) of the servo, but it doesn't work.

@dlech
Copy link
Member

dlech commented Apr 26, 2015

The argument for servo_motor is the port name. You can find the port name by reading the port_name attribute. It should be something like in1:mux1.

@cho934
Copy link
Contributor Author

cho934 commented Apr 27, 2015

It's working ! with in[ev3port_name 1-4]:sv[servo ID 1-8]
Example :

servo_motor m_;
m_ = servo_motor("in3:sv1");
m_.set_position(50);

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

3 participants