A crummy little servo tester and other minutia

The little servo tester
Well, I needed a way to test all of these servos I got from EBay and I decided to spend a little time making a quick and dirty little board for doing that. It uses a PIC12F683 and has a linear pot attached to it. Simple.

Crummy servo tester
Crummy servo tester


Viscometer Board and stuff
I’ve been working on the software for the viscometer. Every function appears to work, at least based on the rudimentary prototype I have currently running. I am working on a scripting system for this device. I could make it just a basic viscometer but, as anyone that knows me, I simply can’t do. Here’s a pic of the working board.
The prototype viscometer board
The prototype viscometer board

An EEPROM file system
After thinking about how to store files appropriately and trying to have a file system that can work easily with 1024B of space, I started coming up with ways of defining a reasonable file system. Here it is.

  • First 2 bytes are settings, things like block size, filename size and special behaviors like for EEPROMS that can only be written to with blocks.also defined is the address size 8b, 16b or 32b
  • Each file in the FAT consists of a name of either 2,4 or 8 bytes. this is determined by the setting.
  • Following the name is one byte detailing the flags such as read-only, archive, and whether it’s open or not.
  • After the filename and attribute byte, are the addresses. These addresses can be 8, 16 or 32 bits, however, an 8 byte address can address something larger, say 2k rather than 256B if you set the block size appropriately. This of course lowers the efficiency of storage space but allows for some growth in the file. The file can have any number of addresses in order to remove time wasted moving stuff around.

Anyways, that’s what I’ve been working on as of late. Fun!

One last kick at the can, Viscometer Style!

Well, since funding for the viscometer has fallen through for various, understandable reasons, I have decided to take one last kick at the can before I shift my focus on to other ventures. The last kick at the can? Two similar viscometer heads, two very different purposes.

This is the rough mockup of the new head, it is the same for both designs
This is the rough mockup of the new head, it is the same for both designs

The hand-held stormer
 
  This device is designed to work in the field and provide readings in KU, Grams and perhaps Centipoise. The device itself doesn’t feature any communications of any kind. Also, there is no LCD display, instead a 7 Segment x 4 LED display is used since it’s a bit cheaper and more visible in various lighting conditions. Also, since it will be use tables of values rather than calculating it on the fly, I can use some slimmer hardware such as the PIC18F2620 Microcontroller or an ATMEGA8.
 
  Also of note is the fact that everything is fairly cheap to build, these low-cost viscometers could be used in paint shops in any size container. I am building one to go to Cold Lake where they’re going to try one out since they’ve been having trouble getting decent consistency using only a mixing stick to test viscosity. 🙂
 
  Here’s a rough mockup of what it will look like. Of course none of the boards or covers are shown, also the display isn’t visible, I haven’t decided the best location for it yet. I may actually put it inside of a separate enclosure to make the unit lighter since it requires 12 volts.
 

Mockup of the handheld viscometer
Mockup of the handheld viscometer

 
  This is probably the most marketable device thus far.
 
The Super-Visc
 
  Over the last 9 months or so I have developed a number of interesting methods for determining error and correcting for it, I have also develop methods for calibration and symbolic parsing. Since I would hate to come away empty handed and waste all the of knowledge accumulated over the course of 2+ years, this is the coup de grace of rotational viscometers.
 
  To my knowledge, most other rotational viscometers use a beryllium copper torsion spring to provide a fixed, known spring rate, or torque on the sensing shaft. The cheap ones like the stormer viscometer base it on time and run a fixed speed AC synchronous motor, whereas the more expensive ones use a variable drive and encoders on the top and bottom to determine the difference from top to bottom. My viscometer uses the cheaper method of determining difference and RPM by using the timing via ether opto-interrupters or hall effect sensors. By using a a very high sampling rate, I can get very precise measurements of the rotation, though some differences may occur during rotation. Accuracy is achieved through error correction in the form of running averages, temperature and friction compensation and angular displacement compensation. While this is places a heavy burden on the software side of things, it is extremely effective.
 
  This viscometer works on three key concepts: Variables, Equations and Test Programs.
 

  • Variables – These are variables that are calculated dynamically before any other calculations have taken place. These include ambient temperature, fluid temperature, angular displacement, spring length, time from test start, time from last sample and other mathematical constants such as PI and E.
  • Equations – These are the equations that determine the units. You may (and for basic units, must) include variables in order to calibrate the device. These equations are completely configurable by the user and includes every standard mathematical function such as Cos(), Sin(), Cosh(), Powers, Square Roots and many others, perhaps even logical equivalents say to multiply by 1 or 0, could be useful. While developing this I had a choice, either computationally expensive or memory intensive, I chose memory intensive symbolic storage in order to improve performance. This also allows one to develop any unit with any paddle one wishes!
  • Test Patterns – These are the patterns that develop the test. For example, let’s say you want to test for KU. You place the appropriate spindle in the machine and select the KU test run. KU test runs would appear as follows (200 RPM Fixed, Equation KUPU, Out->FLTP, Out->KU) or for Centipoise vs RPM (50-220 RPM variable, Equation CNTP, Out->CNTP, Out->RPM, Out->FLTP). These are a boon for the experimentor.

 
  One key disadvantage of this device is the initial difficulty of calibration. However, if done en masse in the factory, it wouldn’t be an issue. One of the major advantages of this device is for the experimenter. You could put a hotdog on a stick, put it in a fluid, create a relationship via an equation and call it whatever you want. The device is very configurable and would probably be well suited to materials engineers and chemists who need either standard or non standard tests with a large amount of automation in terms of data collection.
 
Here’s a mockup of the finished laboratory device.
 


Potential mockup of finished device
Potential mockup of finished device

 
The device will feature an RS485/232 output along with perhaps a touch screen or simply a keypad and 20×4 LCD display. The processor will either be a DSPIC33F or PIC32, I may stray towards Atmel since they have great throughput. My current prototype board however has a PIC18F4680, it’s enough to test on but its limits on RAM are starting to bother me.
 
Well, this was a long post… Whew 🙂
 
As always, anyone who has any questions can leave a comment or E-mail me.

Working on new viscometer head

  Well, I’ve been designing some new stuff since having a little wind of inspiration. This head weighs in at about 700g and provisions have been made to allow an attachment to a handle and therefore a hand-held version could be made. Here are some images.
 

Line Drawing
Line Drawing

Fully Assembled visc head
Fully Assembled visc head

Viscometer head opened
Viscometer head opened

Viscometer head from the back
Viscometer head from the back

 
  I’m going to use these design concepts on the next in-process version. I’m going to design the external case for the electrical portion and for possible battery storage. Since the motor only draws 100ma at 24v or 200ma with a 12v motor, a hand held version is definitely possible. This version will use a PIC16F767 for control and using a smaller LCD display to display info.
  Now, on to developing some other devices. I’ve wasted far too much time in the last many months, time to get busy.

Getting closer to final completion

A long road behind and still some ahead, here are some pic of the viscometer in its state of completion.

stormer viscometer with cover looking in
stormer viscometer with cover looking in

viscometer from the back
viscometer from the back

viscometer standing up
viscometer standing up

viscometer laying down
viscometer laying down

stormer viscometer with cover
stormer viscometer with cover

Now to implement the ModBUS protocol and finish up this project.

In-Process Stormer Viscometer – Damn near complete

  The viscometer is nearing full completion! YAY! To mark this occasion to mark the end of a long two years, I am placing a small gallery of the almost finished product. The only thing missing is the outside cover which consists of a 4″ od aluminum tube. Also, the springs I’ve ordered have also not arrived as yet, however, for now, the elastics will suffice. Here are some of the features and facts:
 

  • Can be used in-lab or in-process
  • Selectable RPM with a tight tolerance on RPM +/-0.5RPM
  • User calibration routines. This allows the end user to calibrate with 3 fluids of known viscosity
  • 16 key keypad, used for calibration and settings, also for running special tests
  • Can be used as a laboratory gel-timer
  • Can be used for custom tests besides stormer viscometry
  • Low power consumption <100ma or <2.4W
  • RS-485 Serial output
  • Control electronics have complete galvanic isolation
  • 24VDC supply required
  • repeatability (requires further testing) +/- 1.5%
  • Modbus protocol (not yet implemented)
       
      Here’s the Gallery!

       
       Yes, a few too many pictures, oh well.
       
       This thing took me quite a while and what I learned from it was immeasurable. Thankfully now that everything works as expected I can focus on my other projects without having this thing hanging over my head. Here’s to completion!
       
      As an aside, here’s an interesting document on viscosity.
      here

Spring Stormer Viscometer, proceeding, the board works.

Well, I recently recieved my boards back from ap circuits in Calgary and I’m pleased with the result. I kind of fucked up by ordering 4 of the same board and not 2 of the control board and 2 power boards. Oh well! I can use the current boards for the new ones. Anyways, here are some images of the board.


The two boards together, unpopulated and populated
The two boards together, unpopulated and populated

The board, populate with SMD's
The board, populate with SMD's

Programming, Drafting, Designing and whatever else…

Well, it’s been a busy few weeks since I left the business training program. Thankfully I have some work lined up and things may go well for the short-term. For the last while I was working on the design for a plastic enclosure for a customer. Everything went quite well and the customer is an absolute joy to work for/with. Based on a board and taking cues from other ideas, I drafted a simple enclosure for a device. Here are some pictures of the enclosure.

enclose2-1
enclose2-2

Worked out well…

Also, I am now continuing my foray into the automation stormer viscometer as well as my auditory camera level. Things should go quite well if I bust my ass…

Rotary Viscometer almost finished

Well, it’s been a long road but I’m almost at the finish line in terms of the majority of development. All of the parts are mostly made and I’ll begin programming very soon, most of which has been done already or figured out in advance.
Firstly, I started with the board. I had to build it from scratch because I’m not certain of they’ll want more features or different ones, also I simply don’t have the funds to get the printed boards made, those will fit in the top of the unit below the LCD and reflection switch.


viscometer test board with lcd display
viscometer test board with lcd display

Viscometer, assembled on base
Viscometer, assembled on base

So, after this I spent the entire weekend building the parts required to make the rest of the unit. I opened up a few of the tolerances and had to make some changes simply to allow for better fitting afterward. The unit would have been impossible to assemble otherwise 🙂

Viscometer with sensor in hand
Viscometer with sensor in hand

I have to say, I’m satisfied with the results thus far. The bearing holding the sensor together could be a bit better though. This week I’m going to have to program the unit and hopefully this long saga will be over. Well, at least when I make the 15 units it will be.

3 point quadratic regression formula

While developing the in-process stormer viscometer, one of my goals is to allow the end user to calibrate the device with 3 fluids of known viscosity. With a bit of help from mathematica, I’ve found the formula and for whoever wants it, it’s posted, also for my own future edification. This formula is meant to convert 3 data points of the form {X1,Y1},{X2,Y2},{X3,Y3} into a form of ax^2+bx+c=y. This is probably the fastest way to do this kind of operation on a microcontroller. Here’s an image of the formula

Reverse Quadratic from data
Reverse Quadratic from data

also, here’s a dirty FreeBasic program using it. regress-3point.bas

Also, for fun I decided to do a cubic version. This is in the form of 4 data points {X1,Y1},{X2,Y2},… converting to ax^3+bx^2+cx+d=y

Cubic equation inverse
Cubic equation inverse

You gotta love Mathematica!!!

Viscometer Project, coming along…

I thought I would have nothing to post but I do I guess. I’ve felt the need to really expedite this project now that I am starting a business. I have done a few of the mechanical things associated with it after a major redesign. Today I have completed the design of the board and despite it’s sloppiness, I’m happy it’s done. Now to get it made.


Viscometer Board 3D View
Viscometer Board 3D View

Viscometer Board traces
Viscometer Board traces


Like I state in the description, I used the autorouter on this image, I may revise many of the traces so that ripple can be eliminated from IC’s by bringing the caps closer electrically to Gnd and Vcc. This week I hope to finish the machining side of the device, I’ll have to wait for bolts from Fastenal to arrive but it’ll be worth the wait. Here are some shots of the parts so far, note that the main block is made of phenolic, I love this material since it looks kind of like wood but is reasonably machinable.

Machining the block
Machining the block

Phenolic Block Finished
Phenolic Block Finished

Coming along, main block and holders finished
Coming along, main block and holders finished


Just for the record, here is the list of, well electrical features:

  1. 16 key Keypad for data entry, mostly for calibration.
  2. 16×2 LCD display for seeing alarms and viscometer output.
  3. 24V motor, PWM driven with TIP102
  4. Light interrupted sensors for top and bottom
  5. provisions for temperature sensing
  6. RS-485 Out
  7. Provision for an external RS-232 board, if needed
  8. TVS’ed to the hilt, hopefully this will prevent funny stuff from happening.

Anyways, let’s hope she all works out in the end.