Go to Post Robot teams will expand to fill the available space. - topgun [more]
Home
Go Back   Chief Delphi > Technical > Robotics Education and Curriculum
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 17-12-2002, 01:11
aZnXsa1Nt aZnXsa1Nt is offline
Registered User
#1045
 
Join Date: Oct 2002
Location: Fremont
Posts: 5
aZnXsa1Nt is an unknown quantity at this point
help programming

hey this is Mark from the rookie Mission San Jose Team 1045.

I was wondering how I could go about programming the edubot- for example, in our current setup we have it running off one joystick. How would i use 2, one to control each motor? Where would i find the code?

Thanks for any assistance.
__________________
"you cannot bend the spoon- that is impossible. instead, try to understand the truth: there is no spoon."
  #2   Spotlight this post!  
Unread 17-12-2002, 07:57
Lloyd Burns Lloyd Burns is offline
Registered User
FRC #1246 (Agincourt Robotics)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Toronto
Posts: 292
Lloyd Burns is an unknown quantity at this point
Last night, our "EduBot" group played with the Kit for the first time. I had one joystick from a previous year, and started with that. With no computer handy to program the beast and with one joystick, in Port 1, we had p1_y (which controls PWM1 and PWM3 on the ISAAC robot controller, and p1_x, which controls PWM5. These assignments are in the IFI manual.

We had one motor facing east, one west. the East facing motor was connected to PWM1, the West facing to PWM5. Then the fun began : with the joystick at 45 degrees, a push forward into a "corner" gave forward motion with both wheels turning in the same direction, and aft motion came from pulling back to the opposite corner. turning was done in the alternate corners, but you had to push the stick the way the back of the robot was to go while it was turning (relative to the far side of the bot. This was all pretty IFI (iffy :-)).

You _can_ use two sticks to steer your bot, with the stock program, else you _must_ program. The following is the "fix" suggested in the 1998 manual, modified for motors you can't reverse by wiring :

In the SEROUT statement in the mini-RC, program the PWM1 variable with
(((2000 + p1_y - p1_x + 127) Min 2000 Max 2254) - 2000)

and the PWM5 with
(((2000 + p1_y + p1_x -127) Min 2000 Max 2254) - 2000)
[The minus in front of the p1_y and the + 127 should correct the reversed direction on one side.]

If it isn't right, change which motor goes to which pwm connection. I just made the correction up, so I'm not sure it'll work, but its a point of departure.

Last edited by Lloyd Burns : 17-12-2002 at 09:23.
  #3   Spotlight this post!  
Unread 17-12-2002, 09:02
seanwitte seanwitte is offline
Registered User
None #0116
Team Role: Engineer
 
Join Date: Nov 2002
Location: Herndon, VA
Posts: 378
seanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant future
Send a message via AIM to seanwitte
trick to account for motor orientation

When you build a robot with the EDURobotics kit, the motors will probably not be mounted with the same orientation. Say you define the following variables and constants:

vDriveRight VAR BYTE 'value passed to right-hand motor
vDriveLeft VAR BYTE 'value passed to left-hand motor
cForward CON 200 'PWM value to go forward
cNeutral CON 127 'PWM value to stop moving

If you set both of the motors to cForward, the robot will rotate in place because they'll be moving in opposite directions. Its easier to write the code assuming they move in the same direction, so just adjust the one that in reverse right before pass the values to SEROUT. That way if you set them both to go forward, the robot will go forward.

--> Edited
I stand corrected, per the reply. To adjust the motor thats mounted in the reverse direction, subtract its value from 254 before you pass it to the SEROUT command instead of taking the bitwise ~ of it.

vDriveRight = 254 - vDriveRight
SEROUT USERCPU, OUTBAUD, [255,255,vDriveLeft,0,vDriveRight

Last edited by seanwitte : 17-12-2002 at 10:57.
  #4   Spotlight this post!  
Unread 17-12-2002, 09:21
Lloyd Burns Lloyd Burns is offline
Registered User
FRC #1246 (Agincourt Robotics)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Toronto
Posts: 292
Lloyd Burns is an unknown quantity at this point
correction

I just noticed in the manual, that PWM1 gives CCW rotation of the moter, while PWM5 gives CW rotation, so I edited my previous post back to the original 1988 suggestion.

BTW, seanwitte, to reverse a joystick direction in PBASIC, use

p1_y = 254 - p1_y

because
if p1_y is 254, it becomes 000,
if p1_y is 127, it remains 127,
if p1_y is 000, it becomes 254.

The OI programming will not allow sending an analog value greater than 254 because 255 is used as a syncing signal (Serin starts with 255,255, waiting for two $FF = x00FF = 255d bits before starting to accept data for its following parameters.


LATEST NEWS
Even better - download the pdf re default program guide from www.innovationfirst.com and see what they have to say about switch input SW5 on ISAAC.
It gives you one-stick drive. checkit out !!!

Last edited by Lloyd Burns : 17-12-2002 at 09:52.
  #5   Spotlight this post!  
Unread 17-12-2002, 11:03
ChrisH's Avatar Unsung FIRST Hero
ChrisH ChrisH is offline
Generally Useless
FRC #0330 (Beach 'Bots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Hermosa Beach, CA
Posts: 1,230
ChrisH has a reputation beyond reputeChrisH has a reputation beyond reputeChrisH has a reputation beyond reputeChrisH has a reputation beyond reputeChrisH has a reputation beyond reputeChrisH has a reputation beyond reputeChrisH has a reputation beyond reputeChrisH has a reputation beyond reputeChrisH has a reputation beyond reputeChrisH has a reputation beyond reputeChrisH has a reputation beyond repute
Re: correction

Quote:
Originally posted by Lloyd Burns

LATEST NEWS
Even better - download the pdf re default program guide from www.innovationfirst.com and see what they have to say about switch input SW5 on ISAAC.
It gives you one-stick drive. checkit out !!! [/b]
Not only that, using SW 8 you have pre-programmed limit switches. I think it's 6 that reverses all inputs and 7 does something else useful, but I forget what.

Never hurts to read the manual.
__________________
Christopher H Husmann, PE

"Who is John Galt?"
  #6   Spotlight this post!  
Unread 17-12-2002, 15:00
Jeremy_Mc's Avatar
Jeremy_Mc Jeremy_Mc is offline
GitHubber
no team
Team Role: Mentor
 
Join Date: Feb 2002
Rookie Year: 2002
Location: Orlando, FL
Posts: 496
Jeremy_Mc will become famous soon enoughJeremy_Mc will become famous soon enough
Actually..

It's SW 1, 6, 5, and 8.

If anyone needs help programming, feel free to e-mail me or PM me and I'll do my best to help.
__________________
GitHub - Collaborate on code, documentation, etc. - http://github.com
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
multi-bank programming problem GregC Programming 3 14-02-2003 16:13
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 17:35.

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