View unanswered posts | View active topics It is currently Thu Oct 23, 2014 6:09 am






Reply to topic  [ 5 posts ] 
Servos, arduino, robotc 
Author Message
Rookie
User avatar

Joined: Sat Jan 12, 2013 9:07 pm
Posts: 3
Post Servos, arduino, robotc
Hi guys. Robot noob here. I have an initial prob. I'm trying to build a version of the 50 dollar robot from societyofrobots.com with and arduino and programming with RobotC. I guess I'm doing a piecemeal version of things, but my intention is to eventually upgrade to a vex when I've gotten the hang of things.

My problem thus far is that I've modified some servos using these instructions.

http://www.flickr.com/photos/randomskk/2569969633/in/set-72157605559564231/

I downloaded a program telling the servos to go to [0]. I adjusted them to stop moving.

When I downloaded the sample continuous rotation program from robotc. They just spin in one direction and never stop or change direction. I tried powering with the arduino usb as well as with an external battery. They're a little stronger with the battery, but it doesn't make a difference.

Anyone have an idea if I have a servo or a programming problem?

Thanks everybody. :D

_________________
^^^^^^^^^^^^Hack of all trades.^^^^^^^^^^^


Sat Jan 12, 2013 9:24 pm
Profile
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 593
Post Re: Servos, arduino, robotc
Would you be able to upload your code using the [code] tags? This way we can take a look at the code and make sure it's not a code issue (when you send a servo a value of 0, you are actually telling it to move to one of its maximum positions; this may be while the servo keeps moving).

It may be an issue with the hardware mod as well, but we'll look at the code first and make sure it's not something program related.

_________________
Check out our Blog! And our Facebook page!
Need help? Take a look at our Wiki and our Forums.

I just met you,
And this is crazy,
But here's my code now,
So fix it, maybe?
~ Carly Rae Jepsen parody


Mon Jan 14, 2013 6:03 pm
Profile
Rookie
User avatar

Joined: Sat Jan 12, 2013 9:07 pm
Posts: 3
Post Re: Servos, arduino, robotc
This is what I did to modify the servos.

Code:
#pragma config(CircuitBoardType, typeCktBoardUNO)
#pragma config(Motor,  servo_9,          ,             tmotorServoContinuousRotation, openLoop, IOPins, dgtl9, None)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main()
{
   while(true)
{
   motor [servo_9] = 0;
  wait1Msec (2000);


}



}


This is the sample program I've been trying to test them.

Code:
#pragma config(CircuitBoardType, typeCktBoardUNO)
#pragma config(UART_Usage, UART0, uartSystemCommPort, baudRate200000, IOPins, dgtl1, dgtl0)
#pragma config(Motor,  servo_9,         servo1,        tmotorServoContinuousRotation, openLoop, IOPins, dgtl9, None)
#pragma config(Motor,  servo_10,        servo2,        tmotorServoContinuousRotation, openLoop, IOPins, dgtl10, None)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main()
{
  while(true)
  {
    motor[servo1] = -127;
    motor[servo2] = -127;
    wait1Msec(2000);

    motor[servo1] = 0;
    motor[servo2] = 0;
    wait1Msec(2000);

    motor[servo1] = 127;
    motor[servo2] = 127;
    wait1Msec(2000);

    motor[servo1] = 0;
    motor[servo2] = 0;
    wait1Msec(2000);
  }
}


Thanks. I'm a total noob to just about all of this except working with my hands so I'm kind of in the dark.

_________________
^^^^^^^^^^^^Hack of all trades.^^^^^^^^^^^


Mon Jan 14, 2013 9:44 pm
Profile
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 593
Post Re: Servos, arduino, robotc
I have verified the code on normal continuous rotation servos and it worked as intended; the problem may lie in the the mod to the servos themselves. It is a bit tricky to mod a normal servo for a continuous rotation and I generally don't recommend it as you can purchase one for around $15 and it eliminates much of the hassle involved.

_________________
Check out our Blog! And our Facebook page!
Need help? Take a look at our Wiki and our Forums.

I just met you,
And this is crazy,
But here's my code now,
So fix it, maybe?
~ Carly Rae Jepsen parody


Tue Jan 22, 2013 11:17 am
Profile
Rookie
User avatar

Joined: Sat Jan 12, 2013 9:07 pm
Posts: 3
Post Re: Servos, arduino, robotc
That was whatI was going to try next. I was hoping there was something besides buy more servos that would work. Haha. Oh well. I guess more shopping for me. Thank ye kindly.

_________________
^^^^^^^^^^^^Hack of all trades.^^^^^^^^^^^


Tue Jan 22, 2013 5:26 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


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

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.