Go to Post We've been thinking about just declaring our smallest kid on our BOM and making her part of the robot. - Qbot2640 [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
  #1   Spotlight this post!  
Unread 20-03-2002, 07:41
Mike o.'s Avatar
Mike o. Mike o. is offline
Registered User
AKA: Mike O'Brien
FRC #1086 (Blue Cheese)
Team Role: Engineer
 
Join Date: Jan 2002
Rookie Year: 2001
Location: Richmond, Virginia
Posts: 133
Mike o. has much to be proud ofMike o. has much to be proud ofMike o. has much to be proud ofMike o. has much to be proud ofMike o. has much to be proud ofMike o. has much to be proud ofMike o. has much to be proud ofMike o. has much to be proud ofMike o. has much to be proud of
Send a message via AIM to Mike o. Send a message via Yahoo to Mike o.
Programming Loops

Hey all! Alright I have a question about measuring the values in the code. When you put the program into the bot and your using a motor to rotate you put in the number that will rotate the motor the right amount right? Well suppose that U put on a pully to the motor (in this case the globe) and figure out the exact number to make the globe rotate 1/4 of a rotation or 90*. Well if you divide the number you get by 90 (the degree achieved) then you SHOULD get the numerical value that sould represent how many program loops are needed to achive this distance, correct? Please tell us if we are right, thanx.

Jason and Mike
Team 384
__________________
Mike O'Brien
Founder, Almuni, & Mentor Team 1086
2010 GAL Division Finalist & Coopertition Award; NC Regional Winner & Quality Award; VA Regional Winner & Engineering Inspiration Award Winner
2009 CMP Team Spirit Award; VA Regional Winner & Chairman's Award
2008 VA Regional Winner & Chairman's Award
2007 & 2006 VA Delphi "Driving Tomorrow's Technology" Award
2005 VA Team Spirit Award; 2004 VA Imagery Award; 2003 Rookie Year
  #2   Spotlight this post!  
Unread 20-03-2002, 12:31
jeremy562 jeremy562 is offline
Engineer
#0562 (SPARK 562)
 
Join Date: Feb 2002
Location: Fitchburg, MA
Posts: 74
jeremy562 is an unknown quantity at this point
Send a message via AIM to jeremy562
Sounds right to me. FYI, in one second the pbasic code will loop about 40 times, depending on the amount of code and probably the temperature (cold=faster).

We did something similar in our robot this year, but we rely on hard stops so the motor will stall for a little while (no more than 1/2 sec) before the program tells it to stop. This way if it gets hung up for a second or the loop executes are slightly different speeds, we should still get the needed rotation from the motor.
__________________
SPARK 562: Students Pursuing Applied Robotics Knowledge

2006 BAE Granite State Regional: Finalists with 319 and 176
2006 BAE Granite State Regional: Winners of Motorola Quality Award
2004 BAE Granite State Regional: 7th Seed
2004 Mayhem on the Merrimack Champions! Thanks, 61 and 1289!
  #3   Spotlight this post!  
Unread 23-03-2002, 23:43
ChrisA's Avatar
ChrisA ChrisA is offline
Registered User
#0857 (Superior Roboworks)
Team Role: College Student
 
Join Date: Feb 2002
Location: Michigan Tech
Posts: 157
ChrisA is on a distinguished road
Send a message via AIM to ChrisA
that is one way to do it but if you want to go with the fun way you could get yourself a potentiometer and attach it to the shaft of the motor. starting at lets say 127 you would turn 90 degrees and use debug to find out the value of the pot at that angle. you then find a speed that you can tell it to turn until you get to that angle. the correct speed would be whatever the highest speed you can make the motor turn without it passing the point. globe motors arent that fast and stop pretty quickly.

if you want to get a bit more advanced you can have the speed go on a curve according to the pot value. (ie when the motor is furthest away from the value you want the faster it spins and the closer it is the slower it spins)

if you want to try this and need some help with it feel free to ask me. my team is using this same scenario for our crab drive and it works really really well.
__________________
Programmer
----------------
Team#857
Superior Roboworks

WildStang Alum
  #4   Spotlight this post!  
Unread 25-03-2002, 16:50
Skabana159's Avatar
Skabana159 Skabana159 is offline
Robotics and Field Hockey
AKA: Jesse C. Owens
#0159 (Alpine Robotics)
Team Role: Mentor
 
Join Date: Mar 2002
Rookie Year: 2000
Location: Ft. Collins, CO
Posts: 92
Skabana159 is on a distinguished road
Send a message via AIM to Skabana159
Our team had a very similar problem last year, when we were trying to write our autobalancing code. We tried about a billion different meathods, my favorites being: a pedulum on a pot, and stopping the motors when the pot was 127; magnetic switches on one wheel as well as the frame next to it, and counting the number of trips of that switch (we found that this did not have good enough resolution, since we had to be within a few inches), but finally, we simply decided on this: We use a gyrochip to measure when it starts tilting, after this moment, we run the motors backward for a certain amount of loops. This gave us a resolution of 1/40 of a second, more than enough. This is nice because you can debug it really nice:

RUNTIME con (# of loops)
counter var byte
counter = 0

serin ...
other code here
serout ...

serin ...
pwm1 = 150
pwm2 = pwm1
counter = counter + 1
if counter = RUNTIME then mainloop
serout ...

This way, we could calibrate in a second to any bridge at the comp during the practice round by adjusting RUNTIME at the top of our code. This gives you the resolution you need. You could put it in your mainloop as well, if you want to.
__________________
"What most people do not understand is that the Buddha, the Godhead, resides just as comfortably in gears and circuits as in hills and trees. To believe otherwise is to dilute the Godhead."
-Robert Pirsig, Zen and the Art of Motorcycle Maintenance
  #5   Spotlight this post!  
Unread 26-03-2002, 09:59
ttedrow's Avatar
ttedrow ttedrow is offline
Herding electrons
AKA: Tim Tedrow
FRC #0281 (EnTech)
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2000
Location: Greenville, SC
Posts: 165
ttedrow will become famous soon enoughttedrow will become famous soon enough
Re: Programming Loops

Quote:
Originally posted by Mike o.
Hey all! Alright I have a question about measuring the values in the code. When you put the program into the bot and your using a motor to rotate you put in the number that will rotate the motor the right amount right?
Maybe a little clarification is needed here. When your program outputs a number to the PWM, it applies a voltage to the motor that make the motor turn at a speed for the given load on the motor. If your load on the motor changes so dose the speed. If I understand your question, you want to rotate the motor a certain distance. To do this you would have to have something that could provide a time reference to your program and the motor load would have to remain constant. I’m sure you are starting to see the problems in this method on controlling distance.

Now a better way. As was referred by the other members, feedback control. Try using limit switches or a potentiometer input to limit the travel of the motor. Limit switches can be used if the travel distance is fixed. Potentiometer feedback can be used if the distance will be variable.

I hope this helps
  #6   Spotlight this post!  
Unread 26-03-2002, 11:24
jeremy562 jeremy562 is offline
Engineer
#0562 (SPARK 562)
 
Join Date: Feb 2002
Location: Fitchburg, MA
Posts: 74
jeremy562 is an unknown quantity at this point
Send a message via AIM to jeremy562
Potentiometers and limit switches would solve this problem.

We chose to use hard stops with timeouts. This is a more robust solution (less parts to break.. limit switches are very cheap & weak, especially in a hardcore compeition like this year) and could be implemented quickly. It's pretty much foolproof.. you don't have to worry about overextending your motor because a limit switch fails.

It works great, and anyone going to the New Haven, CT regional can stop by and visit team 562 for a demo!
__________________
SPARK 562: Students Pursuing Applied Robotics Knowledge

2006 BAE Granite State Regional: Finalists with 319 and 176
2006 BAE Granite State Regional: Winners of Motorola Quality Award
2004 BAE Granite State Regional: 7th Seed
2004 Mayhem on the Merrimack Champions! Thanks, 61 and 1289!
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
Programming Compatition Angela06 Programming 30 08-04-2005 23:12
Hooking up Controller to computer for programming. Dragon45 General Forum 3 30-01-2003 00:22
Pneumatics electrical wiring and programming archiver 2001 1 23-06-2002 23:10
Error found in programming for the pump and pressure switch sjharobotics Programming 4 06-02-2002 17:46
pbasic programming punarhero Programming 4 21-01-2002 23:32


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

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