circuitcellar.com
Magazine Support   Digital Library   Products & Services   Suppliers Directory 
 
 





 

Issue 93 April 1998
Picaro: A Stamp-like Interpreted Controller


by Tom Napier

For years, Tom’s been itching to control the instruction sets of processors. Using a PIC, some memory, and an interpreter, he bypasses the processor hurdle and writes his own language. He shows you how to do it, too.


The system performed very well during informal testing. As expected, the algorithm learns occupancy patterns within a maximum of three weeks. When changes to the schedule are slight, the system the following week.

When presented with a markedly different pattern, the software waits a couple weeks, as designed, before adopting the new pattern into its permanent record. Because the algorithm is still verifying the validity of a pattern on the second week, it’s too late to act on it even if it passes the test, so the third week is when the anticipator responds to a new pattern.

Although the algorithm performs well, it has one weak spot. When the patterns contain a large number of alternately occupied and unoccupied periods, as shown in Figure 7, the algorithm is threatened by what I call the "comb problem." The problem is that the shifting process used in the matching algorithm can yield a high score for patterns that look similar (like two combs) but that are almost opposite in timing from each other.

Needless to say, this mode of operation is not likely to occur because of the rarity of a comb-like pattern arising in normal circumstances. And in practice, even if the comb problem were to appear, it may be irrelevant because the anticipator looks ahead for some time.

In other words, if the area were seeing very frequent occupancy changes, the anticipator ends up expecting arrival pretty much all the time. Fortunately, this is the behavior you want out of the system anyway, so the comb problem is fairly benign. However, I feel that it’s important to point out this theoretical weakness.