Generating stripboard layouts

Now that my servo controller project is making some progress, I started to think about how to lay out the schematic I have in mind on the stripboard I bought.

It's not entirely trivial to make sure all the correct lanes are connected, and only those.

That is why I started writing a piece of software to do it for me. It'll be written in Scheme, using cKanren. I have just started, but this are the first results:

Code:
> (run 1 (q)
    (fresh (l1 l2 l3 l4 r1 r2)
      (infd l1 l2 l3 l4 lanes)
      (resistor l1 l2 r1)
      (resistor l3 l4 r2)
      (== q (list r1 r2 (list 'tr l1 l3 l2)))
      (distinctfd (list l1 l2 l3 l4))))
(((r 3 0) (r 4 1) (tr 3 4 0)))
I first defined 4 lanes, then defined that the 2 pins of the first resistor should be on the same lane as 2 of the pins of the transistor, and then another resistor that connects to the same lane as the third pin of the transistor. I defined a constraint that the pins of resistors should be at least 3 holes apart, and then I get as output a combination of lanes that satisfies all the constraints.

I wrote in more detail about it on my blog, and hope to add all the needed pieces eventually.

http://pepijndevos.nl/2012/03/13/thoughts-about-generating-stripboard-layouts.html
 

nick12ab

Senior Member
Looks quite interesting - can you provide some images?

Without meaning to push your work into the corner, here's some other existing stripboard layouts:
 

booski

Senior Member
A genuine comment.

OK, it's Euro 39, but it works very well
http://www.abacom-online.de/uk/html/lochmaster.html

e
Wow, nice bit of software that, good that its quite visual too, very good for prototyping. Not keen on the price though.

However, for 39Euro you could buy a plastic container plus lid, ferric chloride (or similar), handful of FR4 and use the free version of Diptrace and etch your own boards (saying that, you do need access to a laser printer/photo copier and transfer paper)
 

Goeytex

Senior Member
@pepijndevos

I think you may be getting ahead of yourself a bit.

Before doing a board layout I would make certain that I had a thoroughly tested and working prototype on a breadboard. Having done a fair amount of testing with Picaxe and servos, I am skeptical of the ability of a single Picaxe to work as a 6 channel servo controller. Good Luck.

That being said, do a Google search for "StripBoard Magic". I think it is now "Abandonware" and there should be a free download link somewhere. I have used it before and it is adequate for most small board designs.
 

matherp

Senior Member
Look at Veecad. I've used it for years and it is excellent. There is a free version that will do many smaller projects
 

booski

Senior Member
ah yes, stripboard magic is one I've used in the past, was trying to think of it earlier. Its good but unfortunately I doesn't work on vista and above. Works fine on XP if you have that mind.
 

boriz

Senior Member
There's loads of stripboard/veroboard design aids out there, many free. But Stripboard magic is different. It AUTO-ROUTES from the schematic. A massively useful feature that I have used many times.

Unfortunately the program is clunky, buggy and will only handle small circuits. Which is why I have started writing my own stripboard autorouter. I've started three times so far :)

All attempts have been based upon variations of the genetic-algorithm. My personal programming panacea of choice.
 
Like boriz said, there are a lot of tools for designing stripboards, and I thank you for linking to so many I was unaware off, but what I am interested in is the auto-routing feature. I'll have a look a stripboard magic.

Genetic algorithms? Like, you generate a random board and then rate it? I don't know, a mostly correct layout is still wrong. Are you familiar with logic programming?

@goeytex I'm not soldering anything before I have done more testing, don't worry.
 

SD70M

Senior Member
Having done a fair amount of testing with Picaxe and servos, I am skeptical of the ability of a single Picaxe to work as a 6 channel servo controller. Good Luck.
My 6 channel servo controller:

Pic power @ top left
Servo power @ top right
Pic/Servo power connected 0V
Switches are on main board elsewhere with +V from there to pic.
LEDs are for programming mode indication while altering max/min throw

6 channel servo controller.jpg

Best of all..... it works. I've tested it using cheap 9g servos and it handles what I require. Would be better with more solid servos but they can be updated as and when finances permit.

Angie
 

SD70M

Senior Member
That's a nice layout.

Why not share your code so that others can learn?

You said "PIC" did you mean "Picaxe"?
Yes, sorry, picaxe. 20M2

Code below features first level programming incomplete as life got in the way of finishing it as yet.

It relies on buttons 5 & 6 being pressed at the same time to enter programming mode, once all servos have stopped moving.

Once programming mode has been selected, no more servo movements can be directed until programming mode is exited using a picaxe reset. The reset is used to ensure positions are correct according to the stored values.

If buttons 1, 4 & 5 are pressed at the same time it resets the picaxe.

Servo positions are stored on chip and updated after each move.

The second code below sets up the original stored values. That code is programmed first, then the main code is programmed onto the chip using #no_data directive so not to erase the initialised values.

Code:
#com 3
#picaxe 20M2
#no_data

init:
	setfreq m16
	dirsB=%11111111
	dirsC=%00000000
; b0, servo direction of travel flags
	read 0,b0
	symbol svo1_dot=bit1
	symbol svo2_dot=bit2
	symbol svo3_dot=bit3
	symbol svo4_dot=bit4
	symbol svo5_dot=bit5
	symbol svo6_dot=bit6
; b1, servo is_moving flags
	symbol is_anything_moving=b1
	symbol svo1_ismoving=bit9
	symbol svo2_ismoving=bit10
	symbol svo3_ismoving=bit11
	symbol svo4_ismoving=bit12
	symbol svo5_ismoving=bit13
	symbol svo6_ismoving=bit14
	symbol svoSpeed=1
; servo positions
	symbol svo1_pos=b2
	symbol svo2_pos=b3
	symbol svo3_pos=b4
	symbol svo4_pos=b5
	symbol svo5_pos=b6
	symbol svo6_pos=b7
; b10-b15, minimum servo position values
	read 1,b8 : symbol svo1_min=b8
	read 2,b9 : symbol svo2_min=b9
	read 3,b10 : symbol svo3_min=b10
	read 4,b11 : symbol svo4_min=b11
	read 5,b12 : symbol svo5_min=b12
	read 6,b13 : symbol svo6_min=b13
; b16-b21, maximum servo position values
	read 7,b14 : symbol svo1_max=b14
	read 8,b15 : symbol svo2_max=b15
	read 9,b16 : symbol svo3_max=b16
	read 10,b17 : symbol svo4_max=b17
	read 11,b18 : symbol svo5_max=b18
	read 12,b19 : symbol svo6_max=b19
; setup svo's starting positions
	if svo1_dot=0 then:svo1_pos=svo1_min:else:svo1_pos=svo1_max:endif
	if svo2_dot=0 then:svo2_pos=svo2_min:else:svo2_pos=svo2_max:endif
	if svo3_dot=0 then:svo3_pos=svo3_min:else:svo3_pos=svo3_max:endif
	if svo4_dot=0 then:svo4_pos=svo4_min:else:svo4_pos=svo4_max:endif
	if svo5_dot=0 then:svo5_pos=svo5_min:else:svo5_pos=svo5_max:endif
	if svo6_dot=0 then:svo6_pos=svo6_min:else:svo6_pos=svo6_max:endif
	servo 1,svo1_pos
	servo 2,svo2_pos
	servo 3,svo3_pos
	servo 4,svo4_pos
	servo 5,svo5_pos
	servo 6,svo6_pos
	symbol ledY=B.7 ; Yellow LED
	symbol ledR=B.0 ; Red LED
; PROGRAMMING MODE
	symbol progFlag=bit0
	symbol selectedSvo=b4
	symbol selected_direction=b5
	symbol svo_pos_to_update=b6
	symbol loop_for=b7
	symbol loop_var=b8
	; goto prog mode - buttons 5 and 6

	
main: ; LABEL - Main Program
	high ledY
	do
		if pinsC=96 or progFlag=1 then			; buttons 5 & 6
			low ledY
			progFlag=1
			if is_anything_moving=0 then goto prog_level_1
		endif
		if pinsC=42 then                                        ; buttons 1, 4 & 5
			gosub flash_red
			reset
		endif
		if progFlag=0 then
			if svo1_ismoving=0 and pinC.1=1 then	; svo1 not moving, and button pressed
				svo1_ismoving=1
			endif
			if svo2_ismoving=0 and pinC.2=1 then	; svo2 not moving, and button pressed
				svo2_ismoving=1
			endif
			if svo3_ismoving=0 and pinC.3=1 then	; svo3 not moving, and button pressed
				svo3_ismoving=1
			endif
			if svo4_ismoving=0 and pinC.4=1 then	; svo4 not moving, and button pressed
				svo4_ismoving=1
			endif
			if svo5_ismoving=0 and pinC.5=1 then	; svo5 not moving, and button pressed
				svo5_ismoving=1
			endif
			if svo6_ismoving=0 and pinC.6=1 then	; svo6 not moving, and button pressed
				svo6_ismoving=1
			endif
		endif
		if is_anything_moving>0 then
			if svo1_ismoving=1 then					; movement flag is set
				if svo1_dot=0 then				; move in pos direction
					if svo1_pos<svo1_max then		; not at max travel yet
						svo1_pos=svo1_pos+svoSpeed	; add servo speed
					else	
						svo1_pos = svo1_pos -1		; at max travel
						svo1_dot=1				; update direction of travel flag
						svo1_ismoving=0			; reset moving flag
						gosub saveSvoDOT
						sertxd("Servo 1 is open",13,10)
					endif
				elseif svo1_dot=1 then 				; move servo in neg direction
					if svo1_pos>svo1_min then
						svo1_pos=svo1_pos-svoSpeed
					else
						svo1_pos = svo1_pos +1
						svo1_dot=0
						svo1_ismoving=0
						gosub saveSvoDOT
						sertxd("Servo 1 is closed",13,10)
					endif
				endif
				servopos 1,svo1_pos
			endif
			if svo2_ismoving=1 then					; movement flag is set
				if svo2_dot=0 then				; move in pos direction
					if svo2_pos<svo2_max then		; not at max travel yet
						svo2_pos=svo2_pos+svoSpeed	; add servo speed
					else						; at max travel
						svo2_pos = svo2_pos -1
						svo2_dot=1				; update direction of travel flag
						svo2_ismoving=0			; reset moving flag
						gosub saveSvoDOT
						sertxd("Servo 2 is open",13,10)
					endif
				elseif svo2_dot=1 then				; move servo in neg direction
					if svo2_pos>svo2_min then
						svo2_pos=svo2_pos-svoSpeed
					else
						svo2_pos = svo2_pos +1
						svo2_dot=0
						svo2_ismoving=0
						gosub saveSvoDOT
						sertxd("Servo 2 is closed",13,10)
					endif
				endif
				servopos 2,svo2_pos
			endif
			if svo3_ismoving=1 then					; movement flag is set
				if svo3_dot=0 then				; move in pos direction
					if svo3_pos<svo3_max then		; not at max travel yet
						svo3_pos=svo3_pos+svoSpeed	; add servo speed
					else						; at max travel
						svo3_pos = svo3_pos -1
						svo3_dot=1				; update direction of travel flag
						svo3_ismoving=0			; reset moving flag
						gosub saveSvoDOT
					endif
				elseif svo3_dot=1 then				; move servo in neg direction
					if svo3_pos>svo3_min then
						svo3_pos=svo3_pos-svoSpeed
					else
						svo3_pos = svo3_pos +1
						svo3_dot=0
						svo3_ismoving=0
						gosub saveSvoDOT
					endif
				endif
				servopos 3,svo3_pos			
			endif
			if svo4_ismoving=1 then					; movement flag is set
				if svo4_dot=0 then				; move in pos direction
					if svo4_pos<svo4_max then		; not at max travel yet
						svo4_pos=svo4_pos+svoSpeed	; add servo speed
					else						; at max travel
						svo4_pos = svo4_pos -1
						svo4_dot=1				; update direction of travel flag
						svo4_ismoving=0			; reset moving flag
						gosub saveSvoDOT
					endif
				elseif svo4_dot=1 then				; move servo in neg direction
					if svo4_pos>svo4_min then
						svo4_pos=svo4_pos-svoSpeed
					else
						svo3_pos = svo3_pos +1
						svo4_dot=0
						svo4_ismoving=0
						gosub saveSvoDOT
					endif
				endif
				servopos 4,svo4_pos			
			endif
			if svo5_ismoving=1 then					; movement flag is set
				if svo5_dot=0 then				; move in pos direction
					if svo5_pos<svo5_max then		; not at max travel yet
						svo5_pos=svo5_pos+svoSpeed		; add servo speed
					else						; at max travel
						svo5_pos = svo5_pos -1
						svo5_dot=1				; update direction of travel flag
						svo5_ismoving=0			; reset moving flag
						gosub saveSvoDOT
					endif
				elseif svo5_dot=1 then				; move servo in neg direction
					if svo5_pos>svo5_min then
						svo5_pos=svo5_pos-svoSpeed
					else
						svo5_pos = svo5_pos +1
						svo5_dot=0
						svo5_ismoving=0
						gosub saveSvoDOT
					endif
				endif
				servopos 5,svo5_pos			
			endif
			if svo6_ismoving=1 then					; movement flag is set
				if svo6_dot=0 then				; move in pos direction
					if svo6_pos<svo6_max then		; not at max travel yet
						svo6_pos=svo6_pos+svoSpeed	; add servo speed
					else						; at max travel
						svo6_pos = svo6_pos -1
						svo6_dot=1				; update direction of travel flag
						svo6_ismoving=0			; reset moving flag
						gosub saveSvoDOT
					endif
				elseif svo6_dot=1 then				; move servo in neg direction
					if svo6_pos>svo6_min then
						svo6_pos=svo6_pos-svoSpeed
					else
						svo6_pos = svo6_pos +1
						svo6_dot=0
						svo6_ismoving=0
						gosub saveSvoDOT
					endif
				endif
				servopos 6,svo6_pos			
			endif

		endif
		pause 100
	loop
	
saveSvoDOT:
	write 0,b0
return

prog_level_1:
	low ledY
	gosub flash_red
	high ledR
	do
		if pinC.6=1 then
			gosub flash_red
			reset
		endif
	loop
	
flash_red:
	do until pinsC = 0
		high ledR
		pause 100
		low ledR
		pause 100
	loop
	return
Code:
#com 3
#Picaxe 20M2


init:
	write 0,0			; store direction of travel	
	for b27 = 1 to 6		; store minimum settings
		write b27, 128
	next b27
	for b27 = 7 to 12		; store maximum settings
		write b27, 168
	next b27

main:
	do
		high B.7
		pause 500
		low B.7
		pause 500
	loop
Angie
 
Since I'm kind of stuck with my software, I tried a few of the suggestions, but I like none of them so far.

PEBBLE is okay, but I can't stretch resistors, no breakpoints.
DesignSpark has a silly activation process, but it's for PCBs, I can't get it to put any components on a stripboard.
VeeCAD might be okay, but you have to draw all your own components?
Stripboard Magic, as said, is ugly and buggy, but... generating stripboard layouts&#8230;
pen and paper, becomes a mess really quick, and you have to draw all your components as well ;)
 

matherp

Senior Member
To make veecad work properly you need to draw the circuit in another program (Tinycad or designspark both work and are free). Veecad does include a library of component outlines, you just need to "include" the relevant .per files which are in the "program files/veecad/library" directory when you import the design as a netlist, or you can use any previous project of your own as a library so worst case you only need to draw them once.
 

boriz

Senior Member
...Genetic algorithms? Like, you generate a random board and then rate it?...
Pretty much yes. The magic happens when you 'breed' the best-so-far solutions with each other, adding a little mutation here and there. Since each generation contains several different best-so-far solutions inherited directly from the previous, plus some mutated variations, plus some new random solutions, plus every combination of inter-breeding, the processing is pretty intensive. Properly tweaked though, you can get a decent solution fairly quickly and a near-perfect solution eventually.

Also, the user gets to play with the testing 'weights' based upon how they like their boards. IE: Neat/compact/fewest wire links/fewest track breaks/etc..
 
Top