Category Archives: electronics

RasPiComm+ finalized, Indiegogo campain preparation

It has been some time since the last post about the RasPiComm+, but be assured, we were very busy and have put huge efforts in finalizing the product and I can now proudly say that we are ready for production.

We are launching a Indiegogo campaign mid-November 2014, so please spread the word!

RPC+both sides

So here is an update and/or introduction for those who have not heard about the RasPiComm+ before.

The RasPiComm+ is an extension platform for the Raspberry Pi which offers an arbitrary combination of up to 4 modules. The huge difference to other extension boards out there is not only the flexibility of using exactly the modules you need but also that all modules come with full linux driver support. I’ll do separate posts showing that in detail, including videos.

 RPCP

Connection to the Raspberry Pi

You may have noticed that the header has 2×14 pins which is uncommon. That is easy to explain: The RasPiComm+ is backwards compatible to the Raspberry Pi B, but also supports the EEPROM functionality for the Raspberry Pi B+, so the inner 2 pins are unused on the B version. When you are using the B+ version, the EEPROM of the RasPiComm+ can be accessed from the Raspberry Pi.

So how does it work now?

You just plug in the modules you need (see below for available modules).

The easiest way to install the firmware and drivers is in online (the Raspberry Pi is connected to the Internet). Just run the script “./rpc+setup” and you’re done. You can now access serial devices via /dev/rttyRPC+0 to /dev/rttyRPC+3 depending on the  module slot. I/Os are mapped to /sys/class/gpio just like the GPIOs of the Raspberry Pi are. That means you can reuse software that access the GPIOs of the Raspberry Pi directly. Special interfaces which are not digital pins or serial devices (like for example analog inputs or displays) are mapped in files in the /proc/rpc+/module1-3 folders. See the documentation of your modules to see how to access the resources from the Raspberry Pi. In the next posts I will show you some examples on how to use various modules, from I/Os, serial ports, sending and receiving SMS messages to sending a bitmap to a Sharp Memory LCD.

What does the script do exactly?

  1. First, it checks if there is a base firmware on the RasPiComm+, if not it downloads and installs it
  2. Then it scans all 4 module slots and reads the EEPROM IDs to identify which modules are plugged in
  3. In the next step a request to our buildserver is made to request the firmware configuration for the ARM microcontroller and the CPLD
  4. The firmware is then built by our buildserver and the firmware package is downloaded, the files are stored in a local cache on your Raspberry Pi so you do not need to be online if you wish to reinstall the same configuration again
  5. The script programs the ARM and then the CPLD firmware
  6. Then the corresponding drivers are loaded
  7. Done. You can now access all modules from your Raspberry Pi

 RPCP Setup - New Page

Web Firmware configuratorbuildserver

You do not need to use the automated script. You can also select the modules manually and download the firmware. This also enables you to download the sourcecode for the firmware.

If you install the Unity 3d plugin (http://unity3d.com/webplayer) you can see a beautiful 3d visualization of your configuration.

We are currently also working on a case generator. When it is ready you can also auto-generate a STL file used by 3d printers with exactly the openings you need for your selected modules. You can then print it on your 3d printer or send the file to a company offering 3d printing as a service like www.shapeways.com

The modules

We already have QK0A0099quite some modules available for the start, and we are currently testing a lot more.

Modules available:

  • 8 Input (5-35V)
  • 8 Output (5-35V)
  • 8 Analog Input (12 bit)
  • 4 Relays
  • RS-485/RS-485-4 wire/RS-422
  • GPS
  • GSM
  • Profibus
  • Sharp Memory Display

Modules we work on:

  • 1-Wire
  • 16 Isolated I/Os (24V)
  • Stepper Motor
  • CAN
  • KNX
  • 6LoWPAN
  • 433MHz
  • 868MHz
  • 9-Axis MEMS (3 axis gyro, accelerometer and magnetometer)

Each module has an EEPROM to identify itself. The installer uses this to request the correct firmware. There is also user-space available on the EEPROM, you can store data like counter values if you want to.

More posts are coming. In the next one I’ll quickly show you some simple scenarios how to use modules and how easy it is to script functionality.

Another post will I’ll do more in-depth explanation on how the RasPiComm+ works internally and why we made certain design decisions.

After that I will do a post on how easy you can hack the RasPiComm+ and compile your own firmware code based on the boilerplate code, to run it standalone (without the Raspberry Pi) for example or do ultra-fast switching logic with the CPLD without CPU intervention or implement additional functionality on the ARM processor with the GNU C compiler.

DIY pick and place machine

Current status of my DIY pick and place machine

Current status of my DIY pick and place machine

When I started developing the RasPiComm Plus I soon realized that I need the ability to manufacture smaller batches of our boards since we will have at least 10 different extension boards. I also wanted to stick to my 100% made in the EU principle.

Usually I would use my manual pick and place system to assemble prototypes. The boards are manufactured in Germany and sent to us. For larger quantities I would send the parts and boards to another company in Germany and let them assemble them. That costs almost €4.000 per 1.000 boards just for the assembling in the case of the RasPiComm. And it will take time, up to 4 weeks depending on their schedule. I needed a better solution and faster turnaround.

no more manual pick and place

no more manual pick and place

Since I have a manual stencil printer and a really cool vapor phase soldering oven a pick and place machine is the missing piece of equipment to have a reasonable low volume production facility.

So those were my options:

Buy a new pick and place machine

I compared prices of various options. An US company sells a cheap pick and place, very simplistic design (no housing, aluminum profiles), for about $25.000. Shipping to Austria would have added another $2.500. The machine itself was not impressive at all. I had my doubts if it could handle 0402 relieably.

The TM220A, a $4.000 toy-grade pick and place as Dave L. Jones calls it (and I am completely with him on that) has no vision. And it does not even look like it is worth $4.000. Not an option at all.

Buy a used pick and place machine

Tempting. Ryan O’Hara bought a Quad PnP for about $16.500 (without the feeders). He talked about it on The AmpHour. It is not that easy if you are not living in the States. I cannot come over and have a look if this machine is what I want and shipping is of course awfully expensive to Austria. Another thing is the software. This price only applies to the DOS version. I like having control over the software and my processes.

Build one

Well this option has the bonus that I’d have to build something from scratch. Do you need more reasons apart from this one? I know, me neither.
Nevertheless it has to be clear that building such a machine is inevitably more expensive than buying one in the short-run. If you don’t consider your time worthless of course. But one gets better with each project, you will learn a lot and you will have a system which you understand down to the tiniest bit of wire and code, so you can tackle every problem that arises, you can adapt software and hardware to your needs. And as an entrepreneur I also keep in mind that it maybe will be a product someday, or parts of it, so I always consider these kind of projects as an investment for the future not only in terms of learning and training for me and my employees but also having working modules that can be reused later on.

Scope

I thought about my goals, what I needed and what I don’t need. First of all this should be a rapid prototyping project. I will make design decisions based on if they are practical and the effort/benefit ratio fits for me. It should not be a project which is never really usable. Since this is more a side project that  a full-time project I gave myself 3 months. As I am writing this the 3 months are not over yet, so it is still in time.

I also did not want to think about automatic feeders too much for now. I knew I’ll have to redesign small areas of the machine for automatic feeder support. Until then working with belts held down by a polycarbonate shield should be sufficient for prototype quantities. For the small volume production target feeders are a must of course. So this is a compromise I make when starting this project – in the beginning I won’t have automatic feeders.

Hardware

After some hours of 3d-modelling we milled the first aluminum parts and ordered some off-the-shelf components and aluminum profiles. Milling was done with a very simple and cheap CNC, not even my good one (I got two of them). The CNC does not have a toolchanger, not even ball screw bearings. But it does its job. After that the parts went to anodization. Black of course.

Next step: Motors. I used quite beefy stepper motors in closed-loop mode for the X and Y axis and servos for the 2 heads I planned. Part rotation is again done by a stepper motor with a hollow shaft. Two simple turning parts made from stainless steel made the pickup base for the nozzle. I glued a magnet to the bottom. I used simple fuse clips as the nozzle holders. Nozzle-changer: done.

X and Y have ball-screw bearings with a pitch of 20mm to get the speed up. With a 500 step encoder with quadrature encoding this means a positioning precision of +/- 0.09° which would be  +/- 100µm. Enough for this machine. I plan to switch to BLDCs for a couple of other reasons with a 4000 step encoder which would lower that to 50µm in normal mode and 12.5µm with quadrature encoding. This is of course hypothetical, the mechanics are not that precise but still very good since I only used high quality ball bearings for X, Y and Z axis. The guides are also precision ones.

Assembing was easy, it took a couple of hours. Wiring was a bit of a pain, it took a whole day.

For the vision system I am using are 2560×1680 pixel USB3.0 cameras. One from the bottom for part alignment and a top camera for PCB/feeder alignment. I made a simple ringlight with 48 650nm wavelength LEDs. Funny detail: I was not able to do a circular pattern alignment of the LEDs in Altium, so I wrote a tiny Autohotkey script which allowed me to enter a number of parts and a diameter and it automatically aligned the parts correctly. Huge timesaver when you want to play around with the radius in which the parts are aligned on the PCB.

I also added a joystick to move around in the x-y plane, for testing and basic board adjustment. Fiducial recognition and board alignment should be done by camera of course, but to give the software a hint where the board is the joystick allows to move to the approximate position.

I wanted to have the top metal platform made since my CNC is too small to mill it so I asked a company what it would cost to do it for me. The price was about €1.500, too expensive for now. Thats why currently I only mounted a 10mm thick and 200mm wide aluminum sheet I had. Enough to hold my small PCBs and a couple of smd parts.

Software

Pick and Place Software

Pick and Place Software

Since I already did write some code some years ago for a pick and place thing I had something to start from. Writing a gerber-file importer took me two days (I did it from scratch using the gerber file format specification from Ucamco). Martin adapted the old code and added the support for our motor drivers, our cameras as well as reading the pick and place csv files. So we had our complete software solution to load gerber and pick and place data and control our motors. Sweet!

For the vision I used OpenCV which I knew a bit. This was very straight forward, it took me under an hour to get a usable rectangle detection on an 0402 part with the rotation information. Still have to test how it will work in the real world. If I learnt anything from building machines than that in the production environment not a single thing will be as in your lab/test environment. I set the filters so that only the red light of my ringlight is captured. That way sunlight won’t screw up my detection. We have a glass roof in the office and no housing for the pick and place yet, so that was quite a good test for the relieability of the alignment algorithm.

Another cool thing when writing your own software is that it can be taylored to your specific process. Since I use GIT as my version control system (even for Altium) I want the pick and place machine to pull the project and load the PnP and gerber data. The PnP will of course have a wireless lan built in and a nice sweet touchscreen and nice GUI.

On what hardware should the software run? Raspberry Pi?

The PnP could be controlled with a Raspberry Pi with our RasPiComm+ and in the beginning I wanted to use this as a platform. But since our old software is built with WPF (windows presentation foundation, a very powerful GUI framework), porting the GUI would have been too cumbersome. The bussiness logic would be easy to port since Mono runs on the Raspberry Pi. But in terms of GUI there is simply no match for WPF out there. And I want to use a touchscreen to control the PnP. Easy to make custom UI controls with WPF, very time consuming with other technologies. And when it comes to the vision system a little ARM processor would definately slow things down. The USB 3.0 cameras are running at 15fps at full resolution, pumping 180MB/s into the OpenCV algorithms, easy for a modern CPU but not realistic for an ARM processor (there is of course no USB 3.0 support limining bandwith even further). I also considered the Xilinx Zynq since I have a ZC702 development board. I played around a little bit, attached a camera but after a day I realized thats not the way to go. In terms of development time nothing can beat C#. And CPUs are fast enough for what I needed, and power efficency is not a mayor concern here. To be up and running fast I also would have needed extremly expensive Xilinx IP which I would avoid at all costs (no pun intended). And then there is the problem with fast adoptions. I want to be able to tweak and parametrize the vision system algorithms for different part classes, easy and fast when done in pure software, hard and time-consuming when done in FPGA logic even with all the amazing IP Xilinx provides.

So in the end it is a boring mini-itx board with a 3.2GHz quad-core and 4GB of RAM. More than enough, and alltogether (including CPU, RAM, SSD and full-HD touchscreen) cheaper than the ZC702 development board alone.

Automatic Feeders

The automatic feeders are not done yet, I just have some basic design approaches. Some say they are the hardest part. I don’t know yet, my focus was to get the PnP up and running. But if its too hard I will simply buy some. Currently I only have a simple aluminum board holding down the components with a polycarbonate sheet just for initial test run purposes. Simple but it works for now. I’m still a bit struggling with the resonance of the motors, at certain speeds small parts can flip. But on one hand the resonance can be minimized by tweaking the CL-parameters of the motor controller which I have not done yet , on the other hand I still want to design proper feeders and replace the stepper motors with BLDCs. So thats not a mayor concern for now.

Next steps

My next step is tuning the pick and place process and do a video. And building feeders of course.

Here is a short speed/motor test with a joystick (no actual pick and place action yet, I’ll do that in a separate video):

UPDATE: First pick and place test with and without vision:

RasPiComm – a Raspberry Pi piggyback board

Raspberry PI Communication and I/O board

RasPiComm on Raspberry Pi

Update: visit our forum on our freshly relaunched website amescon.com to comment or ask questions about the RasPiComm!

After finding out about the GPIO header of the Raspberry Pi it was inevitable to build some kind of extension board for it. I was working with Arduino, Netduino and FEZ Boards in the past and they all are quite expensive compared to their capabilities and not really stable, especially when it comes to Ethernet communication. The Raspberry Pi seemed to be a perfect alternative for complex applications and easy development. Of course it is an application processor not a microprocessor, so they are not quite comparable but nevertheless a great platform for a very decent price. I want to thank the Raspberry Pi team for bringing out this awsome piece of hardware!

After checking out the available documentation I built the first version of the extension board. Even though it was working as intended I wanted to get rid of some limitations so I built v2 which is slightly different. I will write a seperate blogpost about the technical details, here I just want to share the basic concept and capabilities.

Features

  • RS-485 port
  • RS-232 (‘serial’) port
  • 5 inputs connected to an onboard joystick and screw terminals
  • 2 outputs (5V) with LEDs (green and red) also connected to screw terminals
  • I2C connection
  • Real time clock (RTC) with backup battery

What for? RS-485! And why?

RasPiComm Connectors

The main reason I built the RasPiComm was the RS485 interface to control stepper motors. You can of course use I/Os in PWM mode and a second I/O for direction to drive this, but since the Raspberry Pi is not a realtime system it does not behave well especially with start/stop ramps. And you would have to write code that does all of that. But I like elegant solutions, and this is certainly not one. There are a lot of stepper motor controllers out there with rs485 support. I’m using the steprocker board (http://www.motioncontrol-community.org), a very powerful open-source solution with state-of-the-art stepper control. This board supports a 256 microstep resolution for ultra-smooth stepping. And it implements the TMCL protocol, which is very easy and fast. The neat thing about RS-485 is that you can control up to 256 devices. The steprocker board is capable of driving up to 3 motors. So if you want you can control 768 stepper motors with one Raspberry Pi. If you really want to.

RS-232
This is always nice to have. It simply connects to your “/dev/ttyAMA0” serial device to the outer world. It outputs the correct RS-232 levels so you can connect it directly to a PC serial port if you want. You can open a console and watch the debian debug output for example.

5 inputs
I added them because the GPIOs are there and I don’t like unconected I/Os. Who knows, someday I (or you?) will need them. The onboard joystick is handy for launching actions and to test your program.

2 outputs
The main reason for adding them were the LEDs. In version 1 these 2 outputs were only connected to two LEDs. In version 2 I added 2 transistors and they switch 5V. I added screw terminals, so if you want you can connect two relays (with a supressor diode).

I2C connection

RasPiComm with 128×64 pixel OLED display

The I2C connection is also connected to a header. I attached a small I2C OLED display. There are a number of cheap I2C displays on ebay.

Real time clock (RTC)
And last but not least: I attached a real time clock to the I2C bus. The Raspberry Pi does not come with a hardware clock. It forgets the time when it looses power. Its very well understandable that they did not do that, the RTC chips aren’t cheap. But nevertheless a clock is a nice thing to have, especially if you want to trigger actions based on the time of day (home automation for example).

I placed the battery on the backside of the board. Debian supports the chip I used directly, so there was no programming, it simply works with a few calls and your system time is synced with the hardware clock.

Piggyback board design
As I mentioned before, I like elegant solutions. And I also like compact solutions. So my goal was to create a small, elegant extension board without using a flat cable to connect to the Raspberry Pi, my desk already is cluttered enough. It should be a shape which does not change the footprint of the Raspberry Pi and doesn’t cover the processor to maintain heat dissipation. Ths ‘piggyback’ design was born. It doesn’t provide a lot of PCB-space, but there is still plenty of room to realize a couple of features if you go with smaller SMD parts. They are all still hand-placable since I only use tweezers to populate my prototype boards.

In part two I’ll cover the technical details and software.

If you have ideas how to improve the RasPiComm go ahead and post a comment. Want to see other features? Form factors? Colors?

RasPiComm Hardware
RasPiComm v3

Arduino/Netduino GSM Shield

 

Versatile Arduino/Netduino GSM shield

I needed a way to send SMS messages from a Netduino board, so I first tried the SM5100B shield. It worked somehow but it was not very stable and I did not like the hardware design. It also lacked some features. So I decided to build my own. Here is what I did (if you already used Arduino/Netduino the nomenclature below will be familiar, if not read a little bit about Arduino or Netduino, its a really nice microcontroller platform):

I wired both serial ports (so you can open a data connection and still send AT commands through the other line), A2 and A3 are used for ignition and hard reset of the gsm module and D12 and D13 are used for the ring indicator (signals events) and power indicator. These two lines are optional so I added an smd jumper pad which is connected and can be cut easily. the same is for the second serial interface.

I also added a battery holder for backing up the RTC in the module, so you do not lose the time stored in the module. Also very handy.
The SIM card holder is a push-lock and is on the bottom of the PCB facing to the side with the usb and power connector, so when a housing is used you can cut a slot into the housing and change the sim-card without opening it.

The USB port can be used to configure the GSM board, but this is optional. All settings can be made through the RS232 interface.

%d bloggers like this: