Go to Post Including the Kinect in the kit a parts is actually an evil plan. The programers are going to spend all their time playing with the Kinect. In competition the robot is just to sit there because it will not have a program. :ahh: - FrankJ [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 23-01-2002, 00:31
punarhero's Avatar
punarhero punarhero is offline
Registered User
#0696 (Clark Magnet Robotics)
Team Role: Programmer
 
Join Date: Jan 2002
Location: la crescenta
Posts: 67
punarhero is an unknown quantity at this point
Send a message via AIM to punarhero Send a message via Yahoo to punarhero
PBASIC problem

I started programming today. Two motors work on pin 1 and 2 off of port 1 and 2 joysticks on the y-axis. So, each joystick is running one motor on its y-axis.

What I want to do is have a drive train with 4 motors. How can I made 4 motors run on only y-axis of two joysticks, i.e. two motors on y-axis of each joystick

Thanx
Punar
  #2   Spotlight this post!  
Unread 23-01-2002, 00:55
Unsung FIRST Hero
Nate Smith Nate Smith is offline
FRC Key Volunteer Trainer
AKA: CrazyNate
no team
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Old Town, Maine
Posts: 1,029
Nate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to behold
Send a message via AIM to Nate Smith Send a message via Yahoo to Nate Smith
Basically, just set a speed controller on each motor, and send the same value to both of the left motors, and the same signal to both of the right motors
__________________
Nate Smith
nsmith@smythsoft.com
12 seasons, 4 teams, and more time logged behind the scorekeeper's table than I care to remember...
returning for 2011? only time will tell...
  #3   Spotlight this post!  
Unread 23-01-2002, 00:56
Greg Ross's Avatar
Greg Ross Greg Ross is offline
Grammar Curmudgeon
AKA: gwross
FRC #0330 (Beach 'Bots)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Hermosa Beach, CA
Posts: 2,245
Greg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond repute
Send a message via AIM to Greg Ross Send a message via Yahoo to Greg Ross
All ya gots to do is...

Download the default program from the Innovation First site and edit it to output p1_y and p2_y to two more PWMs. So if you hook up your other two motors to PWM3 and PWM4, your serout command would be:
PHP Code:
Serout USERCPUOUTBAUD, [255,255,p1_y,relayA,p2_y,relayB,p1_y,p2_y,p1_x,p2_x,p3_x,p4_x,p1_wheel,p2_wheel,p3_wheel,p4_wheel,127,127,127,127
__________________
Greg Ross (The Grammar Curmudgeon formerly known as gwross)
S/W Engineer, Team 330, the Beach 'Bots
<--The Grammar Curmudgeon loves this cartoon.
“Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming "Wow! What a Ride!" Hunter S. Thompson
"Playing a practical joke means doing something mean and calling it funny." Me
  #4   Spotlight this post!  
Unread 23-01-2002, 07:16
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
Re: PBASIC problem

Quote:
Originally posted by punarhero
I started programming today. Two motors work on pin 1 and 2 off of port 1 and 2 joysticks on the y-axis. So, each joystick is running one motor on its y-axis.

What I want to do is have a drive train with 4 motors. How can I made 4 motors run on only y-axis of two joysticks, i.e. two motors on y-axis of each joystick

Thanx
Punar
Did you connect a motor to PWM # 5 ? This is the default program's output for the x axis of the Port 1 joystick, and quite helpful for turning, in one-stick "tank" steering (look into it on the Innov'n First Board).
  #5   Spotlight this post!  
Unread 23-01-2002, 17:39
Joseph F Joseph F is offline
Registered User
#0506 (Steel Friars)
 
Join Date: Jan 2002
Location: New York
Posts: 59
Joseph F is an unknown quantity at this point
Send a message via AIM to Joseph F
um. y-splitter. Hook up the left motors to independent victors, then attach the victors to a y-splitter and then put the other end to pwm1. do the same on the right with pwm2. its the simplest method.
__________________
One Team, One Bot, One Fleet of Ambulances!
  #6   Spotlight this post!  
Unread 24-01-2002, 09:16
Unsung FIRST Hero
Nate Smith Nate Smith is offline
FRC Key Volunteer Trainer
AKA: CrazyNate
no team
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Old Town, Maine
Posts: 1,029
Nate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to behold
Send a message via AIM to Nate Smith Send a message via Yahoo to Nate Smith
Quote:
Originally posted by Joseph F
um. y-splitter. Hook up the left motors to independent victors, then attach the victors to a y-splitter and then put the other end to pwm1. do the same on the right with pwm2. its the simplest method.
If I remember correctly, splitting a signal to two speed controllers is pushing the limits of the power supplied on the PWM signal for the speed controller's optocoupler. Technically, it can be done, but personally, I'd say play it safe and give each speed controller to its own set of pins.
__________________
Nate Smith
nsmith@smythsoft.com
12 seasons, 4 teams, and more time logged behind the scorekeeper's table than I care to remember...
returning for 2011? only time will tell...
  #7   Spotlight this post!  
Unread 24-01-2002, 16:46
Joe Johnson's Avatar Unsung FIRST Hero
Joe Johnson Joe Johnson is offline
Engineer at Medrobotics
AKA: Dr. Joe
FRC #0088 (TJ2)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1996
Location: Raynham, MA
Posts: 2,644
Joe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond repute
Y's are okay I think...

I am pretty sure that a Y on a PWM cable is just fine.

Joe J.
  #8   Spotlight this post!  
Unread 16-02-2002, 23:13
GhettoTech GhettoTech is offline
Registered User
#0300 (Ghetto Techs)
 
Join Date: Feb 2002
Location: Philadelphia
Posts: 21
GhettoTech is an unknown quantity at this point
Send a message via AIM to GhettoTech
There are definantly several different ways to solve this problem.

Mechanically:
You could run a chain from one motor to drive two wheels on one side.

Electronically:
You could use the Y splitters from one PWM output to go to two different speed controllers (each controlling a different motor)

Softwar(ly?):
The "Serout" command at the end of the default code is what sends out the signals to all the electronics. You could simply connect each motor's speed controller to its own PWM output. (Let's suppose the motors on PWM 1 and PWM 2 are the two motors you want to run simultaneously from one joystick [plugged into port1], and PWM 3 & 4 from the other joystick [plugged into port 2])
You could change the output line from:
Serout USERCPU, OUTBAUD, [255,255,p1_y,relayA,p2_y,relayB,p3_y,p4_y,... (etc)
to:
Serout USERCPU, OUTBAUD, [255,255,p1_y,relayA,p1_y,relayB,p2_y,p2_y,...(etc)

Or

you could leave the output line alone and simply add, right before the Serout command:
p4_y = p2_y 'This makes PWM 4's output be controlled by Port 2's joystick (y-axis)
p3_y = p2_y 'This makes PWM 3's output be controlled by Port 2's joystick
p2_y = p1_y 'This makes PWM 2's output be controlled by Port 1's joystick

' Default program's comment code....
' blah blah blah

Serout USERCPU, OUTBAUD, [255,255,p1_y,relayA,p2_y,relayB,p3_y,p4_y,...(etc)



Whatever method is best for you, go for it
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
Ok one problem cantwell03 Programming 3 13-02-2003 07:28
PBasic 2.5 vs. 2.0 Anthony Kesich Programming 6 09-02-2003 22:06
PBasic Select Problem powercat Programming 4 31-01-2003 11:01
The problem with scouting... archiver 2001 10 23-06-2002 23:49
Major problem with chipphua motors aka Scott White Motors 18 19-03-2002 19:44


All times are GMT -5. The time now is 01:17.

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