Electronics > Projects, Designs, and Technical Stuff
Home Brew Analog Computer System
GK:
--- Quote from: mamalala on August 05, 2013, 04:56:11 pm ---What i forgot to mention. In my example i do invert the readout value _and_ set the negative-polarity bit. I just assumed that when you toggle the output pin that the DAC output is inverted after the OpAmps, that is 5V input becomes 0V and 0V input becomes -5V output when negative, while for the positive half 5V in becomes 5V out, and 0V in becomes 0V out (just as an example). If that is not the case, simple comment out the "result = ~result" line there.
Also, note that due to the way the lookuptable is read, the first and last value in it are duplicated at each start/end of a quadrant. That is, for example, the zero-crossing at 180° will become 0 at an ADC value of 511 (end of second quadrant) but also 0 at a ADC value of 512 (start of third quadrant). There are two ways to eliminate that error. One is to create the table so there is no 0° and 90°. So the sequence instead of, for example, 8-4-0 0-4-8 becomes 10-6-2 2-6-10. Another way is to limit the maximum value in the table, and then add a fixed value if you go negative. So if the sequence from the table would be 8-4-0 0-4-8 you simply add 4 if negative, and get 8-4-0 4-8-12 instead. Of course this means that the maximum value can not be 255 but must be 251 instead, to avoid an overflow when adding 4.
Personally i would prefer the first method. This ensures that the generated quadrants are symetrical. And at 8 bits for one quadrant you have a resolution of roundabout 0.35°, so the small "error" of not having complete 0° or 90° is just roundabout +/- 0.175°.
Greetings,
Chris
--- End quote ---
Hi Chris,
Thanks for going through this in such detail - it's appreciated. I'd like to implement your recommendations and see how it compares to the current code, speed wise. However the electronic/firmware side of the project has been put aside for now as I work on installing and wiring it into its instrument case. Give me several days to get back to revising the code.
GK:
--- Quote from: woodchips on August 05, 2013, 06:42:32 pm ---Just got a copy of the Korn Electronic and Hybrid Analogue Computers book. I like it. Dates from 1963 so right at the very end of both designing with valves and analogue computers, a few years later both were history. And all those ECC83s that were junked!
What is really nice is that the book can be read as a guide to design, there is lots of useful and interesting information. If you like the MIT Rad Lab books then you will like this. So many, most, text books are, quite frankly, boring and a chore to read, but every now and then a real gem pops up. Others are ones by Scroggie, Cathode Ray of Wireless World, Steinmetz from the early 1900s.
Thanks for the suggestion.
--- End quote ---
If you liked the Korn & Korn book, you'd also enjoy Design Fundamentals of Analog Computer Components by R. M. Howe. That one is even more of a "design guide" than K&K. However, unlike K&K which delves into transistor circuit design as well, it deals exclusively in tube circuitry.
BTW, have not forgotten about those pots, just have some annoyances to sort out ATM with my PayPal account.
woodchips:
Thanks, have to get the Howe book now as well!
If you are still looking for equations like the Lorenz, have you seen the Cornu's spiral? Beyond me but looked a pretty picture in the book, Slater & Frank - Electromagnetism.
No problems with the sine cosine pots, also have some resolvers as well.
mamalala:
--- Quote from: GK on August 06, 2013, 02:37:52 am ---Hi Chris,
Thanks for going through this in such detail - it's appreciated. I'd like to implement your recommendations and see how it compares to the current code, speed wise. However the electronic/firmware side of the project has been put aside for now as I work on installing and wiring it into its instrument case. Give me several days to get back to revising the code.
--- End quote ---
No problem, you're welcome. Just as a side-note, if you plan to use a lot of table lookups in the future, you might want to consider to use PIC18 instead of the PIC16 series chips. They allow a more direct access to the program memory especially for stuff like tables, strings, etc.
On the PIC16, what actually happens is that you load the index in the W register and then call a subroutine. That will use the value in the W register to calculate the target address of a coputed goto, then jumps to that location, which in turn returns the actual value back in the W register.
On PIC18 you have a dedicated set of registers to do that. You simply load the index value into those registers, and can immediately read back the result from another register. Much faster, and allows to keep large tables simple as well (PIC16 would need some extra code to access tables larger than 256 entries).
It also has registers to directly access arrays and stuff in RAM. And all of those (for RAM and ROM) have various registers that define how the access happens. One register reads without changing the address pointed to. Another one increases the address, yet another one decreases it. And then there is one that allows you to access the address you set plus/minus an offset given by what is currently in W.
Makes working with memory blocks and tables _much_ more performant.
Greetings,
Chris
GK:
--- Quote from: woodchips on August 07, 2013, 09:42:32 pm ---If you are still looking for equations like the Lorenz, have you seen the Cornu's spiral? Beyond me but looked a pretty picture in the book, Slater & Frank - Electromagnetism.
--- End quote ---
Looks interesting, but not chaotic though. in addition to the Rossler Attractor and the Lorenz Attractor, I have also found "Chua's circuit":
http://en.wikipedia.org/wiki/Chua%27s_circuit
I will have to get an analog simulation of that up and running as well, of course.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version