Join MTRAS ~ MidTn Robotic Arts Society

You'll get invited to our Meetups as soon as they're scheduled!

MTRAS ~ MidTn Robotic Arts Society Message Board › Falstad's simple circuit simulator

Falstad's simple circuit simulator

Unit042
Posted Oct 19, 2009 4:47 PM
user 7619449
Lewisburg, TN
Post #: 66
Send an Email Post a Greeting
the link to the simulator:
http://falstad.com/ci...
It should load up automatically (chances are, you might need to download the java plugin)
I just downloaded a "zip archive of this applet". Once it's on your computer, unzip it, and double click "index.html"... for convenience, I just make a shortcut to the index.html file, and place the shortcut somewhere else, for easy access.

In case the interface is a bit difficult:
http://www.instructab...

New versions of the simulator are made every once in a while....

=========================
The following is aimed at Patrick: (well, not in a bad way. I'm not shooting him, but... nevermind)

My double modulated RC transmitter (on the right) and receiver (left):

Note: I am still working on this. I will eventually fix the resistor/capacitor values to consume less power. Be sure to put this on full screen, as weird things happen when components are off-screen. You can find the output signal breakdown and a screenshot of the transmitter in the files section.
If this is to big for your computer to run effectively, I can post it in separate pieces.
It starts off-syc, then is reset a few times as the "555 missing pulse detector" catches sync-out-of-place errors. If you wait a few loops, the transmitter and receiver should be in synchronization. A more detailed step-by-step explanation can be provided here, if it's too cryptic...

$ 3 1.0000000000000002E-6 3.1763992386181834 49 5.0 50
165 328 232 360 232 2 0.0
174 552 296 584 360 0 1000.0 0.0050 Channel 1
174 632 296 664 360 0 1000.0 0.203 Channel 2
d 520 328 520 392 1 0.805904783
d 584 392 584 328 1 0.805904783
w 520 392 328 360 0
w 328 360 328 328 0
c 520 392 520 424 0 1.0E-5 3.030693221972997
g 520 424 520 440 0
R 392 168 392 152 0 0 40.0 5.0 0.0 0.0 0.5
w 392 200 392 168 0
w 456 264 456 168 0
w 456 168 392 168 0
163 472 184 504 184 0 10 5.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
w 568 152 568 280 0
w 616 280 504 152 0
w 552 264 488 264 0
w 456 296 488 264 0
w 488 264 472 216 0
w 552 264 552 248 0
w 632 264 632 248 0
174 696 296 728 360 0 1000.0 0.47030000000000005 Channel 3
174 744 296 776 360 0 1000.0 0.7178000000000001 Channel 4
d 664 328 664 392 1 0.805904783
d 728 392 728 328 1 0.805904783
w 664 392 728 392 0
w 664 392 584 392 0
w 816 216 600 152 0
w 536 152 760 280 0
r 520 296 520 328 0 30.0
d 776 328 776 392 1 0.805904783
d 824 392 824 328 1 0.805904783
w 824 392 776 392 0
w 776 392 728 392 0
w 488 264 504 248 0
159 552 296 552 264 0 20.0 1.0E10
159 632 264 632 296 0 20.0 1.0E10
159 776 264 776 296 0 20.0 1.0E10
w 632 248 760 248 0
I 808 248 792 248 0 0.5
w 792 296 776 296 0
w 776 296 744 296 0
w 696 296 632 296 0
x 300 94 681 97 0 13 Note: Receiver won't allow next frame refresh unless sync is found
w 552 296 520 296 0
174 792 296 824 360 0 1000.0 0.9851000000000001 Channel 5
x 489 296 532 301 0 20 Sync
x 572 307 607 312 0 20 Ch1
x 632 287 667 292 0 20 Ch2
x 681 288 716 293 0 20 Ch3
x 730 294 765 299 0 20 Ch4
x 799 300 834 305 0 20 Ch5
w 776 264 760 248 0
w 632 248 552 248 0
r 584 392 520 392 0 75.0
x 559 424 571 430 0 24 ^
x 562 427 568 433 0 24 |
x 561 446 757 450 0 15 Determines minimum channel
x 562 463 745 467 0 15 pulse length (does not affect
x 562 482 639 486 0 15 Sync pulse)
r 584 328 552 296 0 190.0
x 329 475 423 481 0 24 Sync 0.5
x 305 402 393 406 0 15 Pulse lengths
x 304 416 395 420 0 15 (milliseconds)
x 303 432 421 436 0 15 Channels: 1 to 2.5
r 632 296 664 328 0 190.0
r 696 296 728 328 0 190.0
r 744 296 776 328 0 190.0
r 792 296 824 328 0 190.0
x 834 326 848 332 0 24 <
x 837 323 861 329 0 24 ---
x 863 325 906 331 0 24 Max
x 863 345 922 351 0 24 pulse
x 863 370 931 376 0 24 length
x 301 138 706 142 0 16 19 Channel limit with a 4017, stack them for more channels
x 282 537 335 541 0 16 pulse in
163 120 488 136 488 0 10 5.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
I 456 552 440 552 0 0.5
w 120 520 136 520 0
w 136 520 312 520 0
w 312 520 456 344 0
I 120 520 88 520 0 0.5
150 136 376 136 360 0 2 0.0
150 200 376 200 360 0 2 0.0
150 264 376 264 360 0 2 0.0
w 152 376 152 456 0
w 216 376 184 456 0
w 280 376 256 432 0
w 264 360 264 344 0
w 200 360 200 344 0
w 136 360 136 344 0
150 136 312 136 296 0 2 5.0
150 200 312 200 296 0 2 0.0
150 264 312 264 296 0 2 0.0
w 264 296 264 280 0
w 200 296 200 280 0
w 136 296 136 280 0
w 152 312 152 376 0
w 216 376 216 312 0
w 280 376 280 312 0
w 120 424 136 520 0
w 120 376 120 424 0
w 120 424 184 376 0
w 184 376 184 408 0
w 184 408 248 376 0
w 88 520 88 328 0
w 88 328 120 312 0
w 120 312 168 328 0
w 168 328 184 312 0
w 184 312 232 328 0
w 232 328 248 312 0
x 235 270 289 276 0 24 Sync
x 239 247 283 253 0 24 Ch1
x 113 273 157 279 0 24 Ch2
x 113 247 157 253 0 24 Ch3
x 174 269 218 275 0 24 Ch4
x 175 243 219 249 0 24 Ch5
x 78 197 365 200 0 13 If sync longer than 0.5 mSec, reset receiver count
x 112 559 176 562 0 10 from sync slot
r 456 552 504 552 0 10000.0
g 504 552 520 552 0
d 376 552 408 568 1 0.805904783
w 456 552 408 568 0
d 248 456 456 552 1 0.805904783
w 184 552 264 360 0
s 456 296 456 344 0 0 false
165 280 560 296 560 3 5.0
w 344 576 312 544 0
I 352 592 376 592 0 0.5
w 376 592 376 552 0
w 352 592 344 592 0
w 280 576 304 584 0
w 304 584 280 624 0
r 280 624 256 624 0 1.0
c 280 624 280 656 0 1.0E-6 0.6236548048569344
r 280 576 312 544 0 800.0
R 312 544 312 536 0 0 40.0 5.0 0.0 0.0 0.5
t 232 640 256 640 0 -1 5.416268805859148E-5 -0.6181302106749469 100.0
w 256 656 280 656 0
g 280 656 280 664 0
w 280 608 232 608 0
w 232 608 184 552 0
x 354 627 480 630 0 10 555 missing pulse detector
x 352 642 483 645 0 10 if pulse too long, reset 4017
r 232 640 232 608 0 1.0
w 256 432 216 456 0
R 456 584 440 584 0 0 40.0 5.0 0.0 0.0 0.5
L 472 568 472 576 0 0 false 5.0 0.0
159 456 584 456 552 0 20.0 1.0E10
d 816 216 808 248 1 0.805904783
d 840 248 808 248 1 0.805904783
r 808 248 816 264 0 10000.0
g 816 264 824 264 0
159 840 248 840 216 0 20.0 1.0E10
L 856 232 856 240 0 0 false 5.0 0.0
R 840 216 840 208 0 0 40.0 5.0 0.0 0.0 0.5
x 871 248 949 251 0 10 Transmitter reset
x 481 590 548 593 0 10 Receiver reset
o 34 64 0 35 5.0 9.765625E-5 0 -1
o 90 64 0 35 5.0 9.765625E-5 1 -1
o 96 64 0 35 5.0 9.765625E-5 1 -1
o 89 64 0 35 5.0 9.765625E-5 1 -1
o 95 64 0 35 5.0 9.765625E-5 1 -1
o 88 64 0 35 5.0 9.765625E-5 1 -1
o 94 64 0 35 5.0 9.765625E-5 1 -1



steve ghertner
Posted Oct 20, 2009 9:04 AM
sghertner
Group Organizer
Nashville, TN
Post #: 72
Send an Email Post a Greeting
Dustin,

I am interested in getting more details of this circuit I looked at the schematic, but needed more information to understand it. Do you have more description, part numbers etc.?
Unit042
Posted Oct 21, 2009 12:36 PM
user 7619449
Lewisburg, TN
Post #: 67
Send an Email Post a Greeting
Mmmmkay, this is a big circuit, so I'll chop it up. But first, the big idea is to have a circuit that sends servo signals over a radio link (to modulate the radio oscillator thing), but this circuit has just a straight wire from transmitter to receiver for simplicity.
Now, the typical (I think) pulse-position modulated RC transmitter will send a synchronization pulse (which differs from the channel pulses), to let the receiver know that we are starting to send information.
The receiver resets in preparation, so incoming information is not sent on the wrong channel.
With the sync pulse out of the way, channel 1 is sent in the form of a 1-to-2.5 millisecond long pulse. Then channel 2, 3, etc. The receiver, keeping track of which channel it's on, splits the pulses to their respective channel output pins, which then go to servos, who take 1-to-2.5 millisecond pulses....

Then another sync arrives, and the cycle begins again. (I call one of these cycles a "frame refresh")

IMPORTANT: Note that in the transmition, there is a short low period to separate the sync from channel 1, another low period to separate channel 1 from channel 2, etc.
Example: sync(H), low period(L), channel 1(H), low period(L), channel 2(H), etc.
H = high
L = low
If it were not for these low periods, the output would be a constant high signal. (bad)

Now, my thinking is, what if the length of the low periods could carry a channel pulse length too?
so now we have a positive sync (high time unique from the channels, which go from 1-to-2.5 ms, for me, my sync is 0.5ms), then the low period after syc is channel 1, then the next high period is channel 2, low again for channel 3, etc. looping back to a positive sync.

Unimportant: An odd number of channels is required to maintain sanity concerning sync polarity.

The transmitter uses a 4017 decade counter to enable successive pairs of diode-isolated potentiometers (one for high time, the other for low time), who connect to the 555's pins. Unused pins on the 4017 must be kept from attempting to transmit, so the first unused pin resets the 4017 to loop back to zero.

Note: The sync pulse is essentially a fixed 'channel', stuck at 0.5ms.

Unimportant: the 555 is basically an oscillator whose RC values change every half-cycle. Confusing!

The following is the transmitter by itself: (the diode OR gate is so user can manually reset transmitter to test the self-correcting of receiver which is explained later. The inverter is there because I want a high pulse to reset stuff, not low. Personal preference...)

$ 3 1.0000000000000002E-6 3.1763992386181834 49 5.0 50
165 120 144 152 144 2 0.0
174 344 208 376 272 0 1000.0 0.0050 Channel 1
174 424 208 456 272 0 1000.0 0.203 Channel 2
d 312 240 312 304 1 0.805904783
d 376 304 376 240 1 0.805904783
w 312 304 120 272 0
w 120 272 120 240 0
c 312 304 312 336 0 1.0E-5 3.030693221972997
g 312 336 312 352 0
R 184 80 184 64 0 0 40.0 5.0 0.0 0.0 0.5
w 184 112 184 80 0
w 248 176 248 80 0
w 248 80 184 80 0
163 264 96 296 96 0 10 5.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
w 360 64 360 192 0
w 408 192 296 64 0
w 344 176 280 176 0
w 248 208 280 176 0
w 280 176 264 128 0
w 344 176 344 160 0
w 424 176 424 160 0
174 488 208 520 272 0 1000.0 0.47030000000000005 Channel 3
174 536 208 568 272 0 1000.0 0.7079000000000001 Channel 4
d 456 240 456 304 1 0.805904783
d 520 304 520 240 1 0.805904783
w 456 304 520 304 0
w 456 304 376 304 0
w 616 128 392 64 0
w 328 64 552 192 0
r 312 208 312 240 0 30.0
d 568 240 568 304 1 0.805904783
d 616 304 616 240 1 0.805904783
w 616 304 568 304 0
w 568 304 520 304 0
w 248 208 256 392 0
159 344 208 344 176 0 20.0 1.0E10
159 424 176 424 208 0 20.0 1.0E10
159 568 176 568 208 0 20.0 1.0E10
w 424 160 552 160 0
I 600 160 584 160 0 0.5
w 584 208 568 208 0
w 568 208 536 208 0
w 488 208 424 208 0
x 220 -2 601 1 0 13 Note: Receiver won't allow next frame refresh unless sync is found
w 344 208 312 208 0
174 584 208 616 272 0 1000.0 0.9752000000000001 Channel 5
x 281 208 324 213 0 20 Sync
x 364 219 399 224 0 20 Ch1
x 424 199 459 204 0 20 Ch2
x 473 200 508 205 0 20 Ch3
x 522 206 557 211 0 20 Ch4
x 591 212 626 217 0 20 Ch5
w 568 176 552 160 0
w 424 160 344 160 0
r 376 304 312 304 0 75.0
x 351 336 363 342 0 24 ^
x 354 339 360 345 0 24 |
x 353 358 549 362 0 15 Determines minimum channel
x 354 375 537 379 0 15 pulse length (does not affect
x 354 394 431 398 0 15 Sync pulse)
r 376 240 344 208 0 190.0
x 97 346 158 350 0 15 Sync: 0.5
x 97 314 185 318 0 15 Pulse lengths
x 96 328 187 332 0 15 (milliseconds)
x 96 362 214 366 0 15 Channels: 1 to 2.5
r 424 208 456 240 0 190.0
r 488 208 520 240 0 190.0
r 536 208 568 240 0 190.0
r 584 208 616 240 0 190.0
x 626 238 640 244 0 24 <
x 629 235 653 241 0 24 ---
x 655 237 698 243 0 24 Max
x 655 257 714 263 0 24 pulse
x 655 282 723 288 0 24 length
x 93 50 498 54 0 16 19 Channel limit with a 4017, stack them for more channels
w 176 560 200 560 0
g 200 560 200 568 0
d 616 128 616 160 1 0.805904783
d 656 160 624 160 1 0.805904783
r 624 176 656 192 0 10000.0
g 656 192 664 192 0
159 656 160 656 128 0 20.0 1.0E10
L 672 144 672 152 0 1 false 5.0 0.0
R 656 128 656 120 0 0 40.0 5.0 0.0 0.0 0.5
x 663 160 776 163 0 10 manual transmitter reset
w 624 176 624 160 0
w 624 160 616 160 0
w 616 160 600 160 0
x 655 307 733 313 0 24 resistor
x 229 414 298 420 0 24 output
o 34 64 0 35 5.0 9.765625E-5 0 -1



The receiver has to take these double-modulated (high-modulated and low-modulated) signals, and invert the polarity of every low-modulated channel to convert them to a positive pulse. High modulated channels do not need inverting.
Once channel polarity is restored, and sorted out on their output pins, channel order must be maintained/restored. This is done by watching for the sync, or lack thereof, on a particular output pin.


Uh, oh, I'm running out of characters, I'll have to split my message up.
Unit042
Posted Oct 21, 2009 1:29 PM
user 7619449
Lewisburg, TN
Post #: 68
Send an Email Post a Greeting
The 555 missing pulse detector (with an inverted output) is watching the 4017's last pin, on the high-side logic gate's output. Why here? But first, what is it looking for? The 555 is looking for a pulse longer than 0.75ms. The effect? If the sync pulse is sent, the 0.5ms goes unnoticed, and the 555's output stays low. If a channel is sent on the 555's slot, then the 555 says "hey, this is too long to be a sync!".
The 555 catches the channel because remember, the minimum channel length is 1ms; the 555's threshold is 0.75ms. (See why I made the sync shorter? It's caught faster, before the channel has a chance to escape)

Anyway, suppose a channel is sent over where the sync should have been. The 555 notices, and sends a reset signal to the diode OR gate (again, another manual reset for debugging), and to the 4017's reset pin. I call this the "error" pulse, as it only occurs if there is an error in channel location.
This is where the odd location of the 555 comes in.

You see, I found the error pulse does no good if the 555 is watching the 4017's first pin, becuase Q0 is where the reset goes, effectively nullifying itself.
Analogy: In programming, It's like calling a goto command to the next line after the goto...
'program
goto my_spot
my_spot:
'rest of program
...the program is going there anyway, and nothing special gets done.

Now, if the sync were on an even numbered channel (well, I'm guessing it's on an odd channel, but if it's on an even, you know what I mean), the channel train would skip back two slots. This is bad because the sync could be in between the skipped slots, and the 555 would never see it.

Eample: draw six boxes on a piece of paper in a line. Number them from left to right:
X 2 3 4 5
Where X is sync.
Say we start at channel 2. Is this sync? If not, jump left two boxes. If you land on sync, stop; because we are now syncronized... hey, wait a minute, this doesn't work on paper! Well, you get the idea.
Moving on....

Alright, now that the sync is not on the last pin (where it sould be), and it isn't on the first pin (Q0, were it shouldn't be), let's try the second pin (Q1). Let's say channel 1 arrives, is sent on Q0's high time, then channel 2 is sent on Q0's low time, then, uh-oh, channel 3 is on where sync should be: Q1's high time! So the 555 dutifully resets the 4017. Channel 4 is sent on Q0's high, then channel 5 in on Q0's low, and, YAY! sync is on Q1's high time! So the other channels pass through... Okay, this example isn't working either. Just put the 555's input wire on channel 5 output, and you'll see what I mean. The receiver loops and loops. It might eventually get in sync, but it seems to take too many cycles to be practical. (receiver code below)

Note: If it were not for this reset mechanism, channel 1 might be sent on channel 2, channel 2 might be sent on channel 3, and sync might be on channel four! In a battlebots environment (yes, that's what this is for), the receiver and transmitter won't have direct line-of-sight for 100% of the match, so an error-correcting system is needed. Besides, both receiver and transmitter are out-of-sync upon startup anyway, unless there is a precision-startup-timing thingy circuit.

The following is the receiver with the transmitter shoved out of the way. (the receiver by itself would not be really exciting, as there would be no signal...)

Unit042
Posted Oct 21, 2009 1:52 PM
user 7619449
Lewisburg, TN
Post #: 69
Send an Email Post a Greeting
$ 3 1.0000000000000002E-6 3.1763992386181834 49 5.0 50
165 408 16 440 16 2 0.0
174 632 80 664 144 0 1000.0 0.0050 Channel 1
174 712 80 744 144 0 1000.0 0.203 Channel 2
d 600 112 600 176 1 0.805904783
d 664 176 664 112 1 0.805904783
w 600 176 408 144 0
w 408 144 408 112 0
c 600 176 600 208 0 1.0E-5 2.7054599645941333
g 600 208 600 224 0
R 472 -48 472 -64 0 0 40.0 5.0 0.0 0.0 0.5
w 472 -16 472 -48 0
w 536 48 536 -48 0
w 536 -48 472 -48 0
163 552 -32 584 -32 0 10 0.0 5.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
w 648 -64 648 64 0
w 696 64 584 -64 0
w 632 48 568 48 0
w 536 80 568 48 0
w 568 48 552 0 0
w 632 48 632 32 0
w 712 48 712 32 0
174 776 80 808 144 0 1000.0 0.47030000000000005 Channel 3
174 824 80 856 144 0 1000.0 0.7079000000000001 Channel 4
d 744 112 744 176 1 0.805904783
d 808 176 808 112 1 0.805904783
w 744 176 808 176 0
w 744 176 664 176 0
w 896 0 680 -64 0
w 616 -64 840 64 0
r 600 80 600 112 0 30.0
d 856 112 856 176 1 0.805904783
d 904 176 904 112 1 0.805904783
w 904 176 856 176 0
w 856 176 808 176 0
w 568 48 584 32 0
159 632 80 632 48 0 20.0 1.0E10
159 712 48 712 80 0 20.0 1.0E10
159 856 48 856 80 0 20.0 1.0E10
w 712 32 840 32 0
I 888 32 872 32 0 0.5
w 872 80 856 80 0
w 856 80 824 80 0
w 776 80 712 80 0
x 276 -82 657 -79 0 13 Note: Receiver won't allow next frame refresh unless sync is found
w 632 80 600 80 0
174 872 80 904 144 0 1000.0 0.9752000000000001 Channel 5
x 569 80 612 85 0 20 Sync
x 652 91 687 96 0 20 Ch1
x 712 71 747 76 0 20 Ch2
x 761 72 796 77 0 20 Ch3
x 810 78 845 83 0 20 Ch4
x 879 84 914 89 0 20 Ch5
w 856 48 840 32 0
w 712 32 632 32 0
r 664 176 600 176 0 75.0
r 664 112 632 80 0 190.0
x 280 272 337 276 0 15 Sync 0.5
x 281 222 369 226 0 15 Pulse lengths
x 280 240 371 244 0 15 (milliseconds)
x 279 256 397 260 0 15 Channels: 1 to 2.5
r 712 80 744 112 0 190.0
r 776 80 808 112 0 190.0
r 824 80 856 112 0 190.0
r 872 80 904 112 0 190.0
x 258 361 311 365 0 16 pulse in
163 96 312 112 312 0 10 0.0 5.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
I 416 400 416 376 0 0.5
w 96 344 112 344 0
w 112 344 480 320 0
w 480 320 536 128 0
I 96 344 64 344 0 0.5
150 112 200 112 184 0 2 0.0
150 176 200 176 184 0 2 0.0
150 240 200 240 184 0 2 0.0
w 128 200 128 280 0
w 192 200 160 280 0
w 256 200 232 256 0
w 240 184 240 168 0
w 176 184 176 168 0
w 112 184 112 168 0
150 112 136 112 120 0 2 0.0
150 176 136 176 120 0 2 0.0
150 240 136 240 120 0 2 0.0
w 240 120 240 104 0
w 176 120 176 104 0
w 112 120 112 104 0
w 128 136 128 200 0
w 192 200 192 136 0
w 256 200 256 136 0
w 96 248 112 344 0
w 96 200 96 248 0
w 96 248 160 200 0
w 160 200 160 232 0
w 160 232 224 200 0
w 64 344 64 152 0
w 64 152 96 136 0
w 96 136 144 152 0
w 144 152 160 136 0
w 160 136 208 152 0
w 208 152 224 136 0
x 217 171 271 177 0 24 Sync
x 219 103 263 109 0 24 Ch1
x 87 167 131 173 0 24 Ch2
x 89 103 133 109 0 24 Ch3
x 153 167 197 173 0 24 Ch4
x 151 101 195 107 0 24 Ch5
x 88 383 152 386 0 10 from sync slot
r 440 408 488 408 0 10000.0
g 488 408 504 408 0
d 352 416 384 408 1 0.805904783
w 416 408 384 408 0
d 224 280 384 408 1 0.805904783
w 160 376 240 184 0
s 536 80 536 128 0 0 false
165 256 384 272 384 3 5.0
w 320 400 288 368 0
I 328 416 352 416 0 0.5
w 328 416 320 416 0
w 256 400 280 408 0
w 280 408 256 448 0
r 256 448 232 448 0 1.0
c 256 448 256 480 0 1.0E-6 0.6236548048569335
r 256 400 288 368 0 800.0
R 288 368 288 360 0 0 40.0 5.0 0.0 0.0 0.5
t 208 464 232 464 0 -1 5.41626880585907E-5 -0.6181302106749462 100.0
w 232 480 256 480 0
g 256 480 256 488 0
w 256 432 208 432 0
w 208 432 160 376 0
x 315 473 441 476 0 10 555 missing pulse detector
x 315 487 446 490 0 10 if pulse too long, reset 4017
r 208 464 208 432 0 1.0
w 232 256 192 280 0
R 416 448 400 448 0 0 40.0 5.0 0.0 0.0 0.5
L 432 432 448 432 0 0 false 5.0 0.0
159 416 448 416 416 0 20.0 1.0E10
d 896 0 888 32 1 0.805904783
r 888 32 896 48 0 10000.0
g 896 48 904 48 0
x 461 439 563 442 0 10 manual receiver reset
x 496 295 589 301 0 24 <---Input
w 440 408 416 408 0
w 416 408 416 400 0
w 416 416 416 408 0
o 34 64 0 35 5.0 9.765625E-5 0 -1
o 79 64 0 35 7.62939453125E-5 9.765625E-5 1 -1
o 85 64 0 35 5.0 9.765625E-5 1 -1
o 78 64 0 35 5.0 9.765625E-5 1 -1
o 84 64 0 35 5.0 9.765625E-5 1 -1
o 77 64 0 35 7.62939453125E-5 9.765625E-5 1 -1
o 83 64 0 35 7.62939453125E-5 9.765625E-5 1 -1


With sync at 0.5ms, and subsequent channels at 2.5ms max, the most number of channels I can maintain at 50Hz (minimum refresh frequency for servos), meaning the most number of other channels I can do while refreshing each channel 50 times per second is:

50Hz / (0.5 + 2.5(x)) = A

Where x is max standard servos that can be run simultaneously (somewhere around 90) and A is less than or equal to one.
(I thought this formula up on the spot, but the number of max channels is in my notebook, and it's upstairs)

Another thing, the minimum carrier frequency for transmitting servo pulses (while maintaining a resolution of 10, ie 10 pulses to make up one 2.5ms channel signal, or at least close)
is about 50kHz
Again, the exact formula is upstairs, and I'm lazy.
Why 1/10 resolution? Well, I wanted a frequency lower than commercial AM radio, so the average AM transmitter wouldn't interfere, but higher than audio: 40kHz, as there will no doubt be music playing on big speakers (can you say EM interference?). Also, even in the less-than-9kHz, there will be, in addition to the speakers, my motor's PWM (speed control pulses) control. Of course, we can't have the receiver listening to the ESC's output, now can we?
Besides, 50kHz is a friendly number. Don't ask me why, it just is.



Of course, in retrospect, this could all be done with (fast) microcontrollers. I did not go this route because:
#1: I like discreet analog/digital circuits.
#2: The simulator does not do microcontrollers.
#3: Going with the easy choice would be cheating.
#4: What fun would that be, anyway?



PS: If I confused anyone, I can go over things in more detail.
Patrick
Posted Oct 26, 2009 8:34 PM
Patrick83
Nashville, TN
Post #: 87
Send an Email Post a Greeting
Very cool! Way over my head but cool nonetheless. I will bring my Eee PC next time and maybe we could run the program.

Patrick
Unit042
Posted Oct 27, 2009 12:13 PM
user 7619449
Lewisburg, TN
Post #: 70
Send an Email Post a Greeting
No, it's not over your head, I'm just explaining it wrong. At which point did I begin leaving important details out?

Maybe a youtube movie would help things out.... Wait, I haven't even built the thing, or even proven that it works, what am I saying? Well, I'll just have to breadboard it then....


PS: Good idea with the PC, I can point at stuff while the circuit is running.
Unit042
Posted Nov 15, 2009 5:31 PM
user 7619449
Lewisburg, TN
Post #: 72
Send an Email Post a Greeting
Here's the math that I used to find the minimum carrier frequency for wireless radio transmission:

reference:
1000 milliseconds (mS) = 1 Second (S)
1000 nanoseconds(nS) = 1 millisecond (mS)
minimum resolution: 10 radio pulses per milisecond

To find out how many possible locations the transmitter can tell the servo go to is indicated by the resolution: 2.5 (max mS servo can take) divided by 0.1 (one tenth of a mS)
or:
2.5/0.1 = 25
Therefore, any attached servo will have 25 total steps at this resolution. To find how many degrees that the servo will rotate in each step, it is: number of servo rotation degrees divided by 25. Say our servo goes 180 degrees from one extreme to the other:
180/25 = 7.2
So the servo will move in 7.2 degree chunks.

Anyway, back to the carrier frequency:
1 Second divided by 0.1mS (one milisecond divided by pulses per milisecond, or the length of one pulse)
(remember, 1 second = 1000 mS)
1/0.0001 = 10,000 (minimum frequency, in hertz)

Or, 10kHz.
But, this is within the audible range. (uh-oh!)

Now, how about 50kHz? Let's figure this procedure backwards.
(one second) divided by (50k Hertz) equals (time period of one pulse length)
1S/50,000 = 0.00002S
or 20 nS pulse length

Now, to find pulses per milisecond:
(convert both terms in the problem into the same unti so that life becomes easier)
20nS = 0.02mS pulse length in miliseconds


Now, degrees per step:
2.5(servo max)/0.02(pulses per milisecond) = 50 steps the servo can be in. (note the servo itself may have a differing resolution)

degrees per step: (assuming 180 degrees of possible rotation)
180/50 = 3.6 degrees per step. (much more precision than 7.2 deg. per step!)



PS: If my math was wrong aywhere, let me know. Miscalculations are no fun.
Powered by mvnForum