electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software
Tower of Hanoi
Post new topic   Reply to topic Moderators: jksuperstar, Scott Stites, Uncle Krunkus
Page 2 of 2 [38 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Goto page: Previous 1, 2
Author Message
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24079
Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320

PostPosted: Sat Aug 10, 2019 11:53 am    Post subject: Reply with quote  Mark this post and the followings unread

Meanwhile had implemented it differently (might change it still .. but having a few extra constraints .. as I'm wanting to use it in the Sieve module ... so I can type stuff there like:

Code:
hanoipegs2 * random( 0.5)


to get a random element pick from the p sequence (the peg sequence is made of from the differences from its p sequence)

or:

Code:
prime * hanoipegs2 + random( 0.3) * hanoipegs1


for some other weird stuff.

the peg1 are the non alternating sequence and the pegs2 is the alternating one .. btw),

As want it to BEEP <now> Laughing

The recursive stuff I now use is not actually too bad .. as I can pre-compute the sequence as in practice it will never get longer than 1024 elements (current module constraint).

Posted Image, might have been reduced in size. Click Image to view fullscreen.

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
PHOBoS



Joined: Jan 14, 2010
Posts: 5591
Location: Moon Base
Audio files: 705

PostPosted: Sun Aug 11, 2019 5:49 pm    Post subject: Reply with quote  Mark this post and the followings unread

I managed to simplify it a little bit with some muxes. To know if an odd or even disc is moved you only have to look at odd or even,
you don't actually need to check both. At least not while discs are being moved. Also each peg can only be used for 2 of the 3 steps.
The muxes are controlled by the 'even' signal and switch between these 2 steps for each peg.

However this only works as long as discs are being moved which is not the case before the first step (or after the last).
So I added a NOR gate made with two diodes and a transistor to control the INH pin of the muxes. If no odd or even discs are being
moved it makes the INH pin high which disables the outputs of the muxes. This does mean the outputs are basically floating at that
state but that's actually not a problem unless you connect them directly to the input of another gate without a pulldown (or pullup)
resistor. If it is for a patchable system an input can be left unconnected anway so then it should work fine.

I also added the short/long switch to the Enable pins of the flip-flops. As with the muxes this means these outputs are basically floating
when the CLK is low (in short mode) but like I said that's not really a problem. And now short/long works on both discs and pegs outputs.

The diode between the 'odd' signal and the transistor could be left out but it might be nice to have both odd and even signals available
too. If used as outputs it would be a good idea to add some buffers to them.


Hanoi Sequencer v2.gif
 Description:
tested
 Filesize:  85.29 KB
 Viewed:  413 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

Hanoi Sequencer v2.gif



_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube

Last edited by PHOBoS on Fri Aug 16, 2019 8:01 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
PHOBoS



Joined: Jan 14, 2010
Posts: 5591
Location: Moon Base
Audio files: 705

PostPosted: Mon Aug 12, 2019 11:42 am    Post subject: Reply with quote  Mark this post and the followings unread

I just had another look at the other video which goes into a restricted tower of hanoi verion.
With the previous unrestricted version it is allowed to move between all pegs, so: A<->B, B<->C, C<->A
With this restricted version it is only allowed to move between adjacent pegs, so: A<->B, B<->C

The solution is very similar to the unrestricted version with the difference that instead of counting in binary you now have to count in
ternary (base 3). So a disc is moved when it's corresponding trit (ternary bit) changes from 0 to 1, or 1 to 2.

I think a discrete logic version might be very tricky to do but maybe there is some easy solution.
The first problem is just counting in ternary. A binary counter is easy to make by chainging 2-step counters (flip-flops), which you can
get prewired in a single package (like CD4040, CD4060, CD4520). For a ternary counter you'd have to chain 3-step counters, which
would already require a seperate counter per disc. But there is another problem; trits. With digital logic you only have 2 possible states; 0 or 1,
there is no third state. You could use something with a tri-state output and add some resistors to create a voltage between 0 and 1, but this
can't be directly connected to another input. (hmm, that could actually be useful for the output of a lunetta synth and it also makes me curious
about ternary logic, assuming something like that exists). So you'd have to use 2 or 3 bits to represent a trit.

_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24079
Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320

PostPosted: Mon Aug 12, 2019 12:11 pm    Post subject: Reply with quote  Mark this post and the followings unread

Ternaries .. oh dear .. wild puzzle .. just had a look at the Wiki page for it ... they have 6 models to choose from ... 27 distinct single trit operations and 19683 distinct two input operations ... anyway, maybe the 0, 1, 2 model would be most suitable for this puzzle.
_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
PHOBoS



Joined: Jan 14, 2010
Posts: 5591
Location: Moon Base
Audio files: 705

PostPosted: Wed Aug 14, 2019 5:50 am    Post subject: Reply with quote  Mark this post and the followings unread

Blue Hell wrote:
Ternaries .. oh dear .. wild puzzle .. just had a look at the Wiki page for it ... they have 6 models to choose from ... 27 distinct single trit operations and 19683 distinct two input operations ... anyway, maybe the 0, 1, 2 model would be most suitable for this puzzle.

yeah I looked into it a trit too, it doesn't seem to be very practical (in hardware) but I might open a seperate thread for it.

here are the disc and peg sequences for a restricted Tower of Hanoi (3 discs)
Code:
D: 1 1 2 1 1 2 1 1 3 1 1 2 1 1 2 1 1 3 1 1 2 1 1 2 1 1
P: B C B B A C B C B B A B B C A B A C B C B B A C B C


Unlike the unrestricted version the discs now all move in the same direction and pattern, just a factor 3 slower, which isn't really surprising.

I haven't really done much else with it but I have some ideas on how to make a circuit for it,

_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
PHOBoS



Joined: Jan 14, 2010
Posts: 5591
Location: Moon Base
Audio files: 705

PostPosted: Fri Aug 16, 2019 7:26 am    Post subject: Reply with quote  Mark this post and the followings unread

I gave up on the restricted version (for now). It's possible of course but it looks like it would just require too many chips.

I did breadboard the unrestricted Hanoi Sequencer V2 and that one seems to be working Very Happy.
I added 6 extra buffers (CD4050); 3 for the peg outputs, 2 for even/odd outputs and 1 extra output for the start/end
when no discs are moved. This was easy to add because it is just the signal that controls pin 6 of the CD4053.

Here's a demo video. Yellow LEDs are the 8 disc outputs (0 on the right), the green LEDs indicate even/odd, red LED is
start/end and the orange LEDs are the 3 peg outputs (A on the left). The 3 red LEDs in the bottom left corner are connected
to the 3-step counter. (background music: Luna Supreme (Part II))


( https://streamable.com/mbpr9 )

_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24079
Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320

PostPosted: Fri Aug 16, 2019 11:51 am    Post subject: Reply with quote  Mark this post and the followings unread

Nice!

That other restricted thingie seemed a bit over the top yeah from what you said in chat.

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
PHOBoS



Joined: Jan 14, 2010
Posts: 5591
Location: Moon Base
Audio files: 705

PostPosted: Tue Sep 10, 2019 10:34 am    Post subject: Reply with quote  Mark this post and the followings unread

I am turning it into a eurorack sequencer and just received the PCBs.
Don't have all the parts yet though (mainly the pots) but they're on their way.


Hanoi Seq V3 PCB set.jpg
 Description:
 Filesize:  493.76 KB
 Viewed:  391 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

Hanoi Seq V3 PCB set.jpg



_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
PHOBoS



Joined: Jan 14, 2010
Posts: 5591
Location: Moon Base
Audio files: 705

PostPosted: Mon Sep 16, 2019 6:12 am    Post subject: Reply with quote  Mark this post and the followings unread

The parts arrived so I put it together. I did make a couple of mistakes in the PCB design Embarassed
but nothing major and the circuit works as it is.

First mistake I spotted was that I placed the pots in the order:
( 1 ) ( 5 )
( 2 ) ( 6 )
( 3 ) ( 7 )
( 4 ) ( 8 )

My intention was actually to have them in the order:
( 1 ) ( 2 )
( 3 ) ( 4 )
( 5 ) ( 6 )
( 7 ) ( 8 )

which makes more sense with the ODD, EVEN outputs below them (I also managed to swap those doh ).
To solve this I only had to swap some connections between the two PCBs.

Another mistake was that I misinterpreted the datasheet for the Thonkiconn connectors and made the holes
for the pins too small. Easily to solve with a small drill but that does destroy the through hole plating.
Luckily there is only one connector that has a trace on the top layer and that was very easy to reroute on
the bottom.


After powering up the main circuit board (without the chips) to measure some voltages I could smell that something
wasn't right. I quickly turned the power off and noticed one of the 10 ohm resistors looked a bit burned. So I am
glad I used those. I realized what the problem was almost immediately. There is a voltage regulator on the board and
as I did with a previous design I used the GND plane as a heatsink, although it shouldn't get very warm. But this is an
LM317 which doesn't have the backside connected to GND but the output so it was shorting that. A bit of insulation
solved the problem and for the rest the circuit worked perfect.

I played around with it a bit which resulted in Dubious Towers (hence the title).


Hanoi Seq V3 - 01.jpg
 Description:
 Filesize:  248.38 KB
 Viewed:  364 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

Hanoi Seq V3 - 01.jpg



Hanoi Seq V3 - 02.jpg
 Description:
 Filesize:  240.83 KB
 Viewed:  362 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

Hanoi Seq V3 - 02.jpg



_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24079
Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320

PostPosted: Mon Sep 16, 2019 10:21 am    Post subject: Reply with quote  Mark this post and the followings unread

Cool
_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
diablojoy



Joined: Sep 07, 2008
Posts: 809
Location: melbourne australia
Audio files: 11

PostPosted: Thu Sep 19, 2019 1:56 am    Post subject: Reply with quote  Mark this post and the followings unread

nice work Cool
sounds really interesting

_________________
In an infinite universe one might very well
ask where the hell am I
oh yeah thats right the land of OZ
as good an answer as any
Back to top
View user's profile Send private message
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24079
Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320

PostPosted: Tue Jan 07, 2020 7:32 am    Post subject: Reply with quote  Mark this post and the followings unread

Some more on the magic of three :: https://www.red-gate.com/simple-talk/opinion/opinion-pieces/power-three-wooden-computer/

Stumbled over this while reading up on number bases .. after .. well here is my reading history in reverse order:

https://en.wikipedia.org/wiki/Ternary_computer
https://en.wikipedia.org/wiki/Radix_economy
https://en.wikipedia.org/wiki/Non-integer_representation
https://en.wikipedia.org/wiki/List_of_numeral_systems

and before that I had been reading up on the duodecimal system [ https://en.wikipedia.org/wiki/Duodecimal ] which was because of reading about some retro movements in the US and the UK ... claiming twelve to be better than ten for a number base ... and before that I just wondered if gross could mean twelve in English (instead of just "that's gross"), like gros can mean twaalf in Dutch .. the strange ways internet searches can go Cool

Anyways, after all that stuff I remembered this thread here and it seemed related.

and BTW, Donald Knuth had something good to say about ternary systems as well, in the art of computer programming (which I've ordered last week Exclamation finally ... after having wanted it for a long time already).

and BTW .. there is a clip on youtube about the Fowler ternary calculator :: https://www.youtube.com/watch?v=uTo1M_ClN74 :: a very simple demonstration.

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
PHOBoS



Joined: Jan 14, 2010
Posts: 5591
Location: Moon Base
Audio files: 705

PostPosted: Tue Jan 07, 2020 5:19 pm    Post subject: Reply with quote  Mark this post and the followings unread

Ah great, some more rabbit holes to get lost into someday. albino


#teamthrees

_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic Moderators: jksuperstar, Scott Stites, Uncle Krunkus
Page 2 of 2 [38 Posts]
View unread posts
View new posts in the last week
Goto page: Previous 1, 2
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software
Jump to:  

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
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use