Go to Post Don't trust everything you read on Chief Delphi. - Peter Matteson [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 5 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 25-01-2015, 20:47
roialex's Avatar
roialex roialex is offline
Registered User
FRC #5444 (Vobotik)
Team Role: Mentor
 
Join Date: Dec 2014
Rookie Year: 2015
Location: Trois-Rivières
Posts: 4
roialex is an unknown quantity at this point
Encoder+PID = How make robot going straight

Hi,

My team and I tried to make robot going straight by using pid en the rate of our encoder on our motor (1 each side). Unfortunately it finish by not working at all. Here is our code that we tried but the robot was just spinning without any control you just needed to make the robot enable and it was spinning alone. We took the rate of our encoder divide it by 3700 wich is a theoretical value that represent the maximum rate that our motor were able to go. This should now gave us a value between 0 and 1. We took this value and make it the process variable in our PID. We too also the variable fromm our joystick wich range between -1 and 1 and make it our setpoint in the PID. We took the output of the pid and set it to the motor. Brief it doesn't works maybe we are not doing it right. Our goal is just to make our robot going straight how to do it ? Do you have any advice on how make you robot going straght with encoder or how improve our code ?

Thanks in advance,

Alex Rousseau
Student programmer
VObotik team 5444
Attached Thumbnails
Click image for larger version

Name:	1a0a4be504c975a14d1584b19b7904f4.png
Views:	107
Size:	60.3 KB
ID:	17988  
Reply With Quote
  #2   Spotlight this post!  
Unread 25-01-2015, 20:52
Chris_Elston's Avatar
Chris_Elston Chris_Elston is offline
Controls Engineer
AKA: chakorules
FRC #1501 (Team THRUST)
Team Role: Engineer
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Huntington, Indiana
Posts: 750
Chris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond repute
Re: Encoder+PID = How make robot going straight

We find it soooo much easier to make a robot go straight with a GYRO verses encoders. So if your application or goal is to go straight maybe try with a gyro if you have one?

Here is some pseudo code in excel with a simple "P" loop that works for autonomous mode.
Attached Files
File Type: xls 2015-01-23-simple-p-loop-gyrodrive.xls (20.5 KB, 111 views)
__________________
Team T.H.R.U.S.T. 1501
Download all of our past robot's source code here:Repository

Favorite CD quote:
"That can't be their 'bot. not nearly enough (if any) rivets to be a 1501 machine." ~RogerR: Team #1369
Reply With Quote
  #3   Spotlight this post!  
Unread 25-01-2015, 22:48
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Encoder+PID = How make robot going straight

If your goal is to make the robot go straight, and you're using Arcade drive, then it is probably easiest to put the closed-loop control on the turn input rather than on the individual motor outputs. You can either use a gyro as Chris suggests, or use the difference of the left and right encoders to tell you how much the robot thinks it has turned.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 20:18.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi