View unanswered posts | View active topics It is currently Tue Sep 02, 2014 4:22 pm






Reply to topic  [ 11 posts ] 
Finding the speed of RCX motor 
Author Message
Rookie

Joined: Fri Oct 28, 2011 11:50 am
Posts: 32
Post Finding the speed of RCX motor
I connected a Mindstorm NXT 2.0 brick to a RCX motor.

The robot cannot move straight as expected. I suspected the problem is due to the difference in motor power.

Does the RCX motor has PID as well?
How can I measure the difference in motor power?

More importantly, what's the best way to correct this problem?

Thanks in advance.


Mon Nov 14, 2011 8:54 am
Profile
Site Admin
Site Admin

Joined: Wed Jan 24, 2007 10:44 am
Posts: 439
Location: Pittsburgh, PA
Post Re: Finding the speed of RCX motor
Have you tried connecting encoders to the motors and creating a loop that checks to make sure the encoder values on both sides are staying relatively close?

_________________
Vu Nguyen
Software Training Development Team | Webmaster
Need more support? Use the ROBOTC Ticketing system

Robotc.net| Robomatter Store | Robotics Academy | CS2N


Mon Nov 14, 2011 9:26 am
Profile
Rookie

Joined: Fri Oct 28, 2011 11:50 am
Posts: 32
Post Re: Finding the speed of RCX motor
I tried using this program but got 0 for the encoder value. Pls help to point out any error.

#pragma config(Motor, motorB, motorB, tmotorNormal, PIDControl, encoder)
#pragma config(Motor, motorC, motorC, tmotorNormal, PIDControl, encoder)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//

task main()
{
nMotorEncoder[motorB] = 0;
nMotorEncoder[motorC] = 0;

ClearTimer(T1);

motor[motorB] = 80;
motor[motorC] = 80;

wait1Msec(5000);

motor[motorB] = 0;
motor[motorC] = 0;

int left_encoder = nMotorEncoder[motorB];
int right_encoder = nMotorEncoder[motorC];

writeDebugStreamLine("%d %d", left_encoder, right_encoder);
}


Mon Nov 14, 2011 9:32 am
Profile
Site Admin
Site Admin

Joined: Wed Jan 24, 2007 10:44 am
Posts: 439
Location: Pittsburgh, PA
Post Re: Finding the speed of RCX motor
Which encoders are you using? Did you connect the NXT motors to the same axles? Or are you using different encoders?

_________________
Vu Nguyen
Software Training Development Team | Webmaster
Need more support? Use the ROBOTC Ticketing system

Robotc.net| Robomatter Store | Robotics Academy | CS2N


Mon Nov 14, 2011 10:29 am
Profile
Rookie

Joined: Fri Oct 28, 2011 11:50 am
Posts: 32
Post Re: Finding the speed of RCX motor
I did not use NXT motor.

I connected a Mindstorm NXT 2.0 brick to 2 RCX motors.


Mon Nov 14, 2011 11:56 am
Profile
Senior Roboticist
User avatar

Joined: Wed Sep 28, 2011 10:13 pm
Posts: 630
Location: If I told you, I'd have to kill you.
Post Re: Finding the speed of RCX motor
RCX Motors don't have built in encoders. You would have to design a custom PID algorithm and use some sort of rotation sensor(i.e. RCX rotation sensor, sectioned black-and-white disk with light sensors, etc)

Why do you need to use RCX motors? It's much easier to just use NXT Motors if you want PID.

_________________
A.K.A. inxt-generation
Self-proclaimed genius, and future world dominator.
My Brickshelf Folder
"Don't they teach recreational mathematics anymore?" - The Tenth Doctor
Bow down to Nikola Tesla, King of the Geek Gods.


Mon Nov 14, 2011 2:34 pm
Profile WWW
Rookie

Joined: Fri Oct 28, 2011 11:50 am
Posts: 32
Post Re: Finding the speed of RCX motor
Because the RCX motor has a faster rpm than NXT and that allows my robot to run faster.

Anyway, short of a in build PID solution, I simply correct through the motor imbalance through trial and error by tweaking the motor power. Better than nothing.


Mon Nov 14, 2011 10:55 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3211
Location: Rotterdam, The Netherlands
Post Re: Finding the speed of RCX motor
What happens when the battery level gets less and motor A responds slightly differently to that than motor B?

You could also use an NXT motor and add some gears.

- Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Tue Nov 15, 2011 2:39 am
Profile WWW
Rookie

Joined: Fri Oct 28, 2011 11:50 am
Posts: 32
Post Re: Finding the speed of RCX motor
I might get different imbalance motor. My plan is to recompute the imbalance just before the actual action.

I have tried NXT motor but couldn't get my desired speed.


Tue Nov 15, 2011 8:43 am
Profile
Expert

Joined: Thu Sep 29, 2011 11:09 pm
Posts: 184
Location: Michigan USA
Post Re: Finding the speed of RCX motor
If this is all a speed matter, the NXT motors are 4 times as powerful. They are only 1/2 the speed, but even if you gear up 1:3, you should still get more power than RCX motors, with even more speed! The NXT motors also have encoders, so you can use PID control loops to drive straight.

_________________
Matt


Tue Nov 15, 2011 2:06 pm
Profile WWW
Rookie

Joined: Fri Oct 28, 2011 11:50 am
Posts: 32
Post Re: Finding the speed of RCX motor
Maybe I am wrong and lack of sufficient time to explore.

The thing is NXT motor is rather heavy and the robot can't move as fast as one constructed using RCX motor.


Wed Nov 16, 2011 2:53 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 11 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.