Go to Post Never mind the imperial British Empire, the sun never sets on our FIRST season! - artdutra04 [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Spotlight this post!  
Unread 20-02-2016, 04:55
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 666
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
Re: DriveTrain TankDrive Control

Quote:
Originally Posted by mikets View Post
We are actually doing 3. The built-in PID control of CANTalon is nice but it is doing a per motor PID control which is fine if we are controlling a mechanism with only one motor (e.g. an arm or an elevator). In a drive base where you have at least 2, 4 or even 6 motors, individual motor PID control doesn't address the need for the drive base to run straight. For example, if you try to have the robot go forward 10 feet and say you have calculated 10 feet is equivalent to 10,000 encoder counts. If you command each motor to go 10000 encoder counts, what if the left motor is slightly faster than the right motor. The robot will curve to the right but the left motor will achieve the 10000 count earlier than the right motor, so it will stop while the right motor will try to catch up. This means the robot will now curve left. It will get there but the robot may be traveling in a slight 'S'. In a multi-motor PID control scenario, you need an overall PID control, not individual motor PID control. You need the ability to look at the overall drive base movement and be able to shift different power to different wheels in order to keep the robot on target whether it is the heading or the distance. So in our library, we implemented a PIDDrive class that takes two PID controllers. One PID controller is controlling the distance and the other PID controller is controlling the heading. My analogy to this is one is controlling the gas pedal and the other controlling the steering wheel. The PIDDrive class will combine all sensor data (e.g. 4 encoders and 1 gyro) to come up with "distance travelled" and "heading" data. Then it applies the distance data to the distance PID controller to calculate the base power for all four wheels. It also applies the heading data to the "Turn PID controller" to calculate the differential power to the left and the right side of the wheels. So it can add/subtract a delta power from the base power between the left and right side of the wheels (i.e. shift power from the left to the right and vice versa). This overall PID control is a lot better than individual motor PID control.
BTW, if you want to look at our library, you can find it here:
https://github.com/trc492/Frc2016Fir...cPidDrive.java
Just realize I have moved the file to a different package and so link is out-dated. Here is a new link:
https://github.com/trc492/Frc2016Fir...cPidDrive.java
__________________
Reply With Quote
 


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 09:46.

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