Go to Post If you are adult enough to be a participant in this program, then you are adult enough to act like an adult. - Beth Sweet [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #16   Spotlight this post!  
Unread 23-05-2010, 20:48
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Swerve vs. Mecanum Programming

While I can't look at your code since I don't have LV on this computer, I can say a few things in general:

1. P should be good for steering, unless you have a lot of friction.
2. You should rely on the sensor. Not too much, but don't program all kinds of safeties like it going in the wrong direction. good limits are out of bounds, lost sensor (0 volts), and not moving if you are really worried about it. We have no mechanical limits on our swerve, except the wiring, and we leave a lot of extra wire. Using window and globe motors (especially the window motors), it doesn't have enough power to damage much in our application.
3. Use the same code in auto as teleop - best to put it in a new thread.
4. Make kP (gain) a front-panel control or global to tune it. If you are using four identical motors (e.g. window motors), you would probably be fine with one gain and volts/deg, and x centerpoints (where x is the number of controllers), if you mix motors (e.g. window+555 or window+globe), then you would need a different gain for each motor and volts/deg for each different sensor (e.g. when sensor gearing or # of turns is different).
5. Pots never completely fall off. We have had many problems with set screws coming loose and pots loosing connection, but never completely fall off.
6. Don't be scared of code changes. We change our code quite frequently, and generally try to test it before playing, depending on how major the change was (we don't generally test autonomous kick distance changes, for instance).
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
  #17   Spotlight this post!  
Unread 23-05-2010, 20:57
kgzak's Avatar
kgzak kgzak is offline
Registered User
AKA: Kris
FRC #4392 (Decievers) FRC #2075 (Enigma)
Team Role: College Student
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Grand Rapids, Michigan
Posts: 418
kgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to behold
Re: Swerve vs. Mecanum Programming

Quote:
Originally Posted by apalrd View Post
While I can't look at your code since I don't have LV on this computer, I can say a few things in general:

1. P should be good for steering, unless you have a lot of friction.
2. You should rely on the sensor. Not too much, but don't program all kinds of safeties like it going in the wrong direction. good limits are out of bounds, lost sensor (0 volts), and not moving if you are really worried about it. We have no mechanical limits on our swerve, except the wiring, and we leave a lot of extra wire. Using window and globe motors (especially the window motors), it doesn't have enough power to damage much in our application.
3. Use the same code in auto as teleop - best to put it in a new thread.
4. Make kP (gain) a front-panel control or global to tune it. If you are using four identical motors (e.g. window motors), you would probably be fine with one gain and volts/deg, and x centerpoints (where x is the number of controllers), if you mix motors (e.g. window+555 or window+globe), then you would need a different gain for each motor and volts/deg for each different sensor (e.g. when sensor gearing or # of turns is different).
5. Pots never completely fall off. We have had many problems with set screws coming loose and pots loosing connection, but never completely fall off.
6. Don't be scared of code changes. We change our code quite frequently, and generally try to test it before playing, depending on how major the change was (we don't generally test autonomous kick distance changes, for instance).
The safeties were there just as a challenge for me to do. In one of the versions I have I can turn them on and off. Our pot was held on by friction on the shaft and had some sort of way to keep the pot itself from actually turning. (it was a practice robot but some of the parts needed to be used on the final robot). Everything in that VI I posted can be changed through the front panel. It is made to be modular so we can use it for steering, driving a certain distance, and what ever else involves moving from one number to another. I was not afraid of changing our code, our mentor was afraid he would have to re-machine the disks if we went to far. {We had aircraft wire screwed into 5 discs, 4 on the swerve assemblies-1 on the motor. If we turned to far either our wire would snap or the screws would break. The safeties were just to keep people in the room safe while it was running.}
  #18   Spotlight this post!  
Unread 24-05-2010, 14:48
tanguma26 tanguma26 is offline
Registered User
FRC #3999
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Killeen
Posts: 48
tanguma26 is an unknown quantity at this point
Re: Swerve vs. Mecanum Programming

Ok some questions on your example what are you using in your robot to know the position in which the wheel is, are you using limit switches, gyro or any thing else, also on the example it does not show the motors or joystick is that an additional program or how are you runing this program.

Thanks
  #19   Spotlight this post!  
Unread 24-05-2010, 15:24
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Swerve vs. Mecanum Programming

He is using analog potentiometers.

This is a subVI. He calls it from his other code when he needs it. I would highly, highly, highly (I can't say this enough) recommend organizing code this way, especially separating mechanism control code from user interface code in separate threads.

Since he has a potentiometer, he has no need for limit switches. It tells him everything he needs to know. I would generally not use his method of "check greater/equal/lesser and set output based on case" and instead use proportional control, LabVIEW has a nice PID block you can use for PID or you can write your own, its just a subtract, multiply, and check range.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
  #20   Spotlight this post!  
Unread 24-05-2010, 15:41
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: Swerve vs. Mecanum Programming

Quote:
Originally Posted by apalrd View Post
I would generally not use his method of "check greater/equal/lesser and set output based on case" and instead use proportional control,...
If the system you're controlling does not have appreciable inerta and/or a slow response to changes in the control signal, a simple "full on"/"full stop" scheme can work fine. For example, a window motor usually stops as soon as you remove power, without significant overshoot. That's typical of a worm gear system.

On the other hand, if you're moving a massive mechanism around, you definitely want to slow it down on its way to the target position. Stopping it abruptly can lead to extreme stress on the gears (as demonstrated well by the teeth being stripped off a large sector of a heavy gear on the TechnoKats 2004 robot's arm by the team's programming mentor a few minutes before the pre-ship open house was to begin).
  #21   Spotlight this post!  
Unread 24-05-2010, 16:46
kgzak's Avatar
kgzak kgzak is offline
Registered User
AKA: Kris
FRC #4392 (Decievers) FRC #2075 (Enigma)
Team Role: College Student
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Grand Rapids, Michigan
Posts: 418
kgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to behold
Re: Swerve vs. Mecanum Programming

Quote:
Originally Posted by Alan Anderson View Post
If the system you're controlling does not have appreciable inerta and/or a slow response to changes in the control signal, a simple "full on"/"full stop" scheme can work fine. For example, a window motor usually stops as soon as you remove power, without significant overshoot. That's typical of a worm gear system.

On the other hand, if you're moving a massive mechanism around, you definitely want to slow it down on its way to the target position. Stopping it abruptly can lead to extreme stress on the gears (as demonstrated well by the teeth being stripped off a large sector of a heavy gear on the TechnoKats 2004 robot's arm by the team's programming mentor a few minutes before the pre-ship open house was to begin).
You may notice that there is a "slow down range" in my code. I have done multiple ways of programing a swerve as apalrd has described. I used this version because we weren't getting enough power out of our motor at low speeds and the swerve modules weren't turning very fast any way. We did not actually use a swerve drive this year on our robot, we wanted to but we didn't have weight, but we tested a swerve drive with a globe motor. I can post my other simple code for a swerve that subtracts but we also used this VI for actually moving the entire robot (comparing encoder to the position we want to go to) and we didn't want to slow down as we got to the ball instead we wanted to move, at full speed, to right before the ball and then slow down and search for the ball. It worked really well.
  #22   Spotlight this post!  
Unread 24-05-2010, 16:53
kgzak's Avatar
kgzak kgzak is offline
Registered User
AKA: Kris
FRC #4392 (Decievers) FRC #2075 (Enigma)
Team Role: College Student
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Grand Rapids, Michigan
Posts: 418
kgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to behold
Re: Swerve vs. Mecanum Programming

Quote:
Originally Posted by tanguma26 View Post
Ok some questions on your example what are you using in your robot to know the position in which the wheel is, are you using limit switches, gyro or any thing else, also on the example it does not show the motors or joystick is that an additional program or how are you runing this program.

Thanks
This VI can actually use any sensor you put into it as long as you are comparing to something that is in the same "units" as the sensor (encoder counts, gyro degrees, Potentiometer analog feed back) If you were to place this VI in you code there will be many inputs/outputs from the VI, just connect the "speed" (or something along those lines, I don't have it open in front of me I am on my Mac) to the set speed VI. I would recommend right clicking on the VI and clicking "View as Icon" to display all of the inputs/outputs in a vertical line, It keeps it much more organized.
  #23   Spotlight this post!  
Unread 25-05-2010, 10:01
tanguma26 tanguma26 is offline
Registered User
FRC #3999
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Killeen
Posts: 48
tanguma26 is an unknown quantity at this point
Re: Swerve vs. Mecanum Programming

Ok I do undersand what your program does and its a really simple program, but what I am looking for is an even simple example, I am a senor so I am leaving this year and i am trainig some one for next year and I need something that is simple to explain.
Thanks
  #24   Spotlight this post!  
Unread 25-05-2010, 15:33
kgzak's Avatar
kgzak kgzak is offline
Registered User
AKA: Kris
FRC #4392 (Decievers) FRC #2075 (Enigma)
Team Role: College Student
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Grand Rapids, Michigan
Posts: 418
kgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to behold
Re: Swerve vs. Mecanum Programming

Quote:
Originally Posted by tanguma26 View Post
Ok I do undersand what your program does and its a really simple program, but what I am looking for is an even simple example, I am a senor so I am leaving this year and i am trainig some one for next year and I need something that is simple to explain.
Thanks
I can try to write a simpler program. You could do something along the lines of finding the difference between the sensor and the control and set that as your speed.
  #25   Spotlight this post!  
Unread 25-05-2010, 16:48
kgzak's Avatar
kgzak kgzak is offline
Registered User
AKA: Kris
FRC #4392 (Decievers) FRC #2075 (Enigma)
Team Role: College Student
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Grand Rapids, Michigan
Posts: 418
kgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to behold
Re: Swerve vs. Mecanum Programming

I have attached a simpler VI that could be used as a swerve drive. This one is commented so all your questions should be answered but I can still answer and other questions you have.
Attached Files
File Type: vi example swerve.vi (5.9 KB, 31 views)
Closed Thread


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mecanum or Swerve? buildmaster5000 Technical Discussion 73 18-04-2010 11:19
Programming Mecanum Zrob Java 22 04-04-2010 23:00
Mecanum Programming Help Mars Programming 8 27-02-2008 15:41
mecanum programming mrmummert Programming 27 28-01-2007 13:45
Need help programming our swerve with feedback? activemx Programming 25 13-04-2004 07:29


All times are GMT -5. The time now is 03:43.

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