This is one of many iterations of my code that refuses to function on anyone's bot in my entire class. We're all using direct drive mantis with encoders. any input at all would be appreciated. Similar code worked once on my friends bot then never worked again. even with identical code.

What is the expected behavior? With your current code, if you started off with the servo turned to the zero position, when you press the touch sensor, it will turn the motor to the 200 position and then that's it. It will not move ever again. Try the following code, change it and play with it. You will learn how servo works.

If that's the case, there are two possibilities:1. The servo is not wired correctly.2. The servo is defective.

First, check the wiring. Make sure the servo controller is connected to the motor controller and then connected to the NXT sensor port 1. Also make sure both controllers have power (i.e. the red lights are ON). Also make sure the servo is connected to channel 1. If the wiring looks ok, you may want to plug in another servo in channel two and change the code to run the servo on channel two. If it is still not working, you may want to component test things separately to establish a working baseline. It means setting up another NXT brick with only the servo controller on sensor port 1, wire the servo controller with power, connect a servo in channel 1. Make sure the power switch is ON and run the program (make sure the program is changed to reflect only one servo controller). If that works, you have a working baseline. Then add a motor controller to the baseline configuration and test it again (change the code again to reflect one motor controller and one servo controller). If it is still working, you have a baseline that's equivalent to the robot and working. Then you replace the components on the robot with the components on the base line one at a time. First the servo, then the servo controller, then the motor controller and finally the brick. With this debug methodology, you should be able to pinpoint what's the culprit.

Wed Oct 30, 2013 12:14 pm

kevtastic

Rookie

Joined: Tue Oct 29, 2013 11:13 amPosts: 12

Re: Tetrix servos not working.

I hate to do this to you, but I went through each step and i had no luck. Another student in my class also went through each step with no luck.

Fri Nov 01, 2013 10:41 am

MHTS

Guru

Joined: Sun Nov 15, 2009 5:46 amPosts: 1523

Re: Tetrix servos not working.

Would you give me more info on what you did in each step and what was the result? "It doesn't work" doesn't give me any additional info.

Fri Nov 01, 2013 2:59 pm

kevtastic

Rookie

Joined: Tue Oct 29, 2013 11:13 amPosts: 12

Re: Tetrix servos not working.

well i checked the wiring:1. servo is connected2. red lights are on3. connected to channel 14. attempted channel 2 (no luck)5. attempted a baseline with no luck

In that picture, the servo plug appears to be plugged in backwards. I'm not sure if the servo has protection against such a scenario, but it could have fried your servo. While it's less likely, plugging the servo in backwards also may have damaged the HiTechnic servo controller (which is should be protected against).

_________________Matt

Mon Nov 04, 2013 2:52 pm

MHTS

Guru

Joined: Sun Nov 15, 2009 5:46 amPosts: 1523

Re: Tetrix servos not working.

Yes, your picture showed the servo is connected backward. The yellow wire should be closer to the "Chan. 1" label. BTW, just for your reference, the servo controller has a label at the bottom close to chan. 6 saying "YRB" which means "Yellow Red Black". That's the order the colored wires are supposed to be. If it still not working after correcting the servo wires, you may want to get a different servo controller in case it was somehow damaged. You may also try a different servo motor. In general, I don't believe plugging it backward will damage the servo controller because our students did that a few times and they survived. But who knows, anything could have happened.

Mon Nov 04, 2013 3:49 pm

kevtastic

Rookie

Joined: Tue Oct 29, 2013 11:13 amPosts: 12

Re: Tetrix servos not working.

So I doublechecked every aspect of the baseline and ran it again and it worked!

I then slowly tried integrating the parts on my bot until it stopped working to try and figure out the problem, and it just kept working. now I have replaced all of the baseline with my bot and it works perfectly. go figure. no clue what I changed. Thank you for your help my brothers, I would have been lost without ya.

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum