Automating a Tank that was previously runned by a Radio Control
Hi again... I have a couple more problems, can some one give me a hand?
I am trying to automate a little tank that was built by my team, and was used in the ASME competition a couple weeks ago (Bulk Material Transporter).
When we first buit it, we bought a radio controller by Futaba. It came with a receiver that had 4 ports for servos. We also got two speed controllers from LRP (AI super reverse digital). It had an input just like a servo, so when we connected them with the RF receiver, everything worked fine.
Now im trying to make the tank go by it self. I got 2 distance sensors by sharp (the ones parallax sells) and they are working fine. The idea is to make the tank aproach the steps perpendiculary.
The problem is that the motors behave differently everytime i power the circuit. Some times a
PULSOUT 0, 750
PULSOUT 1, 750
PAUSE 20
loop will make one go forward and the other stop, sometimes both stop, some times each one goes in a different direction.
The pulse that i measured out of the receiver was
1.0ms to stop
1.5ms to go forward
0.5ms to go backwards
This is a copy of the subfunctions I am trying to run
Turn_Right:
PULSOUT Right_Motor, 750
PULSOUT Left_Motor, 1000
PAUSE 10
DEBUG "R", CR
RETURN
Turn_Left:
PULSOUT Right_Motor, 1000
PULSOUT Left_Motor, 750
PAUSE 10
DEBUG "L" ,CR
RETURN
Forward:
PULSOUT Right_Motor, 1000
PULSOUT Left_Motor, 1000
PAUSE 10
DEBUG "F" , CR
RETURN
This is what the circuit looks like (sorry if looks like pre-school drawing...)
![circuit.JPG](http://www.geocities.com/azul_br/circuit.JPG)
Can someone give me some help, please?
Thanks!
I am trying to automate a little tank that was built by my team, and was used in the ASME competition a couple weeks ago (Bulk Material Transporter).
When we first buit it, we bought a radio controller by Futaba. It came with a receiver that had 4 ports for servos. We also got two speed controllers from LRP (AI super reverse digital). It had an input just like a servo, so when we connected them with the RF receiver, everything worked fine.
Now im trying to make the tank go by it self. I got 2 distance sensors by sharp (the ones parallax sells) and they are working fine. The idea is to make the tank aproach the steps perpendiculary.
The problem is that the motors behave differently everytime i power the circuit. Some times a
PULSOUT 0, 750
PULSOUT 1, 750
PAUSE 20
loop will make one go forward and the other stop, sometimes both stop, some times each one goes in a different direction.
The pulse that i measured out of the receiver was
1.0ms to stop
1.5ms to go forward
0.5ms to go backwards
This is a copy of the subfunctions I am trying to run
Turn_Right:
PULSOUT Right_Motor, 750
PULSOUT Left_Motor, 1000
PAUSE 10
DEBUG "R", CR
RETURN
Turn_Left:
PULSOUT Right_Motor, 1000
PULSOUT Left_Motor, 750
PAUSE 10
DEBUG "L" ,CR
RETURN
Forward:
PULSOUT Right_Motor, 1000
PULSOUT Left_Motor, 1000
PAUSE 10
DEBUG "F" , CR
RETURN
This is what the circuit looks like (sorry if looks like pre-school drawing...)
Can someone give me some help, please?
Thanks!
Comments
Which Futaba transmitter were you using originally?
Regards,
Bruce Bates
Thank you so much for the quick reply.
The futaba was the 4vwd.
Here is the link for it.
http://www.futaba-rc.com/radios/futj60.html
I got some measurements out of a scope from it, if you think would help...
Thanks again
Which Basic Stamp are you using?
Bruce
-Without a common ground, you will experiance all kinds of strange behaivor
Does your ESC (motor controller) have BEC (Battery Eleminator Circuitry)?
-If you do, I would remove the 9V battery to the ESC's.· The BEC will obtain all the power for the ESCs from the 7.2V battery
Servos and ESC's require a 1ms - 2ms pulse every 20ms or so to maintain the feedback loop.· If you are only sending a single pulse, then you may have "glitching" problems.· See example test code below:
' turns continiously
Main:
· PULSOUT 0, 1000
· PULSOUT 1, 1000
· PAUSE 15
goto Main
OR
' gives 1.5 seconds of truning
for i = 1 to 100··········
· PULSOUT 0, 1000
· PULSOUT 1, 1000
· PAUSE 15
next
I sucessfully automated a standard 4wd RC truck using a servo and an ESC, so it is possible to drive your tank with the BS2.
·
Thanks again.
You mention using both the LRP motor controller and the SN754410, which are you trying to use? Are you trying to drive the LRP in a way that your receiver did for your competition, or are you ditching that in favor of the H-bridge chip?
If you are trying to use the LRP motor controllers, you would need to drive them with PULSOUT:
You state you are using the Homework Board, this means you are using a BS2. The·stamp manual states the base time unit of PULSOUT is 2uS. You state the following pulse widths: 1.0ms·= stop, 1.5ms = forward, 0.5ms·= backwards. This results in PULSOUT values of 500=stop, 750=forward, 250=backward. These are not the values you use in the program, do these new values fix the problem?
Sunktruck is correct that you need to continue sending these pulses repititiously.
I unfortuantely do not have hands on experience with stamps, so my understanding comes from the manual, the manual does not state whether the PULSOUT command is blocking (holds up the stamp until it toggles the pin) or not. Jon Williams or another experienced stamper should be able to state if it is or not. If it is a blocking operation, I see a problem because the transition of the second PULSOUT occurs·after the sum of it's value and the previous PULSOUT value. So for a left turn, the left motor pulse happens 1750 ticks after the start of the first PULSOUT. If PULSOUT is not a blocking operation, the code you wrote should be correct (except for the values discussed above).
If you are trying to use the H-bridge chips, then using PULSOUT is not needed unless you want to drive the motors at partial speed.
Have you gotten the motors to operate with the H-bridge chips? Are you expereincing the same problem with the motors not rotating at the same rate? If so it may be due to differences in your motors, which we can discuss solutions in that event.
I have a feeling Im missing a question or two, I may remember what they are after your response.
Paul