View unanswered posts | View active topics It is currently Sat Aug 23, 2014 12:06 am






Reply to topic  [ 8 posts ] 
RobotC motor control 
Author Message
Rookie

Joined: Tue Jul 03, 2012 5:16 am
Posts: 43
Post RobotC motor control
I need motor control as PRECISE AS POSSIBLE.
nMotorEncoderTarget is not enough.
Neither is while(nmotorencoder < target)


Fri Sep 28, 2012 9:21 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3190
Location: Rotterdam, The Netherlands
Post Re: RobotC motor control
The highest resolution is the encoder. There is nothing else. You'll have to write your own PID controller to control the power going to it, but the encoder will always be there.

- 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]


Sat Sep 29, 2012 1:10 am
Profile WWW
Rookie

Joined: Tue Jul 03, 2012 5:16 am
Posts: 43
Post Re: RobotC motor control
I know that, I'm just wondering if anyone had already made a good pid controller.


Sat Sep 29, 2012 3:29 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3190
Location: Rotterdam, The Netherlands
Post Re: RobotC motor control
I've made them in the past but they're often very single purpose. Precise is a very vague word. Precision can be:
  • Very accurate motor speed
  • Very accurate motor position
  • The above under heavy loads
  • The above under light loads
You see what I am getting at? There's no one-size-fits-all approach for this. You can find plenty of good PID motor control code out on the web. The tough part will be making it work for -your- specific application

- 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]


Sat Sep 29, 2012 3:49 am
Profile WWW
Rookie

Joined: Tue Jul 03, 2012 5:16 am
Posts: 43
Post Re: RobotC motor control
All of what you've said.
The most important is under heavy loads, as the robot will undergo different amounts of friction during the program.


Sat Sep 29, 2012 4:03 am
Profile
Rookie

Joined: Tue Jul 03, 2012 5:16 am
Posts: 43
Post Re: RobotC motor control
What is the nxt motor speed in degrees per second at motor power 100? I'm making a pid controller now.


Sat Sep 29, 2012 4:04 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3190
Location: Rotterdam, The Netherlands
Post Re: RobotC motor control
Everything you wanted to know about NXT motors but were afraid to ask: http://www.philohome.com/nxtmotor/nxtmotor.htm :)
It's an incredible source of information. There is a complete comparison of LEGO motors here: http://www.philohome.com/motors/motorcomp.htm

- 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]


Sat Sep 29, 2012 4:53 am
Profile WWW
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: RobotC motor control
brianchen11 wrote:
I know that, I'm just wondering if anyone had already made a good pid controller.

We did our own PID controller. I don't know if it is a good implementation. But in my opinion, a good PID controller is in the tuning of the PID constants. So the code is only half of the story.
http://proj.titanrobotics.net/hg/Ftc/20 ... /pidctrl.h


Sat Sep 29, 2012 5:36 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 8 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.