Free shipping on orders over \$75

# DIY custom 2.4ghz RC radio system for robotics...

 Print view Share : #at3win #at3winheader h3 { text-align:left !important; } Previous topicNext topic

Page 3 of 20 [ 289 posts ]

1, 2, 3, 4, 5, 6 ... 20
Guru ( offline )
Posts: 9256
Posted: 2008-10-20 13:52
Um, ug... Ok, anyone want to help out. I need a formula that will convert these values...

Code:
A to D | pulsout
-------|--------
min   632    | 3400
ctr   512    | 2200
max   392    | 1000
----------------
range 240    | 2400

The A to D values are straight from the A to D conversion. The pulsouts are double what they need to be because the pulsout is .5uS, and the values are 800uS less due to the 400uS separation pulses.

_________________
Jim Frye, the Robot Guy
http://www.lynxmotion.com
I've always tried to do my best...

Guru ( offline )
Posts: 4942
Posted: 2008-10-20 14:04
Try: X*10 - 2920

where X is your AtoD value...

Guru ( offline )
Posts: 9256
Posted: 2008-10-20 14:11
kurte wrote:
Try: X*10 - 2920

where X is your AtoD value...

Works!

I'll post the code in just a sec...

Thanks a lot!

Here is the code...

Code:
cha1 var word
cha2 var word
cha3 var word
cha4 var word
cha5 var word
cha6 var word
cha7 var word
cha8 var word
intest var bit
xx var byte
a_key var bit
b_key var bit
c_key var bit

sound 9, [100\880, 100\988, 100\1046, 100\1175]

low 15

start:

;definetion, (desired pulse -400) x 2.
cha1=((cha1*10)-2920)
cha2=((cha1*10)-2920)
cha3=((cha1*10)-2920)
cha4=((cha1*10)-2920)
cha5=2200
cha6=2200
cha7=2200
cha8=2200

;serout S_OUT,i57600,[dec5 cha1\5," ",dec5 cha2\5," ",dec5 cha3\5," ",dec5 cha4\5," ",13]

makepulses:
pulsout 15,800
pauseus cha1
pulsout 15,800
pauseus cha2
pulsout 15,800
pauseus cha3
pulsout 15,800
pauseus cha4
pulsout 15,800
pauseus cha5
pulsout 15,800
pauseus cha6
pulsout 15,800
pauseus cha7
pulsout 15,800
pauseus cha8
pulsout 15,800
pause 20
goto start

_________________
Jim Frye, the Robot Guy
http://www.lynxmotion.com
I've always tried to do my best...

Guru ( offline )
Posts: 9256
Posted: 2008-10-20 14:47
Ok! the prototype is working to the best of it's ability. I can move 4 joysticks on the remote and 4 servos plugged into the receiver move. Cool eh?

We will need to add some analog electronics (op amps) to massage the limited range of the joystick pots to get the full 0 to 5vdc range into the A to D on the Pro. I'm looking past the low resolution joystick readings for now.

The next step is to get the key pads wired up. Why aren't they here yet!

_________________
Jim Frye, the Robot Guy
http://www.lynxmotion.com
I've always tried to do my best...

Guru ( offline )
Posts: 3585
Posted: 2008-10-20 15:37
Robot Dude wrote:
Ok! the prototype is working to the best of it's ability. I can move 4 joysticks on the remote and 4 servos plugged into the receiver move. Cool eh?

We will need to add some analog electronics (op amps) to massage the limited range of the joystick pots to get the full 0 to 5vdc range into the A to D on the Pro. I'm looking past the low resolution joystick readings for now.

The next step is to get the key pads wired up. Why aren't they here yet!

What's going on? You have success but no pics or videos?

Great scot Jim! I just don't have the power to handle any more!

_________________
Mike

The robotics nut.

Guru ( offline )
Posts: 9256
Posted: 2008-10-20 16:07
SN96 wrote:
What's going on? You have success but no pics or videos?

Great scot Jim! I just don't have the power to handle any more!

Ok, no time for video, but if you squint your eyes and hold your breath you may be able to get the numbers on the display to change. hehe

Here's the code so far...

Code:
cha1 var word
cha2 var word
cha3 var word
cha4 var word
cha5 var word
cha6 var word
cha7 var word
cha8 var word
intest var bit
xx var byte
a_key var bit
b_key var bit
c_key var bit

sound 9, [100\880, 100\988, 100\1046, 100\1175]

serout 8,N9600,[12, 14]

low 15

start:

;definetion, (desired pulse -400) x 2.
cha1=((cha1*10)-2920)
cha2=((cha2*10)-2920)
cha3=((cha3*10)-2920)
cha4=((cha4*10)-2920)
cha5=2200
cha6=2200
cha7=2200
cha8=2200

serout 8,N9600,[16, 64, dec cha3, 16, 76, dec cha1, 16, 80, dec cha4, 16, 92, dec cha2]
;serout 8,N2400,["hello world     "]
;serout S_OUT,i57600,[dec5 cha1\5," ",dec5 cha2\5," ",dec5 cha3\5," ",dec5 cha4\5," ",13]

makepulses:
pulsout 15,800
pauseus cha1
pulsout 15,800
pauseus cha2
pulsout 15,800
pauseus cha3
pulsout 15,800
pauseus cha4
pulsout 15,800
pauseus cha5
pulsout 15,800
pauseus cha6
pulsout 15,800
pauseus cha7
pulsout 15,800
pauseus cha8
pulsout 15,800
pause 20
goto start

_________________
Jim Frye, the Robot Guy
http://www.lynxmotion.com
I've always tried to do my best...

Guru ( offline )
Posts: 3585
Posted: 2008-10-20 16:25
I could swear I saw the top row of numbers jump from 2200 to 2201 for just a milisecond. Anyway, I wanted to see how you had this hooked up.

Fantastic work.

_________________
Mike

The robotics nut.

Guru ( offline )
Posts: 9256
Posted: 2008-10-20 16:44
SN96 wrote:
Anyway, I wanted to see how you had this hooked up.

Fantastic work.

Thanks! this is fun!

Ah here you go. It's really that simple. Everything plugged in is powered by 5vdc except the Spektrum module which is powered by the battery direct. I suspect it can be powered by 5vdc, I will verify this. Edit: yes it works great powered from the Bot Board II's 5vdc output.

The connections to the Spektrum module are extra long header posts. I soldered a normal header post at a 90Ã‚Â° angle, then servo extender cable to the Bot Board II.

I cut off the trimmer tabs. So the next revision of the panel will be a lot more clean looking. I also needed to move the power switch.

_________________
Jim Frye, the Robot Guy
http://www.lynxmotion.com
I've always tried to do my best...

Guru ( offline )
Posts: 2133
Posted: 2008-10-20 17:43
Excellent work Jim!

You have made a TURC (The Ultimate Robot Controller)
I hope you get the pads soon.

I just have to try this one day.
Cool!

_________________
Kåre Halvorsen, Zenta
-----------------------------------------
Zenta's blog
http://zentasrobots.com/
-----------------------------------------

Guru ( offline )
Posts: 3585
Posted: 2008-10-20 18:30
I love the fact that the BB2 (BotBoard 2) can be custom programmed. It makes this whole thing "Open Sourceable". Now I cant wait to see what the key pads look like. Hurry UPS!

_________________
Mike

The robotics nut.

Guru ( offline )
Posts: 1138
Posted: 2008-10-21 03:40
Hi Jim,

I didnÃ¢â‚¬â„¢t visited this topic for a few days and I totally surprised! YouÃ¢â‚¬â„¢ve build a fantastic open source remote! I love the display in the middle. Adding the keypad would make it really awesome! I would love to try it out some day!

Xan

Guru ( offline )
Posts: 4942
Posted: 2008-10-21 11:19
Hi Jim,

Again looks great.

I really like having that display there and can not wait to see the keypad in there. If I have time in the next day or so, I will hack up some preliminary code to read the keypad.

I think this is great. A few months ago I was thinking of building something like this to control my Rover over longer distances. At that time I was thinking of not using something like the airmod, but instead I was thinking of something like bluetooth or something like:
http://www.hvwtech.com/products_view.asp?ProductID=668, which is a 912mhz RF transeiver which sends and receives at 9600 baud and has a range of up to 800 feet. I am not sure if Parallax still makes them as I don't see them on their site anymore, but I do see them up at some other sites. What I liked about this approach was that you did not having to encode the data in a PWM signal and then having to receive multiple channells of PWM at the other end. Just a thought.

Kurt

Guru ( offline )
Posts: 2133
Posted: 2008-10-21 12:00
kurte wrote:
...
What I liked about this approach was that you did not having to encode the data in a PWM signal and then having to receive multiple channells of PWM at the other end.

Good point Kurt, especially handling all the pwm at the end (receiver) take very much time. What about a little microcontroller taking care of all pwm readings with an interrupt code, so that the main BAP28 on BB2 just can send a pulse (IRQ) to the microcontroller when it needs the pwm data. And then the microcontroller can send the pwm data via a serout command to the BAP28? Just an idea

_________________
Kåre Halvorsen, Zenta
-----------------------------------------
Zenta's blog
http://zentasrobots.com/
-----------------------------------------

Guru ( offline )
Posts: 9256
Posted: 2008-10-21 12:03
I have looked at lots of options to do this. I fell in love with this approach for several reasons.

o The module is FFC approved and the range is really good. People are reporting 1000' and some up to 3200'.
o The programming on the robot end is relatively easy. The approach may interest RC'ers, as it's not too intimidating.
o The cost is not prohibitive.
o I suspect this technology is going to be bidi soon. No real proof, but I remember reading something about seeing the battery level of the model on the Transmitter.

I have looked at zigbee stuff and the costs were much higher. But I may try a zigbee setup later.

_________________
Jim Frye, the Robot Guy
http://www.lynxmotion.com
I've always tried to do my best...

Guru ( offline )
Posts: 9256
Posted: 2008-10-21 14:02
After several phone calls I finally got someone over at Electronix Express to tell me the keypads are in stock and will ship today. They also told me I can call them back tomorrow to get a tracking number. Wow and only 7 days after I ordered them.

I can't recommend this company. Maybe I'm too critical but there are some real "winners" out there...

The good news is these 4 x 4 keypads are available all over the place. I will look for a better supplier.

Zenta, sure a co-processor would be a great addition.

_________________
Jim Frye, the Robot Guy
http://www.lynxmotion.com
I've always tried to do my best...

1, 2, 3, 4, 5, 6 ... 20

All times are UTC - 5 hours [ DST ]. It is currently 2018-04-19 09:44