Posted by Joe at 1/31/2001 7:48 PM EST
Student on team #506 from St. Anthony’s HS.
I’m attempting to do some minor editing to the control program and am running into a few problems. My main problem is trying to put in the Tank Drive setup so I can drive it with one joystick instead of using two. I put in the program exactly as the instructions said and after several attempts finally got it to upload to the robot controller. But for some reason instead of being able to control pwm 1 and 2 with 1 joystick I can’t control either. pwm1 refuses to move while pwm 2 only goes full forward. Is the file outdated? What might I be doing wrong? What other information do you need? Somebody please help me!!!
I have also a perhaps easier question that is about programming but is not related to the first. I managed to successfully get relay 7 to go forward only and cut off when the pump hits 60 psi. The program for that section reads…
relay5_fwd = rc_sw1 'Port 1 Aux1 = Relay 5 Forward
relay5_rev = o 'Relay 5 Forward only
I then plugged in the wires on the cutoff switch on the tank to digital inputs 1 and 6. That way when the tank hits 60psi it shuts off the pump. The problem comes with the instant it goes below 60psi the pump turns back on. Is there a way I can either program a delay into this so it waits x seconds before turning on or preferably have it so it turns off at 60psi and doesn’t turn back on till it reaches 40psi. Any help would be greatly appreciated. Thanks.
Posted by Matt Leese at 1/31/2001 8:07 PM EST
Other on team #73, Tigerbolt, from Edison Technical HS and Alstom & Rochester Institute of Technology.
In Reply to: HELP!!! PBasic and I just don’t get along!!!
Posted by Joe on 1/31/2001 7:48 PM EST:
As for the tank drive problem, the program works just fine as specified. Double check what you have actually entered so that’s it correct and make sure that PWM1 and PWM2 are correctly passed on the output line and are expected to be passed as output by the controller (read the comments in the program for more information). The most likely event I see happening is that you have a wiring problem. Does the robot work with two joystick control? I can’t really give you any better help without more information.
As to setting a delay, probably the best way is to just iterate a value every time through the loop and wait for it to reach a certain threshold value before turning the pump back on.
Matt
Posted by Joe Ross at 1/31/2001 8:18 PM EST
Engineer on team #330, Beach Bot, from Hope Chapel Academy and NASA/JPL , J&F Machine, and Raytheon.
In Reply to: Re: HELP!!! PBasic and I just don’t get along!!!
Posted by Matt Leese on 1/31/2001 8:07 PM EST:
: As for the tank drive problem, the program works just fine as specified. Double check what you have actually entered so that’s it correct and make sure that PWM1 and PWM2 are correctly passed on the output line and are expected to be passed as output by the controller (read the comments in the program for more information). The most likely event I see happening is that you have a wiring problem. Does the robot work with two joystick control? I can’t really give you any better help without more information.
Innovation First has a copy of the default program with single joystick control. The best thing to do would be to compare the code that you have with their code (link below).
Like Matt said, without more details about what changes you did and what the symptoms are, it will be hard to diagnose.
Posted by Nick at 1/31/2001 8:58 PM EST
Student on team #240, Mach V, from Jefferson Monroe High School and Visteon.
In Reply to: Re: HELP!!! PBasic and I just don’t get along!!!
Posted by Joe Ross on 1/31/2001 8:18 PM EST:
If you decide to make a loop for the pausing of the pump the code would look something like this:
Declare Variables:
coun VAR byte (you cannot use count as a variable)
Mainloop:
coun = coun + 1
if coun
Posted by Joe Johnson at 1/31/2001 10:21 PM EST
Engineer on team #47, Chief Delphi, from Pontiac Central High School and Delphi Automotive Systems.
In Reply to: Re: HELP!!! PBasic and I just don’t get along!!!
Posted by Nick on 1/31/2001 8:58 PM EST:
My only improvement on the code given by Nick is to use
the packet_num or delta_t to increment the counter.
By using this method you can have relatively stable
timing even if your program goes insane or your radio
signal gets very noise. In those cases, it can take a
LONG time to get through a loop. But you still get
relatively stable timing because delta_t and packet_num
have the information that let you keep track of
approximately how long it took to get through the loop.
BOTTOM LINE:
set the config’s to used Delta_t
change Nick’s count increment line to:
coun = coun + 1 + Delta_t
Joe J.
Posted by Joe at 2/1/2001 6:24 PM EST
Student on team #506 from St. Anthony’s HS.
In Reply to: use delta_t or packet_num for more stable counting…
Posted by Joe Johnson on 1/31/2001 10:21 PM EST:
Thanks for the help everyone. I found my error in editing the program and managed to get the tank drive working. I’ll be trying this weekend to see if i can get the pump delay to work. This is my first time working with pbasic or any type of programming so it may take a few tries.
Thanks again