Putting robotics at your service™

Free shipping on orders over $75

DIY Remote Control XBee controller for Robotics...

Print view Share :
Previous topicNext topic

Page 4 of 35 [ 511 posts ]

1, 2, 3, 4, 5, 6, 7 ... 35
User avatar
Guru ( offline )
Posts: 4942
Posted: 2009-10-06 17:44 
Currently I don't have all of the exact resistors mentioned. I do have others.
For example if I use R0=5.6K R1-R4 = 1.5K, 3.3K, 5.6K, 10K and my Quick and dirty excel sheet is correct:
    R0 r1 r2 r3 r4
    Value 5600 1500 3300 5600 10000
    Voltage 1 Sw 3.943661972 3.146067416 2.5 1.794871795
    AToD value 807.6619718 644.3146067 512 367.5897436
The Below tries to calculate the resistence if two switches are pressed at the same time:

    --- 1031.25 1183.098592 1304.347826
    1031.25 --- 2076.404494 2481.203008
    1183.098592 2076.404494 --- 3589.74359
    1304.347826 2481.203008 3589.74359 ---
Which then translates into the AtoD values for them:

    --- 864.7540057 845.3953488 830.5491184
    864.7540057 --- 747.0163934 709.5973204
    845.3953488 747.0163934 --- 624
    830.5491184 709.5973204 624 ---

Some of them are pretty close, to single button presses, may wish to get the resistors you mentioned in your table. I hope some of this makes sense.
Kurt


User avatar
Guru ( offline )
Posts: 4942
Posted: 2009-10-06 18:30 
Another option I think that would work pretty well is to add the four buttons as another column on the keypad. That is we could do something like:
Attachment:
Add-switches-to-DIY-receive.jpg
Add-switches-to-DIY-receive.jpg [ 4.95 KiB | Viewed 1693 times ]


Then all I need to do is to jumper off of the 4 IOs that we currently normally leave high and we one by one set low and check to see if our input went low and if so we know that switch was pressed. Then it would be simple to update the checkkeypad function to add these switches. Looking at my pretty poor diagram above I wonder if I should add resistors to each of the rows. IE what happens if you press S1 and S2 and P10 is high and P11 is low? I wonder what happens with the current keypad?

What do you think? should I go this way or using our resistor and analog method?

Kurt


User avatar
Guru ( offline )
Posts: 2133
Posted: 2009-10-07 08:44 
Hi Kurt,

I've just skimmed over the last part of this thread. Using the resistor ladder was something similar I did on my Futaba RC transmitter. The ladder replaced the original potmeter for channel 6.



Your latest suggestion sounds like a good idea. (I've been thinking of something similar too). So far I've not activated two buttons at the same time.. Maybe adding some resistor for preventing a shortcicuit/overload would be an idea?

_________________
Kåre Halvorsen, Zenta
-----------------------------------------
Zenta's blog
http://zentasrobots.com/
Zenta's YouTube channel
http://www.youtube.com/ZentaOlbaid
-----------------------------------------


User avatar
Guru ( offline )
Posts: 9256
Posted: 2009-10-07 10:20 
kurte wrote:
Looking at my pretty poor diagram above I wonder if I should add resistors to each of the rows. IE what happens if you press S1 and S2 and P10 is high and P11 is low? I wonder what happens with the current keypad?

What do you think? should I go this way or using our resistor and analog method?


I use a common CAD system for schematics, called graph paper. It's a step up from the crayons and napkins I used to use. lol :D

I think adding to the keypad just makes sense. Took a few minutes this morning to refresh my memory on the original DIY radio. Looks like we installed pullups on pins 4 thru 7. If we call them the row, I would recommend we add a column for the additional 4 switches. This will not require adding any resistors. Just soldering wires to the existing keypad. I didn't have time to find which I/O pin(s) are still available by looking at the code.

On the potential shorting issue (if you were to do a face roll on the keypad) I think the solution is easy. Change the high commands in the scanning routine to input commands. You still look for a low as normal, but there is no way to short anything because all pins are hi-z except the single low on one of the output pins 10 thru 13. It's probably the way it should have been done from the beginning. lol :oops:

input p4
input p5
input p6
input p7

output p10
output p11
output p12
output p13

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


User avatar
Guru ( offline )
Posts: 4942
Posted: 2009-10-07 11:09 
Thanks Jim,

Graph Paper??? That is way too modern. I like my crayons :lol: They always said I should have been a doctor.

Yep that is the easiest solution. Adding it your way would not require another pullup which would be good. Will start adding it to mine. I will probably make a 4 wire y cable to hook it up to the keypad. I will also experiment with the making them input instead of high and see how that works.

Kurt


User avatar
Guru ( offline )
Posts: 4942
Posted: 2009-10-07 23:34 
So I decided to go ahead and try it.

I made the 4 wire Y cable, where one end was 4 female connections to plug into the keypad (the 4 wires with pullups). I wired one of the groups of 4 wires with male connections, such that I plugged in the wires coming from the BB2 and then the other set had a wire going to each of the four new switches. I then ran a common wire to the other lead of each of the 4 switches and this wire continued and was plugged into the P17 on the BAP.

I drilled 4 holes in the face plate of the DIY radio, under the LCD. I roughly lined them up with the row of switches 4,5,6,B of the keypad.

I then updated the source code for the CheckKeypad to change all of the places we said High row(0-3) to instead do input row(0-3), to take care of the possiblility of short cirucit if two buttons are pressed. I also then added the new buttons as RowB and processed it like the other 4 rows. FYI - I unnested all of the ifs in the code so it would now process multiple keys being pressed. To see if it was working I had the characters (W, X, Y, Z) display for these characters.

So far it looks like it is working at least for one key pressed. Now to update my code to use these for: Up/Down/Enter/Cncl.

Kurt


User avatar
Guru ( offline )
Posts: 9256
Posted: 2009-10-08 09:48 
kurte wrote:
So far it looks like it is working at least for one key pressed. Now to update my code to use these for: Up/Down/Enter/Cncl.

Kurt


I LOVE it when a plan comes together! 8)
Great job... Now we have some catching up to do.

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


User avatar
Guru ( offline )
Posts: 4942
Posted: 2009-10-08 12:42 
Yah - I updated the Transmitter program to use two of the keys to rotate through pages. I thought I would updated the program up here for safe keeping...


User avatar
Guru ( offline )
Posts: 4942
Posted: 2009-10-16 14:11 
Well I am making a little progress on the DIY XBee controller and having it run my Brat. Soon will be converting the MechBrat to XBee. I have the actual remote now back in one piece. It is not as shiny as when it was new, but I did hack up a piece of the same material as the top to cover the old hole where the transmitter was and then used some standoffs to attach the larger XBEE holder to it...
Attachment:
The attachment DIY-Remote-Xbee.jpg is no longer available


I have the code in place for a few different views/configuration pages. I can set the XBee My address of the controller, and select the destination by its MY address (XBee Destination low). I have not fully tested the changing of the MY. If this works OK, I may also add a new page that allows me to tell the Remote I am talking to to change It's MY address. This should make it easier to have multiples of these in the same area. I have two ways to display the data. The way that the old DIY receiver had, which showed all of the joystick and slider values. The new one is shown in the above picture, that tries to show which item may be changing in the top row. So if you move the right joystick, it will change to display Right and the X, Y... Second line is for data from remote...

The current code is talking. I still need to get the beginning/ending handshake to work a little better, but I can get them to talk. I also have added code to the Brat/DIY that allows me to go into a mode that I only transmit data when it changes. I currently select that by hitting the E key on the remote. This is starting to work reasonably well, but I did find that if I had the brat walking and then turned off the remote, it continued to walk. So I need to put in a little more handshake here. Maybe have the brat ask every 1/2 second or so for data will be sufficient.

As I mentioned, the second display line is for data from the remote. I hacked in some code that when I press the D key on the remote, my brat uses the Sharp IR sensor and does a ping and converts the value into CM and then sends the data back to the DIY. So that 80 in the second display was the last value I displayed.

I thought I would checkpoint the code up here.

Whats next:
More debugging.
Maybe try to convert to hight XBEE baud rate
Maybe simple program to preconfigure the XBEEs. I can do using USB to computer but others may not...
Configure the remote MY
Move to using Mech Brat
Try Rover?
clean up code.

That is all for now
Kurt
I also have the


Attachment:
DIY-Remote-Xbee.jpg
DIY-Remote-Xbee.jpg [ 24.26 KiB | Viewed 1614 times ]
User avatar
Guru ( offline )
Posts: 2133
Posted: 2009-10-16 14:32 
Great work Kurt!
Looking good, but you've got to sandblast the front cover... :wink:

I've not studied your code yet, but I feel very tempted to try out the XBEE's one time (have to order them first).

Btw, did I see some robot feet (rubber end caps) on your joysticks? :o

_________________
Kåre Halvorsen, Zenta
-----------------------------------------
Zenta's blog
http://zentasrobots.com/
Zenta's YouTube channel
http://www.youtube.com/ZentaOlbaid
-----------------------------------------


User avatar
Guru ( offline )
Posts: 4942
Posted: 2009-10-17 10:30 
Thanks Zenta,

I know, I Know, but I don't have a sand blaster :lol: I thought about using a sander, but...

As you probably know, I have been thinking about trying out the XBees for awhile. So I started buying different XBEEs to play with. I have some Series 1s and some Series 2.5s. The two different series can not talk to each other. I think I now have 4 of the series 1s that I will be using. Maybe I will pick up a few more. I would also like to play with a VB/VC type one on the PC that can be used as a controller or a reporting station. But we will see where my interests go...

I did not put on rubber caps, but maybe James did. You can see it in the pictures when they were building them. http://www.lynxmotion.net/viewtopic.php?f=21&t=4399&start=137. Mine is probably on the the bottom left.

How are your projects coming? If it is like here your summer is probably ending, which hopefully will give you some more time to work on them. :D

Kurt


User avatar
Guru ( offline )
Posts: 2133
Posted: 2009-10-17 12:45 
kurte wrote:
I know, I Know, but I don't have a sand blaster :lol: I thought about using a sander, but...
:lol: I guess you just have to try handsanding then. Try carefully at the backside to see the effect.

kurte wrote:
I have some Series 1s and some Series 2.5s. The two different series can not talk to each other.
Oh I wasn't aware of the different series. I'm a bit unsure of what XBEE holder to use. They won't ship the selmaware board outside US :cry: . I probably have to search a bit more to find other distributors.

kurte wrote:
I did not put on rubber caps, but maybe James did. You can see it in the pictures when they were building them. http://www.lynxmotion.net/viewtopic.php?f=21&t=4399&start=137. Mine is probably on the the bottom left.
Ah! That picture explains it!

kurte wrote:
How are your projects coming? If it is like here your summer is probably ending, which hopefully will give you some more time to work on them. :D


I'm waiting for some LM parts for starting building some new robots :wink: . I've not done much with the A-Pod or Felix code yet. Beside robotics I've been busy with several outdoor projects. But you are correct about the summer season. The indoor season are ahead (= robotic season !).

_________________
Kåre Halvorsen, Zenta
-----------------------------------------
Zenta's blog
http://zentasrobots.com/
Zenta's YouTube channel
http://www.youtube.com/ZentaOlbaid
-----------------------------------------


User avatar
Guru ( offline )
Posts: 4942
Posted: 2009-10-17 14:11 
zenta wrote:
kurte wrote:
I have some Series 1s and some Series 2.5s. The two different series can not talk to each other.
Oh I wasn't aware of the different series. I'm a bit unsure of what XBEE holder to use. They won't ship the selmaware board outside US :cry: . I probably have to search a bit more to find other distributors.

The two series XBees are pin wise and electrically the same, they simply have different protocols built into them, so any holder should work.

I have a few of the selmaware boards. One of them is shown in the picture. I also am using the Sparkfun one http://www.sparkfun.com/commerce/product_info.php?products_id=9132. The bright side about the sparkfun ones is that they are half the cost and much much smaller. I am using one of them on the Brat, And will use the second one probably on the other brat. My guess is you can order them for one of the European distributors. I also have one of their USB ones http://www.sparkfun.com/commerce/product_info.php?products_id=8687 that I first tried to be able to reprogram the XBEES. I sometimes found It saying hit the reset button, which these don't have so I now have one of the DIGI boards that selma recommended (purchased from Digi-key http://search.digikey.com/scripts/DkSearch/dksus.dll?lang=en&site=US&WT.z_homepage_link=hp_go_button&KeyWords=XBIB-U).

I used the DIGI X-CTU software on the PC to pre-setup some of the XBEE settings, like the baud rate. I could (and was) doing this on the fly each time with the BAP software, but there are some problems, like if the CPU resets, the XBEE will not have reset and still be at the high baud rate and may not be easy to talk to. So far there is no easy way to know if the CPU reset or was powered on. Could probably rig up something. Like a capacitor circuit hooked up to one of the analog pins, that you check at startup. If done fast enough you may be able to capture the fact the voltage has not built up yet...

I will probably build a simple program that allows you to preconfigure the XBEES from the BAP and maybe add more configuration stuff to the DIY that allows it to set more of the settings on the Robot side... Will see how far I go.

zenta wrote:
kurte wrote:
How are your projects coming? If it is like here your summer is probably ending, which hopefully will give you some more time to work on them. :D


I'm waiting for some LM parts for starting building some new robots :wink: . I've not done much with the A-Pod or Felix code yet. Beside robotics I've been busy with several outdoor projects. But you are correct about the summer season. The indoor season are ahead (= robotic season !).

Cann't wait to see what you come up with this year!


User avatar
Guru ( offline )
Posts: 2133
Posted: 2009-10-18 11:52 
Thanks for all the information Kurt!

So, if I understand you correct I can use the smallest XBEE explorer board from Sparkfun on the DIY remote and use the code you posted without any problem? I think I go for the 1 series at first. Does the same code you made work for series 2,5 too?

Btw, I did find a swedish distributor too.

_________________
Kåre Halvorsen, Zenta
-----------------------------------------
Zenta's blog
http://zentasrobots.com/
Zenta's YouTube channel
http://www.youtube.com/ZentaOlbaid
-----------------------------------------


User avatar
Guru ( offline )
Posts: 4942
Posted: 2009-10-18 12:07 
Yes, the Sparkfun regulated explorer board appears to work just fine. Earlier some of us were trying to figure out how they did the voltage conversions, but so far works great.

As for code running on Series 2 (2.5) chips, I believe that I need to make some changes, to make it work. May try later as I do have two of the Series 2 Pros sitting here.

As for not any problems, it still is a work in progress... :lol:


1, 2, 3, 4, 5, 6, 7 ... 35

All times are UTC - 5 hours [ DST ]. It is currently 2018-06-19 06:00