Go to Post I think the GDC should force us to use steam engines, but the electrically-inclined folks on my team might stop whining if they're given more to work with. - Madison [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 26-03-2012, 23:35
Tanaythan's Avatar
Tanaythan Tanaythan is offline
Programmer
AKA: Tanay Nathan
FRC #3256 (Warriorborgs)
Team Role: Programmer
 
Join Date: Feb 2011
Rookie Year: 2010
Location: San Jose
Posts: 27
Tanaythan is an unknown quantity at this point
Arcade Drive with Speed PID?

Hi all,

My team has decided that we want to use Speed PID because they think it will be better for fine tuning on the bridge. However, the only problem I see with it is that we have to use Arcade Drive because our driver prefers it over anything else. We use the CAN Speed settings on our jaguars to indicate our velocity and we are wondering if we can use RobotDrive with the Speed PID. Note we are also using Master/ Slave mode. Do we have to come up with our own algorithm to do Arcade Drive in master slave mode or can we just use some of the Robot Drive functions given to us?
__________________
Tanay Nathan
Programmer
Team #3256 Warriorborgs
Reply With Quote
  #2   Spotlight this post!  
Unread 04-04-2012, 12:45
Tommy.Brown's Avatar
Tommy.Brown Tommy.Brown is offline
Lead Programmer
FRC #1477 (Texas Torque)
Team Role: Programmer
 
Join Date: Jul 2011
Rookie Year: 2011
Location: The Woodlands
Posts: 27
Tommy.Brown is an unknown quantity at this point
Re: Arcade Drive with Speed PID?

From my experience, it will be most effective in the long run to completely create your own form of the drive code, it can still take in the inputs from the joysticks as Arcade Drive does, however you can take the values and figure out a PID setpoint and run the PID algorithm to calculate your motor speeds.

Joystick->PID->SpeedController

If you need any help with any of this I am very experienced with writing custom drive codes for robots, feel free to send me a message if you need help...
__________________
FRC Team 1477 - Texas Torque
The Woodlands, Texas
Reply With Quote
  #3   Spotlight this post!  
Unread 04-04-2012, 13:16
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,098
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Arcade Drive with Speed PID?


C pseudocode for arcade


Reply With Quote
  #4   Spotlight this post!  
Unread 05-04-2012, 15:17
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: 671
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: Arcade Drive with Speed PID?

Quote:
Originally Posted by rawrxp View Post
Hi all,

My team has decided that we want to use Speed PID because they think it will be better for fine tuning on the bridge. However, the only problem I see with it is that we have to use Arcade Drive because our driver prefers it over anything else. We use the CAN Speed settings on our jaguars to indicate our velocity and we are wondering if we can use RobotDrive with the Speed PID. Note we are also using Master/ Slave mode. Do we have to come up with our own algorithm to do Arcade Drive in master slave mode or can we just use some of the Robot Drive functions given to us?
By Speed PID, do you mean using the CAN Jaguar kSpeed control mode? If so, you should be able to use RobotDrive::ArcadeDrive with speed control mode. According to the code, you should be able to call RobotDrive::SetMaxOutput to set the maximum speed of your robot and then just feed RobotDrive::ArcadeDrive with your joystick values that's in the range of -1.0 to 1.0, the SetLeftRightMotorOutputs() code in RobotDrive will scale your -1.0 to 1.0 range to your -maxOutput to maxOutput range which is your speed range.
__________________
Reply With Quote
  #5   Spotlight this post!  
Unread 05-04-2012, 16:45
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,098
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Arcade Drive with Speed PID?

Quote:
Originally Posted by mikets View Post
By Speed PID, do you mean using the CAN Jaguar kSpeed control mode? If so, you should be able to use RobotDrive::ArcadeDrive with speed control mode. According to the code, you should be able to call RobotDrive::SetMaxOutput to set the maximum speed of your robot and then just feed RobotDrive::ArcadeDrive with your joystick values that's in the range of -1.0 to 1.0, the SetLeftRightMotorOutputs() code in RobotDrive will scale your -1.0 to 1.0 range to your -maxOutput to maxOutput range which is your speed range.
If no rotation is being commanded and the vehicle is traveling in a straight line, you could do that.

Otherwise, it wouldn't work very well.

The input commands to an arcade algorithm are vehicle forward speed and vehicle rotational speed.

The arcade algorithm performs a reverse kinematic calculation on those commands to determine the necessary left and right wheel speeds to give the commanded vehicle motion.

The signals from the 2 wheel encoders are left and right wheel speed.

In order to obtain a usable process variable to do what you have suggested, you would have to reverse-engineer the PID's reverse kinematic calculation to obtain a forward kinematic calculation, which you would then apply to the encoder signals to obtain estimated vehicle forward speed which could be used as a process variable.

It would probably be a lot easier and cleaner to just write your own arcade code, and close the loop on left and right wheel speeds directly.



Last edited by Ether : 05-04-2012 at 18:49.
Reply With Quote
  #6   Spotlight this post!  
Unread 05-04-2012, 18:32
bob.wolff68's Avatar
bob.wolff68 bob.wolff68 is offline
Da' Mentor Man
FRC #1967
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2007
Location: United States
Posts: 157
bob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nice
Re: Arcade Drive with Speed PID?

Ether,

Your website link didn't work for me last time nor this time. Any thoughts? Anyone else unable to click to those links?

bob
__________________
~~~~~~~~~~~~~~~~~~~
Bob Wolff - Software from the old-school
Mentor / C / C++ guy
Team 1967 - The Janksters - San Jose, CA
Reply With Quote
  #7   Spotlight this post!  
Unread 05-04-2012, 18:51
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,098
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Arcade Drive with Speed PID?

Quote:
Originally Posted by bob.wolff68 View Post
Ether,

Your website link didn't work for me last time nor this time. Any thoughts? Anyone else unable to click to those links?

bob
Thanks for letting me know.

I just added a "www" to the link. Let me know if that fixes it.

If not, I'll find a different web host.


Reply With Quote
  #8   Spotlight this post!  
Unread 05-04-2012, 20:16
bob.wolff68's Avatar
bob.wolff68 bob.wolff68 is offline
Da' Mentor Man
FRC #1967
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2007
Location: United States
Posts: 157
bob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nice
Re: Arcade Drive with Speed PID?

No go. Didn't help. :-(

bob
__________________
~~~~~~~~~~~~~~~~~~~
Bob Wolff - Software from the old-school
Mentor / C / C++ guy
Team 1967 - The Janksters - San Jose, CA
Reply With Quote
  #9   Spotlight this post!  
Unread 05-04-2012, 22:03
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,098
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Arcade Drive with Speed PID?

Quote:
Originally Posted by bob.wolff68 View Post
No go. Didn't help. :-(

bob
OK, I uploaded to CD media:

http://www.chiefdelphi.com/media/papers/2661


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 03:03.

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