PDA

View Full Version : Too Complex for a PICAXE?!



Gussy
22-01-2006, 02:11
Ohk well what started in my head a simple 434 wireless MOSFET switching controller, has got a bit trickier, i think.

I have started to draw all my circuits out on paper for both the remote and the controller, and while doing so, have thought up a potential problem...

The Problem:
What i want to do is control 3 mosfets wirelessley, simple i thought, but, i do not want to simply switch on, leave on for ages, then switch off, i want to either open the mosfets in short stabs, of "hold" them open with a switch on the remote, ohk so i thought this wouldn't be too hard, i simply send a on off command... but, what if i want to hold one switch open, and stab at the other giving short bursts...

I think i could send an on off command every time a button state is finished.

The "holds" would be anywhere from 2-20secs and the stabs would be about 1sec long.

What I'm worried about is how responsive this will be, i *need* this to be pretty much instantaneous but i can give or take a bit, but ultimately, i would like it to be as far <500ms as possible...

So, am i in over my head, and should i rethink the whole project, or is the acheavible?

Cheers,
Gussy

markdem
22-01-2006, 02:14
Hi there, i guess you could just send the states for all the switches to the remote side once every 100ms insted of just sending a command when the switch is pressed.

Mark

Gussy
22-01-2006, 02:28
I wonder...
If i sent the commands every 100ms, i would only need to send something like "0112"
The first 3 being the mosfets and the 4th being the position of a servo, 0-2...

What sort of delay there would be over the 433 link, does anyone think that the RX could pick up a signal every 100ms? If not how long?

andypro
22-01-2006, 02:51
The wireless link will work as fast as the serial stream that feeds it.

So...if your sending bits at, say, 2400 baud, it would be (1/2400)*10 (for start and stop bits, plus 8 data bits). That would be 4.1ms per byte. Then tack on about 250 microseconds per command on the picaxe (some faster, some slower).

So you'd have 4.1ms plus transit time, say, bump it up to 6ms for safety, plus say 400uS jsut to be safe per command (although that's a bit much) and your up to, say, 10 or 15ms at the most every time you hit the button and thigns take place. 500ms should be well easily handled.

--Andy P

Gussy
22-01-2006, 03:10
Ah, exactly what i wanted to know, cheers, 15ms is a very nice figure even once i put on time for processing and switching of the mosfets..

YAY!! I dont have to ditch my original ideas and start again!

andypro
22-01-2006, 04:36
Something I didn't think of for my earlier post...

If your going to send something like "0112" That would be 4 bytes. So it would be 4.1*4 or 16.4ms minimum to send the 4 bytes, plus overhead at the picaxe side. So your looking at, with I'm guessing at what your doing, porbably 20-25ms on the long side for data sending and processing. Still well within your 100ms cycle, but somehting to think about.

--Andy P

Edit PS: The processing overhead I'm talking about with the picaxe IS the time to switch the mosfets and move the servo, etc. Just another heads up :)



Edited by - andypro on 1/22/2006 3:37:46 AM

Gussy
22-01-2006, 08:44
thanks, even 50ms would be fine, as thas prety damn fast anyway. Ive drawn up the circuit for the remote now and starting on the controller...

frankeltham
23-01-2006, 09:57
For simple on-offs why couldn't you send up to 8 channels worth in a single byte? i.e. use bits. You could afford to send data twice then as a check.
P.S. Are you using longish range 434MHz devices for pronlonged periods? Is your next door neighbour going to be able open his car?
PPS. In my recent project using 25mW 434 in a built-up area (in the UK) it also interfered badly with DTT reception. And the wife shouted at me and burnt my anorak.