Friday, 14 June 2013

Magentic bearings

Last night's BuildBrighton Open Evening was a pretty busy affair, and there were some pretty cool projects being worked on. We particularly liked James's Magnetic Bearings idea - especially since he's coupled it with solar panels, to generate the electricity to make a motor spin:


The entire assembly magically "floats" above an array of magnets, as current causes the coils beneath the solar panels to attract, then repel, against the magnets placed around them.
It's not 100% friction free, because the lead of the pencil (which is being used as a shaft) is rubbing against a CD placed at one end of the assembly. But graphite itself is often used as a lubricant in bearings, so it's probably about as friction-free as we could hope to get!

As mentioned in the earlier idea, Jason had the suggestion of hanging the motor from a pivot using another magnet, to see if this could further reduce any friction in the entire system. The result is below:



Quite what he has in mind for the project, no-one really knows (and if James does, he's doing a very good job of making it look like he doesn't). But it's using electronics, motors, solar panels and magnets - so it's already up to 11 on the cool scale!

Monday, 10 June 2013

PSoC4 Pioneer Kit from Farnell

Here's an interesting little development board, recommended to us by Jason from BuildBrighton. It's an ARM-based dev board, from those cool kids at Farnell, called the PSoC4 Pioneer Kit (or the CY8CKIT-042 for you part-number junkies). It's an Arduino sized/shaped dev board, is Arduino shield-compatible but with an ARM processor  and costs just £16+VAT!



It comes in a lovely fatter-than-usual DVD case, with mini usb lead and - bizarrely - about four or five little jump leads in a bag. Software is downloadable from http://www.cypress.com/go/cy8ckit-042
What's really exciting is that the processor alone is available for an amazing £1.58 each (in multiples of ten). That's almost as cheap as even the lowest 8-bit PIC microcontroller we use - and much cheaper than the 18F2455 chips we're so keen on using for their USB capabilities.

But it's not just a souped-up usb-capable PIC.... it has up to 6 FPGA modules - meaning you can program what the hardware peripherals actually do: need 6 uart/serial ports on your next device? No problem!


What got us talking about these was CNC Paul's need for a number of quadrature encoders for servo-motor drives on his CNC design. We're still not 100% sure why these are so much more awesome than stepper motors, but he's insistent that servo motors are the way to go and that steppers are just sooooo last year. Which means we need to be able to drive the things which means decoding super-fast high-speed quadrature encoded signals.


So far we've only seen the introductory video, but it was enough to encourage us to buy three of these little beauties - one for me, one for Steve, and one for CNC Paul (Jason already has one, and has a couple of days development head-start on the rest of us!)

The software is already in our download queue and hopefully we'll get a few hours spare to play with it tomorrow and see what the examples are like....

Friday, 7 June 2013

PCB routing at BuildBrighton

They say all the best things come in little packages. I'm not convinced, by yesterday a tiny little parcel arrived, and it was indeed pretty exciting. It was a range of v-shaped cutting bits for cnc routing:


They are made with a 3.2mm shank (ideal for Dremel type rotary tools) but the BuildBrighton router on the cnc machine has a 6mm shank. So we made sure we also ordered collet/adapter, which worked perfectly.


So last night, Mike, Stephen and a few other cool kids had a play about with the cnc routing software and actually got it cutting. Exciting stuff!


We used ExpressPCB and Inkscape to create an isolation path around the outside of the tracks we wanted on the board, using this earlier technique. The final board was pretty impressive. The tracks were drawn at 0.5mm wide. The cutting bit used was 0.2mm and had a 60 degree angle.

(hot off the cutting bed - quite literally, at 35,000 rpm, the cutting bit gets hot and some of this can transfer onto copper surfaced board)

Cutting was aborted after a few minutes. Not because it's slow and laborious (though cnc routing is!) but because the sparks and really bad smell coming out of an increasingly noisy router eventually told us that it was time to consider replacing it!

But before the router gave up, it cut some really fine traces onto our copper clad board.


If anything the traces are maybe a little too fine. This is because our tracks were drawn at 0.5mm wide. We used a 0.2mm wide cutting head and plunged it 0.15mm into the board. Obviously, the deeper the cut, the more of the blade that goes into the material and even with a relatively sharp 60 degree angle on the cutting tip, a deeper cut means a wider cut. We didn't get the software to draw on the outer edge of the tracks, the cutting head followed the line exactly.

So where we had a 0.5mm trace with cutting lines running parallel on either side, the first cut reduced the effective width of the track to about 0.35mm and when the cutting head passed along the other side of the track, it reduced it by about 0.15mm further - so our final trace was more like 0.2mm wide, instead of the 0.5mm we'd planned on.

But that aside, the pcb it produced looked very, very good. (It should be a simple fix, in the software we simple need to tell the cutter to follow the outer edge of the cutting line, rather than the following the dead centre of the cutting line)

Friday, 31 May 2013

BuildBrighton has a new CNC router

While there's not been much activity on the blog for the last few weeks, things have been pretty busy elsewhere. Firstly, we're looking at the feasibility of manufacturing locally and getting more people and businesses involved; so rather than sending designs away to the other side of the world to be made up, we're trying to encourage more people "back home" to try manufacturing themselves. Which has kept us busy these last few weeks - and hopefully we'll have more to report very soon.

In the meantime, locally-sourced manufacturing came one step closer to makers in Brighton with a new CNC router being installed at everyone's favourite local hackspace, BuildBrighton


Here it is, up and running - routing shapes out of scrap MDF today, but who knows.... PCBs next week?


Friday, 17 May 2013

Messing about with 7 segment displays and a PIC 16F628a

I scored a load of cheap 4-way 7-segment displays off eBay the other day. They worked out at about 30p each so I got 20 and stuffed them in a drawer. Then I thought that perhaps it'd be nice to get one working, just so that we know what to do with them in future projects (one already springs to mind).


So here's a simple 4-way 7-segment LCD display hooked up to a PIC 16F628a microcontroller. We're running the PIC off it's own internal oscillator (there's nothing time critical going on here) and will use a simple direct drive method to make them light up.



Basically this means we'll light one digit it a time - lighting the appropriate segments of each character in a 4-digit number and waiting a few milliseconds before moving on to the next. Persistence of vision will give the illusion that all characters are illuminated at the same time.

These particular 7-segment displays have  a common anode - each digit shares the same "power" supply and we need to pull different pins to ground to get the different segments to light up. The display also includes decimal point characters and a double-dot (colon) character for use with digital clocks and so on.






While you can use a driver chip (like a MAX7219) or even a shift register or two to display the digits on these, it's easy enough to drive them directly from the i/o pins. Eight segments and 4 characters means 12 pins are needed to display all four characters at a time.

As ever, we're using Oshonsoft PIC Simulator to write the code in BASIC and using the keyword SYMBOL to assign a descriptive word to an i/o pin. This is really handy because when it comes to laying out your circuits on a PCB, sometimes you need to flip pins around to simplify the layout. Instead of going through all your code and changing every reference to PORTB.0, for example, you simply change which pin the symbol points to.

Here's the code. It's just a counter, but demonstrates how to display all 4 digits at the same time:

Define CONF_WORD = 0x3f18
Define CLOCK_FREQUENCY = 4

AllDigital

Config PORTA = Output
Config PORTB = Output

Dim i(4) As Byte
Dim tmp As Byte
Dim j As Byte
Dim k As Byte

Symbol pin_a = PORTB.3
Symbol pin_b = PORTB.0
Symbol pin_c = PORTB.7
Symbol pin_d = PORTB.5
Symbol pin_e = PORTB.4
Symbol pin_f = PORTB.6
Symbol pin_g = PORTB.1


init:
     'rather than a single variable counting 0-9999
     'we'll keep track of the tens, hundreds, thousands
     'and units separately to make displaying them easier
     i(0) = 0
     i(1) = 0
     i(2) = 0
     i(3) = 0


loop:

     For k = 1 To 100
     
          'activate all four characters, one after the other,
          'but really quickly in succession
          
          For j = 0 To 3

          tmp = i(j)
          'turn off all characters
          PORTA = 0x00
          PORTB = 0xff

          'pull the appropriate segments in each character
          'low in order to light them up
          
          Select Case tmp
          Case 0
          'a,b,c,d,e,f=low g=high
          Low pin_a
          Low pin_b
          Low pin_c
          Low pin_d
          Low pin_e
          Low pin_f
          High pin_g

          Case 1
          'b,c=low
          High pin_a
          Low pin_b
          Low pin_c
          High pin_d
          High pin_e
          High pin_f
          High pin_g

          Case 2
          'a,b,d,e,g=low
          Low pin_a
          Low pin_b
          High pin_c
          Low pin_d
          Low pin_e
          High pin_f
          Low pin_g

          Case 3
          'a,b,c,d,g=low
          Low pin_a
          Low pin_b
          Low pin_c
          Low pin_d
          High pin_e
          High pin_f
          Low pin_g

          Case 4
          'b,c,f,g=low
          High pin_a
          Low pin_b
          Low pin_c
          High pin_d
          High pin_e
          Low pin_f
          Low pin_g

          Case 5
          'a,c,d,f,g=low
          Low pin_a
          High pin_b
          Low pin_c
          Low pin_d
          High pin_e
          Low pin_f
          Low pin_g

          Case 6
          'a,c,d,e,f,g=low
          Low pin_a
          High pin_b
          Low pin_c
          Low pin_d
          Low pin_e
          Low pin_f
          Low pin_g

          Case 7
          'a,b,c=low
          Low pin_a
          Low pin_b
          Low pin_c
          High pin_d
          High pin_e
          High pin_f
          High pin_g

          Case 8
          'a,b,c,d,e,f,g=low
          Low pin_a
          Low pin_b
          Low pin_c
          Low pin_d
          Low pin_e
          Low pin_f
          Low pin_g

          Case 9
          'a,b,c,d,f,g=low
          Low pin_a
          Low pin_b
          Low pin_c
          Low pin_d
          High pin_e
          Low pin_f
          Low pin_g

          Case Else
          High pin_a
          High pin_b
          High pin_c
          High pin_d
          High pin_e
          High pin_f
          Low pin_g

          EndSelect

          'activate the appropriate digit
          'by giving it power
          
          Select Case j
          Case 0
          High PORTA.1

          Case 1
          High PORTA.2
          Case 2
          High PORTA.6

          Case 3
          High PORTA.3
          EndSelect


          'wait a little while for the LED to appear lit
          '(thanks to persistence of vision it will appear lit
          'all the time when actually it's really flickering)
          WaitMs 2

          Next j
     Next k

     'increase the units variable
     i(0) = i(0) + 1
     
     'if we've rolled over to 10, increase the tens
     'by one and set units back to zero
     If i(0) >= 10 Then
          i(0) = 0
          i(1) = i(1) + 1
     Endif
     
     'if we've rolled over to 100, increase the
     'hundreds by one and set tens back to zero
     If i(1) >= 10 Then
          i(1) = 0
          i(2) = i(2) + 1
     Endif
     
     'if we've rolled over to 1000, increase the
     'thousands by one and set the hundreds back to zero
     If i(2) >= 10 Then
          i(2) = 0
          i(3) = i(3) + 1
     Endif

Goto loop
End



And here's a video showing the counter in action:



Wednesday, 15 May 2013

More crazy Farnell packaging

We love Farnell here at Nerd Towers - pop onto their website click around a bit and the next morning, a parcel arrives with all your lovely goodies. Sometimes you can leave it as late at 7pm and your stuff still arrives the next day! But sometimes their choice of packaging leaves a bit to be desired.

Here's what arrived this morning, and the carton it arrived in:


The speakers came in their own dedicated and padded boxes too. Surely a padded envelope would have sufficed?

Tuesday, 14 May 2013

Artwork for screen printing PCBs

Since we got back from Berlin (after a two-day drive on each leg of the journey, and a total of 1,500 miles there and back) we've been giving lots of thought to silkscreen printing for making lots of PCBs.

We've gone back-and-forth with numerous designs, going from A4 panels (so front and back would fit on a single A3 frame) to 160x140 panels (double-sided 200x200mm copper clad board is easier to source than A4 sheets) to eurocard and back to A4.

After about six iterations of the same board design - each time reducing the number of jumpers and vias on our double-sided board, we still couldn't get a design which used as much of the copper board as possible: no matter what the layout, there was always quite a bit of waste on each panel. And then we had an epiphany moment....

We've been concentrating on making a hex-based board for the Dreadball Board Game. And because the miniatures stand on 25mm clear bases, we've been concentrating on making each "cell" on the board at least 30mm - allowing for a 2mm border around each cell, this allows a 28mm push-button surface (miniatures for other games are sometimes provided on 28mm round slotta-style bases). And it's because of these relatively large cells we can't get them to fit nicely on any "standard" sized copper clad board. But here's a thought....

The miniatures in Dreadball are much smaller than standard (read Games Workshop) miniatures. Originally they were designed to be used as-is from out of the box, but a lot of players complained that they fall over easily (because the bases are so ridiculously small)


So Mantic included some clear acrylic bases for the miniatures to stand up in. But the bases provided are pretty lame too - the recess for the rounded player base is too large and the miniature doesn't clip in nicely - it needs to be glued into place. Interestingly, all of the pre-release artwork for the game shows the miniatures painted up minus the clear acrylic bases, which suggests they were just added in as an after-thought.


So already we're thinking of cutting some fresh clear acrylic bases for the miniatures, to make the playing pieces clip in nicely instead of flopping about or needing to be held in with glue.



And then we got to thinking -  if we're going to laser-cut our own bases from 3mm sheet acrylic anyway, why not make them a bit smaller and just reduce the size of each cell in our game board?

And that's exactly what we did.
This time, we're using cell dimensions of 20mm. Allowing for a 1mm border all around (a 2mm gutter between each space on the board) means each hexagon needs to be at least 22mm high.

And by some bizarre coincidence, when we placed a pattern of 8 hexes across and 4 hexes down, reduced to 22mm instead of 30mm, the total PCB layout fits exactly into a 160mm x 100mm rectangle!


This gives us four "blocks" of 8 hexes per module. Which is a nice number for handling with software/firmware - certainly much easier to deal with than 3 columns of 8 which is what we had on our latest design. And the amount of waste around the outside of the module is kept to an absolute minimum. So all in all, we're quite happy with this latest design.

Making a 3x3 grid of these modules gives us a board of 24 hexes across and 12 hexes down - a few over from the 11x23 that make up the widest points of a Dreadball pitch, but sufficient to make a playable surface. Double-sided eurocard-sized copper board is all over the internet, so this design is perfect in terms of ease of manufacture as well as for sourcing the materials. The final board made up from these modules is a decent size too:


Eighteen inches isn't a massive board, but is still a pretty decent size. And when the board is all made up with etched squares and flashing LEDs, the closer proximity of the miniature playing pieces will make for a slightly more chaotic-looking game - just like a real futuristic sports simulation!



We're planning on getting a silkscreen made up with the top design on top and a mirrored copy of the bottom design on the bottom of an A4 sized frame. This will allow us to use the same screen for both sides of the board - we just need to mask off the unused bit and make sure the board is correctly lined up before each print, but that's not a major issue... is it?