Advertisement

Blog

How a Coffee Packaging Machine Educated Me

Early in my career I decided to channel my inner entrepreneur into an electronic design consultancy. One of my first projects was to design a control for a coffee packaging machine. It was in the late 70s and microprocessors were on everybody's lips, but few actually knew anything about them. I had set myself up as an expert, on the basis that the one-eyed man was king in the land of the blind.

In principle the pneumatically powered packaging machine was going to have a two-stage fill. The empty can was first going to be tared on a load cell, and then the coffee powder was going to be bulk filled at a high rate till the can was about 80% full by weight. In the second stage, the partially filled can was then going to be shifted off the first load cell onto a vibrating table to settle the contents. The third step was to move the partially filled can onto a second load cell and then trickle filled at a low rate to 100% of its target weight. Of course with automation, both the bulk and trickle feeds happened simultaneously (on different cans of course) and in fact there were two stages of vibration between the bulk and trickle. There were also four lanes in parallel. The trick was to fine tune the bulk and trickle so that both took about the same time and on each channel.

Figure 1

Pictorial representation of the filling process.

Pictorial representation of the filling process.

The feeds consisted of vibrating channels and the accuracy of the fill was determined by the amount of coffee “in flight” when the vibrator was turned off. It was a function of the density of the coffee powder and its self-adherence and would obviously vary from batch to batch.

The microcomputer had to provide eight digital outputs for the eight feed vibrators and a single output to index the machine from one step to the next. It also had a 12 bit A/D with an eight-channel input multiplexer for each of the eight load cells. It also controlled 4 x 4-digit seven-segment displays and several thumbwheel switches for target weight, and percentage bulk fill. For the computer we opted for an Intel Multibus based chassis using an 8085-based computer board, but for some reason added a wire wrap board for the expansion which we were probably intending to convert to a customised PCB. However we only made 4 machines and the intention evaporated.

The expansion board included DG202 analog switches for the multiplexers and an Intersil ICL7109 as the A/D. Also included were some 2716 EPROMs, display drivers and other sundry drivers. (Remember the LED display drivers, SN75491 and SN75492? The former was made obsolete right about then if I remember correctly, and I had to scramble to discover the ULN2003A to do the same job.)

The load cells were of the LVDT type (linear variable differential transformer) and I decided that I was a digital engineer and wanted nothing to do with the signal conditioning needed, so the machine designers contracted someone with more courage than I did. He knocked together an amplifier using a 741, each housed in a plastic module with an octal relay base and then disavowed all responsibility.

Figure 2

The complete machine with the controller on the right. Notice the logic analyzer on top of the panel.

The complete machine with the controller on the right. Notice the logic analyzer on top of the panel.

Figure 3

Control Panel. Note the 10 turn vibrator control pots. These were wired independent of the controller.

Control Panel. Note the 10 turn vibrator control pots. These were wired independent of the controller.

Figure 4

The internal circuitry.  The wire wrap board is the visible board in the chassis. The 741 amplifiers were contained in the black modules at the bottom of the photo.

The internal circuitry. The wire wrap board is the visible board in the chassis. The 741 amplifiers were contained in the black modules at the bottom of the photo.

The project was developed in assembler with a minimal development aid- an SDK85 development board. Given that there was a lot of buffering of data with the pipeline of coffee cans certainly arrays would have been great to use, but this was all coded the hard way. Debugging was with a logic analyzer and any changes were coded on the fly using “jumps” to free memory locations and the new code inserted there.

Initially I had some trouble with the input multiplexers blowing up — they were relatively expensive and I had to find a solution in a hurry. Fortunately some series resistors and diodes solved the problem, but that was only the first in a long series of problems. As you can imagine the 741 op-amps would drift, along with the other circuitry. I evolved a method of calibration as detailed in my blog, Calibration, Part 1, on my own. This was all new stuff, remember. An article appeared in EDN from National Semiconductor using the same approach after I had come up with my ideas and I felt quite pleased with myself for being capable of original thought. In the end we prepared 32 cans of known weight that we would shift through the machine as part of the calibration cycle that was done every four hours or so.

With this we managed to get the machine mostly operational. At one stage though, the machine started working backwards. I remember talking on the phone with the mechanical designer who categorically stated (and I am paraphrasing to significantly less profane language) that there was absolutely no way that this could happen. I took some delight in informing him that I was looking at evidence to the contrary.

With all that resolved there was still a problem that really was a show stopper. At random points during a fill, the micro would go “nuts” and one or more of the feed channels would deposit a mountain of coffee over everything. The only thing that would cure this was a reset to the micro. No one had ever heard of a watchdog timer back then and I really doubted my abilities and my future. I suddenly had an inspired thought- I connected the chassis earth to the negative voltage of the internal power supply and suddenly everything was going right.

If I was a coffee drinker before this experience, I am pretty certain that I wouldn't have been after. Instant coffee is only a very small part real coffee (they wouldn't tell me how much). The rest is bulked up with maltose, dextrose and sucrose and probably several other “oses” as well. It is extremely hygroscopic and if there was any powder left standing, there would be this really sticky, gritty residue. At that time NASA was having trouble with the adhesive for the tiles on the space shuttle (it was not operational yet). I was sure that instant coffee would have done the trick. The only way to clean it was to wash the machine down with soapy hot water. When we started the installation, the air filtration and conditioning system had not been completed, so there was plenty of coffee dust in the air. It would get in your eyes, up your nose, down your ears and into your socks. Taking a shower after work was like standing in a percolator. If you had placed a cup in the shower drain you would have got a strong cup of (instant) coffee!

With time I moved into some analog design and although I still fell out of my depth, I do know now a bit about instrumentation amplifiers and other factors like drift, long signal wires, surge suppression, ground loops, and noise.

29 comments on “How a Coffee Packaging Machine Educated Me

  1. Victor Lorenzo
    July 18, 2014

    Thanks for the story, @Aubrey, very interesting.

    When I started playing “hard” with microprocessors and microcontrollers in late 80's programming was still “an art” and I still remember those long debugging sessions: compile, program the EEPROM, test, UV erase, compile… and so on.

    At that time we “discovered” too the useful trick that you mention. The Zilog's Z80 CPU (the uProcessor I started playing with) used instruction code 0x00 as NOP (no operation), same as the 8085. In the EEPROM non-programmed bits were 1's and programmed bits were 0's so converting one JP (jump) instruction into NOP was simply a matter of filling its three bytes with 0's.

    By the time the 68HC11 uController was adding more fun to our job we also were using an EEPROM emulator. It was based on a static and relatively fast RAM memory which was accessible from another external CPU too. Code was downloaded from the PC using a serial RS232 cable and…. no more need of burning and erasing EEPROM memories for debugging.

    Now, after getting almost “addicted” to using a hardware debugger for firmware developing on, mostly ARM, modern SoC's with internal flash memory I have to maintain and keep up and running a very old product for my current employer. One of the modules is based on a 68HC11 with a socket for an external EPROM…. like a deja vu, a “Return to the past!”.

     

  2. vasanjk
    July 18, 2014

    AK

    Nice narration. Most of us have gone through this path. For me, it was a Nurse Call System used in a hospital.

     

    Victor

     

    My journey started with 8085 and went through Z80. Further it was microcontrollers – 8051,PIC and now , its Renesas.

  3. Vishal Prajapati
    July 19, 2014

    I started learning the CPUs and MCUs with 8085 in the college lab kits. But probably my group of 4 people were the only people who had seen and used the UVEEPROM with glass window over the silicon die in my whole collage.

    We had taked circuit diagram from one famous old electronics magazine and tried to recreate it on the hardware. The circuit was using 8031 MCU (with out flash memory) and UVEEPROM for storage of program instructions bytes. The UVEEPROM was programmed and erased for about 3 to 4 times and then it got corrupted. So, I had to changed the MCU from 8031 to 8051.

     

    Then it continued from there to 89S52, AVR, PIC, MSP430, a bit of Renesas and ARM.

  4. samicksha
    July 19, 2014

    Yes, Erasing via an ultraviolet light source can make them one-time programmable

  5. Netcrawl
    July 20, 2014

    @samicksha Yes I remembered this one in college, EPROM is an early type of flash memory that retains its when its power supply is terminated or turned off. Once programmed, EPROM can be erased by exposing it to strong UV source such as mercury-vapor light, programming an EPROM requires a special program voltagea. Once programming voltage is applied to EPROM we can now apply the address location and programmed data on it. 

  6. Victor Lorenzo
    July 21, 2014

    After a few PROGRAM-ERASE cycles some 2716 and 2732 EPROM chips got too stressed and “relaxed” into NAMPE-ROM memories.

    ;D, [N]ot [A]ny [M]ore a [P]rogrammable and [E]rasable [R]ead [O]nly [M]emory.

    It was very important to read the memory back and verify its content after every programming cycle.

  7. Victor Lorenzo
    July 21, 2014

    @Aubrey, Almost every time I see a machine I think of it as a piece of art.

    Developing a production automation machine can some times be a mixture of fun, stress, challenge and brain killing hardware/software development. It was an exciting work for me during several years.

  8. antedeluvian
    July 21, 2014

    Victor

     

    Almost every time I see a machine I think of it as a piece of art.

    Developing a production automation machine can some times be a mixture of fun, stress, challenge and brain killing hardware/software development. It was an exciting work for me during several years.


    I completely agree with you. I would also add frustation to the list as you try and extract from the customer exactly what they want, and why it is impossible to do what they because it violates the laws of physics or are self contradictory.

  9. antedeluvian
    July 21, 2014

    Vishal

     The circuit was using 8031 MCU (with out flash memory) and UVEEPROM for storage of program instructions bytes. The UVEEPROM was programmed and erased for about 3 to 4 times and then it got corrupted. So, I had to changed the MCU from 8031 to 8051.


    This reminds me of some companies that didn't have EPROM technology who created micros with a socket on the back so that you could piggyback an EPROM which you would program with an standard EPROM programmer. If I remember correctly Mostek was the first company to do this with their F8. I am sure National Semi did one with the 8048 series, because I still have one. Here is one example. If you were having problems with 2716/2732s this of course wouldn't solve them

     

  10. samicksha
    July 21, 2014

    I guess this was one of the reason EEPROM was developed to provide an electrical erase function and has now mostly displaced ultraviolet-erased parts.

  11. antedeluvian
    July 21, 2014

    samicksha

    I guess this was one of the reason EEPROM was developed to provide an electrical erase function and has now mostly displaced ultraviolet-erased parts.

    I am not sure if it was the only motivator. There has always been a need to store parameters and originally there was only battery backed CMOS RAM which was not very dense, and of course you had to have a battery plus some write protection. Back then, access times for the EEPROMs were always much slower than EPROMs, and the number of bytes was always much smaller than EPROMs.

    Hughes actually had a counter implemented in EEPROM technology so that the count was preserved when the power went down. I wish I still had the data sheet.

    Micros today either emulate EEPROM in the flash, or have both flash and EEPROM. I am not really familiar with the full range of options and implementations, but I believe the difference between flash and EEPROM is the erase and programming block size. I found this article on the difference as well as this in Wikipedia which seems to concur, adding cost and erase/programming time as additional differentiators.

  12. geek
    July 21, 2014

    “I completely agree with you. I would also add frustation to the list as you try and extract from the customer exactly what they want, and why it is impossible to do what they because it violates the laws of physics or are self contradictory.”

    @antedeluvian: I think when you're doing something like this, you also need a culture in the company that supports this. There should be no penalty for experiments that go wrong and whacky ideas should be encouraged rather then be critically looked at. Unless that's there, I don't see how a development model like this can survive in a company.

  13. geek
    July 21, 2014

    “It was very important to read the memory back and verify its content after every programming cycle.”

    @Victor: I remember doing that too. The funny part was that even it was supossed to be “reprogrammable”, the life was rather short. I don't remember most of them working after 5,6 times of programming and erasing. That also depends on the quality too I guess.

  14. Victor Lorenzo
    July 22, 2014

    @tzubair, up to my knowledge most companies involved in top quality automation machines development encourage their developers to be innovative but also practical.

    Some manufacturers have separate teams for scientifical research, foundations development and for integration. Crazy, whacky, failed and even absurd ideas tend to stay scoped to the R&D team so the integration team carries to practice procedures, methods, innovations and ideas which have been pre-tested and pre-qualified by the R&D teams. It is a method which produces very high quality machines, but it is also expensive.

    I'm talking about, more specifically, several companies which produce machines for the smartcards and chips manufacturing markets which are sold by not less than 400k USD (each).

    For small startups and in-house made machines, in my opinion, things are totally diferent.

  15. geek
    July 22, 2014

    @Victor: I was also talking about the R&D departments at companies. Some R&D departments are highly structured where a lot of analysis and financial justification is required to get an idea approved and then only work on it can be started. While some companies have highly informal R&D teams who can start working on whatever they want. Obviously the former system cuts down the risks but reduces innovation and creativity.

  16. Myled
    July 24, 2014

    Aubrey, thanks for this nice article and i think everybody may have such nostalgic feelings about their first project. While going through the article, it remembers me about my first college project “Design and development of Digital Tachometer”. That's my first design project and implemented well with the help of opto coupler and associated micro controller circuits.

  17. Myled
    July 24, 2014

    “Developing a production automation machine can some times be a mixture of fun, stress, challenge and brain killing hardware/software development. It was an exciting work for me during several years.”

    You are right Victor. Taking lots of stress and putting all efforts in right way can lead to an end cheers.

  18. Myled
    July 24, 2014

    “I was also talking about the R&D departments at companies. Some R&D departments are highly structured where a lot of analysis and financial justification is required to get an idea approved and then only work on it can be started. While some companies have highly informal R&D teams who can start working on whatever they want. Obviously the former system cuts down the risks but reduces innovation and creativity.”

    You are right tzubair. It depends on company to company. If you want to allocate new funds for R&D, you have to justify with your work and ROI for that. But some companies like Samsung, LG, Intel etc voluntarily accounting certain percentage of their profit for R&D purpose, in such cases you have to submit only the proposals.

  19. geek
    July 27, 2014

    “But some companies like Samsung, LG, Intel etc voluntarily accounting certain percentage of their profit for R&D purpose, in such cases you have to submit only the proposals.”

    @Myanalog: It really depends on what the strategy of the company is. If they're in the growth phase then they will heavily invest into R&D to come up with new products for the future. If they're in the maturity phase, they'll look to cut down on the spending and work more on the sales and marketing side.

  20. Myled
    July 29, 2014

    “It really depends on what the strategy of the company is. If they're in the growth phase then they will heavily invest into R&D to come up with new products for the future. If they're in the maturity phase, they'll look to cut down on the spending and work more on the sales and marketing side.”

    Tzubair, the current market trends and strategy are in different way because majority of the investors are not able to get ROI from their R&D products because of fast phase out of the products. I mean short life cycle of the products. So they are either acquiring or merging with startup companies having innovative products.

  21. geek
    July 31, 2014

    “the current market trends and strategy are in different way because majority of the investors are not able to get ROI from their R&D products because of fast phase out of the products.”

    @myanalog: I think the reason behind the low ROI has more to do with the quality of the R&D process. There are companies like Apple and Samsung who're constantly doing R&D and every other product they release is a success. I think that's because their R&D department is quite mature and stable and has a well-defined process.

  22. yalanand
    July 31, 2014

    There should be no penalty for experiments that go wrong and whacky ideas should be encouraged rather then be critically looked at.

    @tzubair, I totally agree with you. But I dont think many companies foster this culture. If companies encourage such experiments then it definitely helps both company and employee to come up with innovative products.

  23. chirshadblog
    July 31, 2014

    @yaland: Well yes they need to adapt towards that culture 1st and then try it. It will take some time but its worth trying

  24. yalanand
    July 31, 2014

    So they are either acquiring or merging with startup companies having innovative products.

    @Myanalog, I agree with your observation. I think this is the general trend in technology field. Not only semiconducotr companies but even software companies are investing hugely in startups. That is the reason startup companies are attracting very high valuations.

  25. Davidled
    August 3, 2014

    All microcontrollers such as Z80, 8051, PIC as well as 68HC and Renesas are very similar architecture except a few instruction codes in the data sheet. Unfortunately, the code of each microcontroller is not compatible with each other.

  26. Davidled
    August 3, 2014

    ->Developing a production automation machine can sometimes be a mixture of fun, stress, challenge and brain killing hardware/software development. It was an exciting work for me during several years.

    When developing the automation machine, there are some layouts for machine and development process. Each process needs to be validated before integration validation by engineer. That might provide a less headache for making the tool. 

  27. Davidled
    August 3, 2014

    I image that Google might be one of companies supporting fully the informal or formal creative idea. All creative idea would be shared in all employees to produce the actual product from new idea. Also, startup might have an informal process to capture idea daily in the mixture of creative and innovation.

  28. Myled
    August 7, 2014

    “I think the reason behind the low ROI has more to do with the quality of the R&D process. There are companies like Apple and Samsung who're constantly doing R&D and every other product they release is a success. I think that's because their R&D department is quite mature and stable and has a well-defined process.”

    Tzubair, it may not be anything with quality. The probable reason is fast phase out of technology. They won't get enough time in marketing the technology or product. Before that next gen devices may be in market.

  29. Myled
    August 11, 2014

    “I agree with your observation. I think this is the general trend in technology field. Not only semiconducotr companies but even software companies are investing hugely in startups. That is the reason startup companies are attracting very high valuations.”

    Yalanand, at the same time there are many risk factors also there with startup companies.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.