Showing posts with label electronics. Show all posts
Showing posts with label electronics. Show all posts

Friday, 19 January 2018

Software and electronics for driving 5725 LEDs

Following on from my previous post about the touch controller I will now talk about the software and electronics we are using to drive the 5725 LEDs.

All software is written using Python, mostly utilizing OpenCV and Numpy for their great image manipulation cpabilities. The LEDs we will be using are designated SK9822, these are going to be spaced at 15 LEDs per meter, these are not usually made in this size so we incurred a higher than expected cost when ordering them. The triangular panels will consist of several strips of the LEDs spaced at 15 strips per meter, this gives us an LED density of 225 LEDs per square meter. This density was selected for manageability of the overall LED array and for power reasons. The image below shows a render of the LED layout, this render will be used for generating our pixel map.



We had originally thought we would go with the WS2812B LEDs as these are cheaper than the SK9822 but the latter has a global brightness control which allows for much better low brightness colour depth which is an area I have found the WS2812s to be lacking in. I have built a few LED projects using the WS2812B LEDs and have noticed serious flicker noticeable when videoing the LEDs, this is another area the SK9822s excel in as they have a PWM frequency of 4.7kHz versus the 430Hz of the WS2812. More detail on these LEDs can be found at Tim's Blog.

WS2812B left SK9822 right

Driving the panels of LEDs will be 5 Teensy micro controllers, handling 4 panels each, a single Teensy could theoretically drive all of the LEDs but this was decided against due to wiring complexity. The main computer running the majority of the software will send the RGB pixel data over USB to the micro controllers. The Teensy will be running a library called FastLED to control the LEDs, this means it is just acting as a buffer between the main computer and the LEDs.

Apart from the touch input software discussed last post there are a number of different pieces of software we have written. One is a tool to define the LED layout, you upload an image or render of the array and that is displayed on screen, using mouse clicks on either end of a string of LEDs and entering the number of LEDs between, it allows you to quickly define the layout of any shaped array. We now have our LED array defined and the coordinates from our touch input device so we needed to combine these to generate our output to be sent to the LED controllers.

The first control program is relatively simple, we take the touch coordinates from our touch dome, look for the closest corresponding pixel in our LED array and set the colour of that pixel to white (or any colour of our choosing). This pixels information gets stored in an array which will then be sent on to the LED controllers. This is just the beginning and only a basic feature set is implemented, in the future brush size and colour will be changeable on the fly using designated spots on the touch input dome as the input.

In order to see what is happening on the LED array without having to assemble the physical array we wrote a bit of software which renders an approximation of the array on the computer screen. This allows us to quickly test the software stack without the hassle of dealing with hardware.

For powering everything we will have a 240V to 48V DC 30A supply consisting of 4 server power supplies in series, these will be located on the ground in a safe, electrically insulated cabinet. The 48V from this will run to each of the LED panels and then on each panel a 48V to 5V DC 15A power supply will be used to regulate the voltage to the LED and micro controllers. The total power consumption at full white will be approximately 1700W which is slightly over what the power supplies are rated at, it will be very rare for us to display full white on all the LEDs so I have deemed this to be safe, even so there will be fuses at each power supplies output. In the photo below I am load testing a single 48V to 5V supply, in the background you can see the four 12V server power supplies.


The wiring of the dome will be quite a task by itself, I have chosen the Deutsch DTM series of connectors as they are waterproof, reliable and reasonably cheap. They will allow the wiring loom to be disconnected from each part of the system and packed up by itself, this should aid in transport and storage.

Next post I will discuss the mechanical construction of the geodesic dome. For all software information please see our github here.

Friday, 29 December 2017

Camera based spherical touch surface for an interactive light show


For several years I have been fascinated with geodesic domes and LED lighting. To bring together these two passions of mine I, along with a few friends, plan to fit 5725 LEDs inside of a 6 meter diameter geodesic dome. To make it interactive there will be a touch based controller in the middle of the 6 meter dome to allow people interact in real time with the lights around them.


The display will be made up of 20 triangles with around 300 LEDs in each, this makes it necessary for quite an interesting layout and control scheme which is what we have spent the last few months working out. This project will be split up into a few different posts. We will start with the touch input device and related software. Next I will discuss the software and hardware for controlling the LED array. Later comes the labor intensive tasks of building the steel dome, assembling the LED panels and all the wiring to go between everything.

A spherical touch input device is not a novel idea and has been implemented many times before. I found inspiration in a Microsoft research paper found here (pdf), I decided to try a similar approach using cheap commercially available hardware and open source software. I commissioned a local plastics forming company to make a ~500mm diameter dome from translucent polycarbonate plastic using a pressure forming tool. This was chosen because it was the cheapest option available, this has a downside in that the opacity is not consistent. At the peak of the dome the plastic has been stretched the most is significantly thinner than around the lower edges. I was able to work around this in software which I will explain later.


A wide angle monochrome USB camera from ebay is used for sensing, I specifically asked the vendor to supply the camera without an infra red cut filter. In front of the camera is an infra red longpass filter to get rid of all the visible light coming into the camera. Inside the lower edge of the dome I placed infra red LED strips (made by de-soldering a white LED strip and adding my own digi-key bought IR LEDs), these flood the inside of the dome with infra red light. When a finger comes into contact with the outside of the dome it reflects the infra red light, this is picked up by the camera. I used this method because there will be a lot of coloured lights around and want to give my camera the best chance of picking up touches. The image below is what the camera sees.


The software for the touch input uses openCV and python to manipulate and extract information captured by the camera. The image processing involves the following process:
  1. A calibration image is taken with no finger touches and is stored. This gives us our baseline to compare against. 
  2. Subsequent images taken by the camera have the calibration image subtracted from them. This results in only the bright reflections caused by finger touches to show up. 
  3. A blob detection function in openCV is used to find the coordinates of the bright spots. This gives us our touch coordinates which can be used for anything. 
The video below shows the dome working as a mouse input for my computer. At this point I had not switched over to using IR LEDs and was relying on visible light.


Next post I will talk about the software and hardware required for driving the 5725 LEDs. If you are interested in the software all our source files are available on github here.

Friday, 24 February 2017

CNC router conversion

I recently got my hands on an automated chemical testing robot that was no longer in use. I plan on turning it into a CNC router, it will mostly be used for cutting wood and plastic but occasionally aluminium. The machine currently has adequately solid X and Y axis bearing setup however the Z axis has a basic rack and pinion design with only two rods and 4 bushings as the linear guide.


The Z axis will need to be upgraded to increase its rigidity and handle the weight of the spindle motor. As seen in the photo below the existing Z axis is mounted together with the Y axis motor inside a small, thin walled, aluminium box. The box will be scraped and all the electronics and mounting hardware will be re-used.


The left photo is looking up at the bottom of the box, the pulleys you see are the drive for the Y axis, I will be reusing these as well. The right photo shows the bearings for the Y axis and the Y axis reed switch end stops.


The bearings require a special tool (or perhaps just the right sort of pliers) which I did not have, so I came up with my own solution. It is a shaped piece of thin aluminium stock with a couple of 3mm bolts tapped into it. This allows access to the center where a bolt lays.


My tool worked great, the allen bolt is actually a cam shaft with the internal bearing riding on it and the outer ring is essentially a lock nut to keep the cam shaft in the right position. This allows you to adjust the vertical spacing between the two sets of bearings.


I was lucky enough that I had access to an old CNC gluing machine which has a small xy axis carriage. I set about to tearing it down to it's useful pieces. The photo to the right shows my spindle motor next to some of the parts from the gluing machine, I decided to use one of the gluing machines carriages to drive the z axis up and down. This meant I can reuse the belts and motor mount which saves on fabrication.



These are the linear rails and bearing blocks I got out of the gluing machine. One set of these will be used for the Z axis.


The Y axis on the chemical machine is supported by bearings both sides but only has a single side driven by a motor. That was fine when all it was doing was dropping a probe into some liquid but with a router the forces will be much higher. I will need to add a motor and belt to the non driven side.


The plates that holds the Y axis rail to the X axis bearings is what the original X axis motor is mounted to so I will try and mirror this on the other side. I pulled the original non motor side plate off the machine and took all the dimensions for the bearings. I went to a shop called Di Candilo Steel City, they are a steel supplier and manufacturer so I went to their off cut section and bought a small section of aluminium plate that matched the thickness of the plate from my machine.

I had a couple of spare belts and pulleys from the same place I got the original machine from so I used these to put together the new X axis motor drive. The photo below shows the back side of this plate.



I ended up going with a Makita handheld router with 750W of power and it has a speed controller built in. This should be good enough for my purposes, I don't really have any idea how long it will last but I have found people making replacement collets for it so evidently someone has liked it enough to make aftermarket parts. The photo on the right shows a large 3D printed block to cradle the spindle motor. These mounts are very wide and are in compression so should handle the loads. The aluminium angle is from the gluing machine I pulled apart.

 

Constructing the Z axis was relatively simple. I used one of the glue machine axes but modified it a bit by moving the linear rail a bit and mounting the bearing block to the back of the spindle mount along with the belt latch. The motor assembly, belts and pulleys were already there so I didn't have to do any fabrication in regards to those. I tried very hard to ensure I had square holes for the Y axis bearings but my first try I was out. Luckily enough I had room to move things around and second time around it was much more true. In the photo below and left you can see the spindle motor is attached using large pipe clamps cut in half and bolted to the motor mount. The photo on the right shows the Z axis mounted to the machine without the spindle motor. For now I have the end stops attached with double sided tape, once I confirm all the motion I will drill and tap some permanent mounting holes for them.


The photo below shows the back side of the Z axis, the motor shows drives the along the Y axis using a belt and pulleys.



This photo shows most of the original control electronics pulled out of the control box. The original controller used a large industrial PLC and 3 external stepper driver boards. I have no interest in trying to re-use the PLC and from what I was told one of the stepper drivers was dead so all of that has gone to the junk pile (I'll keep the stepper drivers around for future projects). The only thing I kept from the original box is the power supply and wiring. Pictured sitting in the control box is a small Arduino based RAMPS board I was contemplating using.


For the control electronics I settled on a product called the Smoothieboard, I won't go through all the details of it here but it is a 32-bit ARM board with up to 5 stepper drivers on board, plenty of generic I/O and ethernet connectivity. I could have purchased one of these boards fully assembled online but instead I decided to build one (I actually built two at the same time for about the same cost as buying one). I used a pneumatically controlled dispenser to lay out my solder paste, hand placed all the components with tweezers then re-flowed them in a modified toaster oven. The photo below shows the Smoothieboard installed in the original control box.


I used all of the existing wiring in the machine along with running an extra cable to drive the added X axis stepper motor. I spent a bit of time calibrating the software for the control electronics and making sure everything was reasonably square.

A post shared by @emc_technician on


I have a few things to tidy up still like rewiring the spindle motor, get speed feedback from the spindle and add a dust extraction system to keep the mess down. These are all future projects, for now I have a use for the machine which I will show in a future post. I also had the mill drill a bunch of holes in the spoilboard for mounting parts.

A post shared by @emc_technician on