BS2 and R/C Control
I,m building a radio controlled robot and was experimenting with
controlling two H-Bridge's via BS2 connected to a Hitec receiver.
Channel 1 & 2 of the receiver were connected to pins 2 & 4 of the
BS2. Pins 12 thru. 15 were connected to the two H-Bridges.
Below is a part of program, which I was trying to keep simple. I
used the "debug" of the program to determine the "Min", "Mid",
and "Max" of the transmitter. When I ran the program I had the output
of the H-Bridge connected to a meter. The first anomoly I noticed
was observing the screen, when I moved the joystick forward the read-
out would show the "min" value for a second then jump to the "max".
Moving the stick back did the opposite, "max" then "min". The high
value in the first pause statement seem to stop that problem. Is this
the best way to stop that? The second I noticed was in order to get
plus 10 volts on the H-Bridge the second pause value, in
the "forward/back" portions had to be high; is that because of slow
response of the H-Bridge? Lastly I discovered by varying both "pause"
values I either had:
1. Move the stick in either direction and hold it there, the voltage
goes opposite for a second then reads what it should.
2. Move the stick in either direction hold it there, the voltage
initially reads what it should, then the value starts to vary; if the
h-bridge is connected to a motor, the motor would run, stop, run.
Presently the receiver is connected directly to the BS2. I tried to
put a 1K resistor to ground between the BS2 & Receiver, as a filter,
no affect.
Any ideas of what is happening?
main:
pulsin 2,x
pause 1000
debug cls, DEC x
If x > 200 then Forward
If x < 100 then Back
Forward:
high 12
low 13
high 14
low 15
pause 400
goto main
Back:
low 12
high 13
low 14
high 15
pause 400
goto main
I thought this would be simple.
Thanks
Brian
controlling two H-Bridge's via BS2 connected to a Hitec receiver.
Channel 1 & 2 of the receiver were connected to pins 2 & 4 of the
BS2. Pins 12 thru. 15 were connected to the two H-Bridges.
Below is a part of program, which I was trying to keep simple. I
used the "debug" of the program to determine the "Min", "Mid",
and "Max" of the transmitter. When I ran the program I had the output
of the H-Bridge connected to a meter. The first anomoly I noticed
was observing the screen, when I moved the joystick forward the read-
out would show the "min" value for a second then jump to the "max".
Moving the stick back did the opposite, "max" then "min". The high
value in the first pause statement seem to stop that problem. Is this
the best way to stop that? The second I noticed was in order to get
plus 10 volts on the H-Bridge the second pause value, in
the "forward/back" portions had to be high; is that because of slow
response of the H-Bridge? Lastly I discovered by varying both "pause"
values I either had:
1. Move the stick in either direction and hold it there, the voltage
goes opposite for a second then reads what it should.
2. Move the stick in either direction hold it there, the voltage
initially reads what it should, then the value starts to vary; if the
h-bridge is connected to a motor, the motor would run, stop, run.
Presently the receiver is connected directly to the BS2. I tried to
put a 1K resistor to ground between the BS2 & Receiver, as a filter,
no affect.
Any ideas of what is happening?
main:
pulsin 2,x
pause 1000
debug cls, DEC x
If x > 200 then Forward
If x < 100 then Back
Forward:
high 12
low 13
high 14
low 15
pause 400
goto main
Back:
low 12
high 13
low 14
high 15
pause 400
goto main
I thought this would be simple.
Thanks
Brian