DIY Remote Control XBee controller for Robotics

here is the beta code of diy
there is a little problem to display joystick values in the 2 mode.
some garbage char appears…
i’ll post the last sourcecode saturday.






diy transmitter for serlcd2.5b.zip (45.9 KB)

Looks like you are making some good progress!. Often with garbage characters on the display it is due to HSERIAL interrupts happening while characters are being output to the display. That is where it is nice to use the RTS line as you can tell the XBee to not send you anything and you can put a call in to make sure the Hserial output queue is empty…

Kurt

display of different joy and slide value bug solved.

here is the final code.

DoLCDDisplay[bLCDX, bLCDY, bLCDChar, bLCDNum]

abLCDBuff = 254, %10000000+ bLCDX-1+ (bLCDY-1)*64		
if bLCDChar <> 0 then
	abLCDBuff(2) = bLCDChar
	cbLCDOut = 5
else
	; May later handle +- types of numbers
	abLCDBuff(2) = dec4 bLCDNum\4
	bLCDChar = 2
	while (bLCDChar < 7) and (abLCDBuff(bLCDChar) = "0")		; reuse the passed in char field as an index
		abLCDBuff(bLCDChar) = " " ; remove leading zeros
		bLCDChar = bLCDChar + 1
	wend
	cbLCDOut = 8
endif	

; now lets call our taserout function
gosub TASerout[Display, i19200, @abLCDBuff, cbLCDOut-2]


return

diy remote for sparkfun 2.5(rc).zip (45.9 KB)

Sorry for posting here…

i want to know what you think. If i get one of those:
robotshop.ca/microcontroleur … usb-2.html

Would it be easy to make my own Transmitter ?
I plan to use xBee

Tanks

The answer is maybe, but It will be close on IO lines here.
This has 6 Analog pins and 14 digital only one UART which is used by USB…
6 Analog: Good for 2 joysticks plus 2 sliders (Good)

2 digital/UART for USB
9 pins for Keyboard plus 4 extra buttons. Could use external chip and maybe save - was somewhere in threads…
2-3 pins for XBee - probably need RTS here…
1 pin for LCD display
1? maybe for some speaker…

Now if you used one of these: nkcelectronics.com/seeeduino … mbled.html
or the like, there would be plenty of Uarts and IO pins you could do a lot.

Working with XBees may be fun on the the Arduino, especially if you need to use the software serial library, as you only receive characters when you are in the read statement, I don’t think they have any concept of the RTS line, so you either have to roll your own protocol to handle the communications or maybe a new software interface…

Kurt

Tanks Kurte,

It’s the same as this one i guess
robotshop.ca/microcontroleur-seeeduino-mega-seeedstudio.html

With your experience, witch way should i go… lol

Yep looks like same one. Probably depends on shipping costs. NKCElectronics had it for $42.50 and robotshop.ca had it for $48.50… Personally I like the megas and have purchased the one I mentioned as well as the official Mega…

Kurt

Quick and Dirty minor update,

I was playing around with the C version of the phoenix code and testing out AtoD conversions and thought I would add in the code that checked the battery status and display the current voltage on the DIY remote control. But I have two batteries and thought it would be nice to display both voltages, but my old Display Value would only display one value. There is room to probably display 3 values, so did a quick and dirty version, with 3 new display values (0 goes in col 0, 1 goes to col 6, 2 goes to col 13).

I added support in the remote control code, I also did it to my C version as well as my combined Arc32 phoenix code (the one that works with or without the SSC-32…)…

Kurt
Diy Transmitter - back to zenta.zip (95.4 KB)

hello,
i’ve two ideas for the remote …interesting or not
First.

toggle display of second line with [enter] key to display date time voltage(Zenta) :

first line:  Left/right/key:    POSX   POSY 

second line: HH:MM V:xx.x
HH:MM dd/mm/yy
dd/mm/yy V:xx.x

i don’t know if a low power state mode exist on bap for remain time or rtc built in. a second battery (3V)+ pic can do the same. I’m looking on web after post.

possibility to switch on /off xbee+LCD to keep time. Date is a simple formula

Second.

a new extended feature:

a loader for configuration file of predifined functions for all type of projects
.
Editing sequences, etc
need to allocate some reserved place in EEPROM to store all

lenght of space occuped is constant

i’ve already added a part in the menu of remote [Loading .Bin] Loading by xbee

===============================
file header(vb6 declaration :confused: )
index as byte
botname or xbeeSerial as string
HexValueKeypadLink(00 to FF) as byte (sbyte for bap)
NumberOfCommand as byte
CommandArray() as integer ; low nibble is for
the time of one command
high nibble is for command

All ideas are interesting! Also that is the fun with the DIY control, each of us can decide what it is we want :slight_smile:

For me, I am not that interested in Date/Time, but that is just me… The BAP does not have any RTC. You can always add one external to it and assuming you have some IO line(s) available can read one in.

There are times I really wish, I could display more information and am at times tempted to replace the LCD display with either one with 4 lines of text or something like the graphic one mentioned in this or a different thread. For example with the phoenix, It would be great to be able to display what mode we are in (Walking, rotation…), What is the current Gait, Is balance mode on, Voltages (both for robot and the remote)…

Part 2 - I earlier made the decision for my usage of the remote, that I wanted the remote to know nothing about the robot it was connected to. It simply sent it data and displayed or sounded data that the robot sent back to it. That made it easy to switch from robot to robot, you simply needed to change the destination address of the XBEE and you were off communicating with the other robot. Also it made it nice that in addition to the Remote control, you could (and I do) have something like a VB application on the PC that I can use to also control the robots and get the same messages… This works fine for me, but is this the only way to do this? No…

There are many ways to do this, which have both pluses and minuses… For example I have at times considered, adding an additional way to display messages, where I may define several different standard messages and store them in the remote control (Code space or EEPROM?). Then the robot could send a message that says display message N… There are pluses to this, which include, maybe reducing the code space on the robots (great if you are running out of room…), Smaller message imply less overhead… Also if you were doing this as part of a commercial product, you could have different language translations for these messages. Downside is, are there really very many common messages between my different robots (Hex, versus Biped, versus Rover…). I also use the messages for debugging, so would still want to keep the other method as well…

As for sequences. I personally prefer to have each of the robots themselves know their own sequences and through some command message sent from the remote to the robot have the robot do it… Also I do have pieces in place, that allow me to download sequences to the robots, which update the EEPROM (one version updates SSC-32 EEPROM, another updates EEPROM on Arc32, with my own code on the Arc32 that emulated running a sequence on the SSC-32). I don’t remember right now if I have the XBee doing this or not, but have meant to do this. This is one of the reasons I converted to Packet mode… But again this is how I have decide to make my robots work.

I could easily see how others may want the remote control to be in more in control of the robot. Could imagine for example having the remote talk to a robot that only has an SSC-32 with an XBee connected to it and having the remote be able to download and run sequences or maybe run it’s own sequences… There would be issues like packet mode will not work with just an SSC-32 so would need to switch to serial line replacement mode…

I am looking forward to see what all you come up with!

Kurt

Hi,

I am looking to build my own Transmitter.
I will more than likely use a:
robotshop.ca/microcontroleur-seeeduino-mega-seeedstudio.html

I have made a little SWK drawing to have a look of it…

It’s based on my ginbal and my uOLED-128 display.

The 2 hole on top of ginball are for 2 rotating pot, and hole on top of screen for toggles.

I don’t have any info about sliders, so aint put them yet.

Any good idea would be apreciated, ask for something… :wink:
DIY-Remote Assembly Rev1.0.jpg

Looks great. On mine I have also 4 push buttons used to configure stuff (next screen, previous screen, enter, escape). I don’t remember if your display is a touch screen? If so you can probably do it with that, otherwise you may want to think about how you wish to choose things, like which robot to talk to, etc…

Kurt

Yes good idea,

Just added thoses 4 button.
Also added the ginball i just draw.

Anyone have the specs of thoses sliders ? Just have made 2 slot… lol

Again look good!

I know there is information in the DIY RC controller thread… I believe Zenta originally found them with futureloc and Jim later found them at mouser: (viewtopic.php?f=21&t=4399&start=90)

I don’t remember, but it may be the 10K version?

Kurt

P.S - I think there may be some place in that thread where Jim mentioned the part number as well as which know he ordered, but I did not find it on my quick pass through it…

Hi Kurt,

Thanks for sharing your update! I’ll check it out when I ever get time for it…

I’ve been thinking of making a 2. DIY remote. This time I want more AD’s and the ARC-32 has plenty of them. Would it be very hard to make your code compatible with both BAP28 and ARC-32?

Hi Kurte,
i made some test with xbeerover code.
i don’t see where i can find gethservo function. probably remove on the last version of IDE
I remove it to test the arm only

Should not be difficult to make work with Arc32, in fact I think it already builds. May need a few tweeks…

Also may build an Arduino Mega version as other are interested in that.

Yep it has been removed and replaced by HSERVOIDLE AND HSERVOPOS. Look at the current manual you an download. There have been a couple threads on this.

Kurt

Hello,
this code is for sparkfun lcd module + XPotmeter version.
XBEE DIY Remote Control Modified for Sparkfun(works).zip (124 KB)

Kurte,
I some how blew out my code archive (I’ve no clue what happened) but I could you point me to the latest DIY code

Thanks
Phil

I am trying to remember what I am running these days… I think it was based on the one I sent back to Zenta awhile ago…

You may need to see in this library if I left the extra pots enabled or not… :smiley:

Kurt
Diy Transmitter - back to zenta.zip (95.4 KB)