www.robowars.org

RoboWars Australia Forum Index -> Technical Chat

Simple relay controler Idea.
Goto page 1, 2, 3  Next

Post new topic   Reply to topic
  Author    Thread
dyrodium
Experienced Roboteer


Joined: 24 Aug 2004
Posts: 6476
Location: Sydney


 Reply with quote  
Simple relay controler Idea.

HEy guys! I was just thinking of a way that you could use relays and diodes to make a really simple bot control. Couldn't you just hook up the power wires from the reciever (not the data one) and, when the current is one direction, one relay goes on, but the diode stops the other from going on (stops the reverse current), and vice versa. I don't know if there are diodes that can handle reverse 6v for long periods of time, and I was just wondering if it works (i'm giong to test it anyway).
It would be real cheap too!
Any thoughts?
_________________
( •_•)

( •_•)>⌐■-■

(⌐■_■)

YEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH

Post Thu Feb 17, 2005 9:48 am 
 View user's profile Send private message Visit poster's website MSN Messenger
Spockie-Tech
Site Admin


Joined: 31 May 2004
Posts: 3160
Location: Melbourne, Australia


 Reply with quote  

Dont quite understand your idea there Angus (?)

Assuming you mean the power to the servo from the receiver on the 3-pin servo cable, it doesnt turn on and off when the servo moves, it just stays at a constant voltage (whatever the battery is at), no reversals or anything..

The position of a servo arm is controlled purely by the variable pulse-width signal on the "data" wire of the 3-wire servo plug. To sense where the servo would be and activate a relay accordingly, you need to measure the width of that pulse accurately (at *least * 1/10,000th of a second resolution), which means you need a microprocessor or some accurate timing circuits.

The good news is that a $4 PicAxe Microprocessor chip can do it quite well if you can be bothered learning how to program it and building your own simple circuit board (its just an 8 pin chip and a few wires).. To drive a big relay, you need to add a second chip to handle the relay coil current.

It gets a bit more complicated when you want to drive 4 relays, since you need the more powerful ($15) 18 pin PicAxe Micro, and then people want mixing, deadbands, failsafe, and braking in there.. but its still do-able. I published a design and the software free for everyone to use, but only a couple of people had a go at it, since it requires some fiddly fine soldering to build.

Aaron was working on some relay controllers that he was going to sell commercially based on this design.. Havent heard how thats going though..

Thats about as simple as relay control gets, without going electro-mechanical servo-switches with their associated problems. Simple diodes just wont allow you to get any useful information from the receivers pulse signal.
_________________
Great minds discuss ideas. Average minds discuss events. Small minds discuss people

Post Thu Feb 17, 2005 11:46 am 
 View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
dyrodium
Experienced Roboteer


Joined: 24 Aug 2004
Posts: 6476
Location: Sydney


 Reply with quote  

So the reciever just supplies a constant voltage to the servo? Damn! I was assuming that the current was reversed when you pulled the transmitter stick back. But then how do people hack servo's to turn continualy? That would surely mean that theres a constant voltage? Also, how complicated and expensive is it to use/program PicAxe's? Thanks
_________________
( •_•)

( •_•)>⌐■-■

(⌐■_■)

YEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH

Post Thu Feb 17, 2005 12:06 pm 
 View user's profile Send private message Visit poster's website MSN Messenger
Nexus
Experienced Roboteer


Joined: 17 Jun 2004
Posts: 903


 Reply with quote  

Heres a link to how the tank guys do it. THeres a few examples of different methods.
Might be helpful to read this.

http://www.rctankcombat.com/articles/speed-control/
_________________
Bots that do not destroy you, only make you stronger.

Post Thu Feb 17, 2005 12:29 pm 
 View user's profile Send private message
Spockie-Tech
Site Admin


Joined: 31 May 2004
Posts: 3160
Location: Melbourne, Australia


 Reply with quote  

Yes, the receiver supplies a constant voltage to the servo.. it doesnt vary in polarity or voltage.. its just a supply of power to the servo.

The servo contains a custom servo-control chip that measures the width of the incoming servo control pulse from the receiver, and compares that with the resistance value of a potentiometer attached to the servo's output shaft.

If the servo-drive signal says "I want you to be 1/2 forward" (1.75mS pulse width), but the position sensing pot tells the chip that the output shaft is presently in the center, then the servo drive chip applies power to the motor with the correct polarity to spin the motor "forward" until the sensing pot says its at that position.

If the servo input then says I want you to be full back (1mS width pulse), then the chip sees that due to the current position of the feedback pot, it needs to spin the motor backwards, so it applies a reverse polarity signal to the motor until the feedback pot tells it that it has reached full back..

Note that this all happens *inside* the servo, and before you ask (since many have tried before Smile ), you cant easily do your diode/relay idea by tapping into the actual motor drive wires inside the servo either, because the actual motor is driven by PWM (Pulse Width Modulated) signals that will cause a relay to buzz on and off, rather than a constant voltage.


To modify a servo for continuous rotation, you just disconnect the feedback pot and either glue it in the cetner position, or replace it with a fixed resistor that tells the chip that it is in the center position.. that way, as long as the receiver is telling the servo to be in the center, all is well. If the receiver tells the servo to move to any other position, the servo tries to, but because the feedback pot isnt connected, it will never get there (as far as the chip can tell), so the motor will just keep turning until you return the stick to center.

Programming PicAxe's is relatively easy (compared to most microcontrollers).. you just need a 9-pin plug for the serial port on your computer, with 3 wires attached to it. These connect to your PicAxe micro (through a couple of resistors) and you run the free programming software on your PC.. Total cost about $5-$10..

Of course, if you've never done any programming before, and dont understand the difference between logic high and low, or inputs and outputs, and dont know a millisecond from a duty cycle, then you have a bit of learning to do first.. but PicAxes are a good starting point to play with if you like electronics.

lots of info over at www.picaxe.com

@George.. That link is a good one showing how to make servo switches and basics of speed control really well.. have to bookmark that one..
_________________
Great minds discuss ideas. Average minds discuss events. Small minds discuss people

Post Thu Feb 17, 2005 12:32 pm 
 View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
dyrodium
Experienced Roboteer


Joined: 24 Aug 2004
Posts: 6476
Location: Sydney


 Reply with quote  

I know a fair bit about object_oriented programing (thanks to Never Winter Nights and java (java's sort of object-oriented) Very Happy . So the total cost is $10! Does that include the programing board? and also, after I get one, where could I get hold of the programing you did (as a guide). Thanks! Very Happy
_________________
( •_•)

( •_•)>⌐■-■

(⌐■_■)

YEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH

Post Thu Feb 17, 2005 12:51 pm 
 View user's profile Send private message Visit poster's website MSN Messenger
ffej
Experienced Roboteer


Joined: 22 Jun 2004
Posts: 595
Location: Kurrajong, NSW


 Reply with quote  

If you have the servo's, all you need are four resistors, two SPST relays, two caps and two NPN transistors per channel. Hack the servo apart, keep the board and the trimpot.

Basicly all your doing is filtering the PWM output that would normally be going into the servo motor, and turning it into a constant voltage thats either above or below the relay turn on voltage threshhold. This is the principal the original Singularity used and Catalyst before that.

When I dont have a bio assignment to do, ill fire up eagle and do a diagram . . .
_________________
Jeff Ferrara
fb@ffej.net

ffej.net

Post Thu Feb 17, 2005 7:58 pm 
 View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Timothy Forde
Experienced Roboteer


Joined: 16 Jun 2004
Posts: 247
Location: Vic ,Belgrave South


 Reply with quote  

Yea I was fidling with this idea before I got a ibc and had it working (kinda) just seems to be a bit hard.
Really though make that pic board brett is talking about as I can tell you it's won't really be any harder or fiddly and when you take into accout the servos, caps and diods it's not really any more price wise. You also get a failsafe from it and I think more reliablity
_________________
Team KO

Post Fri Feb 18, 2005 4:39 pm 
 View user's profile Send private message Send e-mail MSN Messenger
Glen
Experienced Roboteer


Joined: 16 Jun 2004
Posts: 9481
Location: Where you least expect


 Reply with quote  

theres a diagram you posted for us one the first or second page of the public album IIRC.
_________________
www.demon50s.com - Minimoto parts
http://www.youtube.com/user/HyzerGlen - Videoooozzz

Post Fri Feb 18, 2005 4:45 pm 
 View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
dyrodium
Experienced Roboteer


Joined: 24 Aug 2004
Posts: 6476
Location: Sydney


 Reply with quote  

Hey brett, where do you get PICAXE's and their programers? I can't seem to find them anywhere! Also, do the programers require soldering? I can't solder too well. I'd buy them through you if I have too. Confused
_________________
( •_•)

( •_•)>⌐■-■

(⌐■_■)

YEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH

Post Sat Feb 19, 2005 7:44 pm 
 View user's profile Send private message Visit poster's website MSN Messenger
Knightrous
Site Admin


Joined: 15 Jun 2004
Posts: 8511
Location: NSW


 Reply with quote  

http://www.microzed.com.au/
that should get you to the aussie distributors of PicAxe.
_________________
https://www.halfdonethings.com/

Post Sat Feb 19, 2005 9:15 pm 
 View user's profile Send private message
dyrodium
Experienced Roboteer


Joined: 24 Aug 2004
Posts: 6476
Location: Sydney


 Reply with quote  

Hmm, I don't think I've seen a worse set-out site in my life! Laughing
_________________
( •_•)

( •_•)>⌐■-■

(⌐■_■)

YEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH

Post Sun Feb 20, 2005 8:56 am 
 View user's profile Send private message Visit poster's website MSN Messenger
Valen
Experienced Roboteer


Joined: 07 Jul 2004
Posts: 4436
Location: Sydney


 Reply with quote  

aside from their use of flashing text and frames its actually quite easy to navigate, and dosent have any flash or java that i could see.
all plusses from my pov
i found the picaxe dev kit in about 3 seconds
_________________
Mechanical engineers build weapons, civil engineers build targets

Post Sun Feb 20, 2005 9:56 am 
 View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
Spockie-Tech
Site Admin


Joined: 31 May 2004
Posts: 3160
Location: Melbourne, Australia


 Reply with quote  

Yes, I've thought that on occasion myself.. Confused

I think the site is probably done by the guy who operates MicroZed and while he seems to know his stuff on PicAxe's, his web-design skills are obviously a little limited.. Done in Frontpage too (blech). Silvertone Electronics is very similair, and Bob does that in Word (!)..

Still, all the info you need is there, it just takes a bit of searching around to find it.. Laughing

Perhaps someone should offer them a web-site re-design in return for some parts or something..Wink (before any eager young robot builder takes this seriously and rushes off to do this, remember its a good idea to have actually already done a quality website of your own to show your skills before seeking "sponsorship" like that)

Anyway, back on topic, heres a link to a copy of the current code I wrote for the PRC (Pic Relay Controller) that was running Vincent at RoboWars II.

http://www.robowars.org/docs/PRC-v1.2-code.txt

(make sure you have word wrap turned off in whatever you display it in, or else the long comments will wrap around and mess up the formatting of the code and make it harder to read)

Note that Microcode is usually *not* object-orientated in any way. it tends to be very linear, loop-based code, since OO code tends to require some form of supervisory level (usually an operating system) watching for a particular event to occur and then deciding to run the relevant block of code.

In a micro the closest you get to a supervisory system triggering events for you is the I/O or Timer interrupts, so the code has to run in loops watching for trigger conditions itself. makes it more "realtime" too, which is important when you are timing milli-second long pulses.

It could probbaly still do with a few tweaks, and to anyone who wants to build one, make sure the Pic-Axe micro has a well filtered power supply (nice big caps on the input) to stop it from glitching under the power spikes of your motors slamming on and off at full power. Vincent was occasionally getting stuck in a "locked-up" state with the micro crashed until we added some big caps to the micro power supply.

If anyone has any questions.. feel free to ask.
_________________
Great minds discuss ideas. Average minds discuss events. Small minds discuss people

Post Sun Feb 20, 2005 1:24 pm 
 View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
kkeerroo
Experienced Roboteer


Joined: 17 Jun 2004
Posts: 1459
Location: Brisbane


 Reply with quote  

Electrical noise interfering with the picaxes power supply can be avoided by useing a receiver battery and taking the picaxes power from the servo lines and not from the battery supplying the motors. This will also avoid trouble of setting up a BEC. If you can't run the coils of the rellay from the receiver battery like in the team delta switches then I sugest using opto-couplers between the micro and the higher voltage coils.
_________________
Get Some!!!

Secretary of the Queensland Robotics Sports Club inc.

Post Mon Feb 21, 2005 7:34 am 
 View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
  Display posts from previous:      

Forum Jump:
Jump to:  

Post new topic   Reply to topic
Page 1 of 3

Goto page 1, 2, 3  Next

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.