View unanswered posts | View active topics It is currently Sun May 01, 2016 8:46 am

 Page 1 of 1 [ 11 posts ]
 Print view Previous topic | Next topic
Finding the speed of RCX motor
Author Message
Rookie

Joined: Fri Oct 28, 2011 11:50 am
Posts: 32
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?

Mon Nov 14, 2011 8:54 am

Joined: Wed Jan 24, 2007 10:44 am
Posts: 441
Location: Pittsburgh, PA
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? Email ROBOTC Support at support@robotc.net to put in a support ticket

Robotc.net| Robomatter Store | Robotics Academy | CS2N

Mon Nov 14, 2011 9:26 am
Rookie

Joined: Fri Oct 28, 2011 11:50 am
Posts: 32
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 !!*//

{
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

Joined: Wed Jan 24, 2007 10:44 am
Posts: 441
Location: Pittsburgh, PA
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? Email ROBOTC Support at support@robotc.net to put in a support ticket

Robotc.net| Robomatter Store | Robotics Academy | CS2N

Mon Nov 14, 2011 10:29 am
Rookie

Joined: Fri Oct 28, 2011 11:50 am
Posts: 32
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
Senior Roboticist

Joined: Wed Sep 28, 2011 10:13 pm
Posts: 630
Location: If I told you, I'd have to kill you.
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
Rookie

Joined: Fri Oct 28, 2011 11:50 am
Posts: 32
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

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
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
Rookie

Joined: Fri Oct 28, 2011 11:50 am
Posts: 32
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
Expert

Joined: Thu Sep 29, 2011 11:09 pm
Posts: 184
Location: Michigan USA
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
Rookie

Joined: Fri Oct 28, 2011 11:50 am
Posts: 32
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
Display posts from previous:  Sort by
 Page 1 of 1 [ 11 posts ]

#### Who is online

Users browsing this forum: No registered users and 1 guest

 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

Search for:
 Jump to:  Select a forum ------------------ ROBOTC Applications    ROBOTC for LEGO MINDSTORMS       Third-party sensors    ROBOTC for CORTEX & PIC    ROBOTC for VEX IQ    ROBOTC for Arduino    Robot Virtual Worlds    Multi-Robot Communications    Issues and Bugs Competitions & Partners    Mini Urban Challenge    CS2N Robot Virtual Worlds Competitions       VEX Skyrise Competition 2014-2015       VEX Toss Up 2013-2014       FTC Block Party! 2013-2014    Competitions using VEX - BEST, TSA, VEX, and RoboFest!    FTC Programming    RoboCup Junior and Other ROBOT Competitions Virtual Brick Robotics Discussions    General Discussions    Project Discussions Off-Topic ROBOTC Forum & ROBOTC.net Suggestions/Feedback    ROBOTC Forums Suggestions/Comments    ROBOTC.net Suggestions/Comments       NXT Programming: Tips for Beginning with ROBOTC       VEX Programming: Tips for Beginning with ROBOTC    2013 Robotics Summer Of Learning       VEX Toss Up Programming Challenge       FTC Ring It Up! Programming Challenge    International Forums       Spanish Forums          ROBOTC for MINDSTORMS          ROBOTC for VEX       French Forums          ROBOTC pour Mindstorms          ROBOTC pour IFI VEX       Japanese Forums （日本語のフォーラム）       German Forums    2015 Spring Carnival Event    PLTW (Project Lead The Way)    Robotics Merit Badge    2014 Robotics Academy Summer of Learning