www.robowars.org

RoboWars Australia Forum Index -> Builders Reports

Planners - 900Mhz Radio


Post new topic   Reply to topic
  Author    Thread
Valen
Experienced Roboteer


Joined: 07 Jul 2004
Posts: 4436
Location: Sydney


 Reply with quote  
Planners - 900Mhz Radio

Thaught it deserved its own thread

ITS ALIVE!!!



or for the hardcore viewers out there
http://valen.botclips.net/900mhz/Its%20ALIVE.jpg


basically 900mhz radio + pic running 3x servo chanells.
all digital like
had it running ok with 98% bad packets and 10% packet loss too
(also it ran the servo ok up to 400Hz, little jittery though ;->)

one directional atm but getting the bot to send stuff back shouldnt be too hard

biggest problem atm is the fact its controll software is written in VB and when it draws to the screen it takes it an age and a half, net result my dual Xeon 3.06 some times drops packets (transmission)

input is via Direct-X so pretty much anything should work perhaps some kind of USB wheel so i can run it off the laptop.

Phase 2 of controll software is to make the screen updates in direct X or at least using drawing API's to speed them up, that should make the CPU use somewhat more sane.
_________________
Mechanical engineers build weapons, civil engineers build targets

Post Mon Dec 26, 2005 11:50 am 
 View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
Valen
Experienced Roboteer


Joined: 07 Jul 2004
Posts: 4436
Location: Sydney


 Reply with quote  

Progress
getting into the detailed design of doing an interrupt based servo output is becomming a pain. Its easy enough to think the logic up to drive it but implementing it looks like a pain in the behind. I wanted it to only interrupt either on a timer rollover or just when it needed to change a servo state.

Discoveries
Also i found out why that spectrum mob (and all the other radio people) have a max of 6 chans. its the most you can have before you have to start outputting servo pulses in parallell, basically all the times for the pulses add up such that if you put them out one after the other you take too long to put 50 per chan per second out.

Rant
Still the spectrum people presumablly could use some stupidly high rate interrupt and drive as many servo lines as they wanted off it. The IBC works in a simmilar way and its onrly running 12Mhz, put a scenix 75Mhz chip in and you could do anything you wanted (even if you have to deal with their daft banking arrangement)

Where Do We Go From Here
I'm going to go down the "Brain Transplant" path for now and directlly drive the HIP chips. The 16F877A has 2 hardware PWM outputs so my code can be just sitting there wating for radio data while the PWM is taking care of itself.
Down side to this is it'll be a pain to drive the Victor in a Plan-F style bot, what its coming to is needing some kind of "switch" like a network switch.
you could have a number of radios in the bot (say 2) and anywhere up to 6 motor controlls (all addressed serially in my wet dream) all of which have bi-directional data.
You either make some funky switchgear (4 ch uarts seem only to come in 64pin smt packages euuuch) or in a recent thaught, run the buss at say 115200BPS (max speed for the radio) and do some kinda token ring setup with all the serial points sharing a common buss.

Also have been thinking about using some kind of fiber optic comminications, (Think xmass tree fiber optic thingies), should make for RFI immunity and electical isolation for sensitive bits, might also help prevent one item taking down the whole buss, course you cant have a "multi drop" network with that its all point>point
_________________
Mechanical engineers build weapons, civil engineers build targets

Post Mon Dec 26, 2005 12:05 pm 
 View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
Valen
Experienced Roboteer


Joined: 07 Jul 2004
Posts: 4436
Location: Sydney


 Reply with quote  

Hrmmm
CANbus?
_________________
Mechanical engineers build weapons, civil engineers build targets

Post Mon Dec 26, 2005 12:07 pm 
 View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
Valen
Experienced Roboteer


Joined: 07 Jul 2004
Posts: 4436
Location: Sydney


 Reply with quote  

Captains Log : Argh!

well a fair bit of progress to report
got the "Brain transplant" working ;->
all was going according to plan but then i re-organised the code to make it easier to read.
big mistake
the thing stops recieving data propperly or stops doing something anyway and end result is it just dosent work. 2 days of debugging later i decide "stuff it" and just get my last working bit of code and plonk that in, all works fine now. then i add in the other modules (transmit back to the PC and failsafing) and all is working well.


grrrr.


got myself an X-Box controller, hacked the end off (sob, theres something wrong about buying something then hacking it up before it even gets used once) and connected a USB plug, that all seems to be working now too so that will be the bot controller for robowars.
i would have liked a steering wheel to get the axes of controll seperated and to have a large range of movement for fine controll but we always had the problem of how one does throttle.
The best controller we can think of at this point in time is a flight yoke, as they have a return to centre on the push-pull axis.

actually fitting the radio into the space allowed is becoming difficult, the 40 PIN PIC isnt small when you add 2x diodes a 1K cap and a 3.3uF eletrolytic cap per a/d channell (of which there are Cool and then you need to actually mount it somewhere.
We are thinking of monitoring
Left motor, current and temperature
Right motor, current and temperature

Quite happy with the failsafe, works exactly as advertised, half second worth of run on then it turns off over the next half second.

got 2 way information flowing, (IE the PIC sends dummy info back to the PC)


still to do
get the PIC reading the AD inputs,
make a board to mount the pic on and the radio
possibly another board to mount the A/D protection circutry on.


pictures and code to follow
_________________
Mechanical engineers build weapons, civil engineers build targets

Post Sat Jan 07, 2006 5:25 pm 
 View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
Valen
Experienced Roboteer


Joined: 07 Jul 2004
Posts: 4436
Location: Sydney


 Reply with quote  

include 16F877_20
include jlib
include jpic
include USARTlib
include SerialProjInfo
include pwmdrive
include TransmitData
include TimerInterrupt

-- include SPIlib
-- include radiolib
-- include interval
-- include servo_functions

init_USART
Send_Info


pin_b7_direction = output -- power and corrupt data
pin_b6_direction = output -- Loss Of synch or overlong packet
pin_b5_direction = output -- Direction Controll
pin_b4_direction = output -- Direction Controll
pin_b3_direction = output -- interrupt running
pin_b2_direction = output -- loss of signal
pin_b1_direction = output -- transmitting
pin_b0_direction = output

-- pin_b7 = on -- indicate power on
forever loop
if rcif then


var bit rxSignal -- flag indicates to interrupt a signal has been recieved since last intrrupt
var bit ValidPacket
var byte rxptr
var byte packetmode
var byte check

var byte rxdata
async_rx(rxdata)


rxptr = rxptr + 1 -- always increment rxptr
-- make sure this is larger than the largest packet
if rxptr > 7 then rxptr = 1 end if -- catch it if we have fucked up (loss of synch etc)

if rxptr == 1 then packetmode = rxdata end if

if (packetmode == 1) then
-- loss of synch, OR with all other valid packet types
-- check will catch any invalid packets before enacting them
-- default is true as its conecptually easier
pin_b6 = off
else
packetmode = 0
rxptr = 0
pin_b6 = on
end if

if (packetmode == 1) then
-- we are recieving a motor drive packet
if rxptr == 2 then seqid = rxdata end if
if rxptr == 3 then ch1 = rxdata end if
if rxptr == 4 then ch2 = rxdata end if
if rxptr == 5 then ch3 = rxdata end if
if rxptr == 6 then opts = rxdata end if
if rxptr == 7 then
-- packet finished
check = rxdata

-- check validitity
var byte doublecheck
doublecheck = 0
doublecheck = doublecheck + packetmode
doublecheck = doublecheck + seqid
doublecheck = doublecheck + ch1
doublecheck = doublecheck + ch2
doublecheck = doublecheck + ch3
doublecheck = doublecheck + opts

-- async_tx(doublecheck)

if (doublecheck == check) then
rxSignal = true
drivemotors
pin_b7 = off
rxedPackets = rxedPackets + 1
else
pin_b7 = on
end if
rxptr = 0
end if
end if
End If
if TXPacketNeeded then transmit end if
end loop
_________________
Mechanical engineers build weapons, civil engineers build targets

Post Sat Jan 07, 2006 5:25 pm 
 View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
Valen
Experienced Roboteer


Joined: 07 Jul 2004
Posts: 4436
Location: Sydney


 Reply with quote  

http://valen.botclips.net/900mhz/new%20radio%20screenshot.JPG

i'm still on holidays but eh i got the laptop so i thaught i'd play

the PC software at robowars was hacked togther pretty quick
so i am making a new version
my first attempt at using bitblt and its nice and smooooth
nifty smooth animation and no flikering = cool

Downside
using windows API calls and doing 2x full screen blits i only get 24FPS on my laptop
which also means only sending 24 packets/s instead of 400 that i want to send
damn and blast.

So I will now attempt to convert to DirectX 7 and DirectDraw so i can use (better) hardware acceleration and hopefully get a frame rate of like 60FPS min (which i'll trim to 30FPS so i can make with the blasting of the packets of data)
_________________
Mechanical engineers build weapons, civil engineers build targets

Post Wed Jan 25, 2006 11:07 am 
 View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
NMO
Experienced Roboteer


Joined: 16 Jun 2004
Posts: 486
Location: Melbourne


 Reply with quote  

Jake, where did you get the transceiver modules from and do they allow channel selection?

It would be nice to have a few people running them.

Post Sat Feb 04, 2006 11:20 am 
 View user's profile Send private message
Valen
Experienced Roboteer


Joined: 07 Jul 2004
Posts: 4436
Location: Sydney


 Reply with quote  

maxstream and yes
6x spread spectrum chans or something like 100 single freq ones.

you can also run multiplle bots off one transmitter in the arena.

in theory you could run 12 bots with 50 updates/s
(keeping in mind that 10 is ok and 4 is useablle)

orderd from digikey

But i would like to get the 2.4Ghz laipac ones running as they are ~$4 per chip not $50
_________________
Mechanical engineers build weapons, civil engineers build targets

Post Sat Feb 04, 2006 9:44 pm 
 View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
  Display posts from previous:      

Forum Jump:
Jump to:  

Post new topic   Reply to topic
Page 1 of 1


Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Last Thread | Next Thread  >
Powered by phpBB: © 2001 phpBB Group
millenniumFalcon Template By Vereor.