Sunday, November 12, 2006

 

Chasing bugs...

The weekend was spent working the bugs out of the pseudostepper control of the GM8 using the Timer1 module in interrupt mode on the 16F877A microcontroller. After a very frustrating Saturday I finally discovered that my problems were a result of two factors...

Once I put a one minute warmup wait state on the board and cleaned up the TRISB declaration things began to work smoothly.

That done, I went back to integrating the Hamamatsu limits detector into the control programme. That was a little trickier than I first thought it would be. Once the pseudo stepper blunders into the limits zone and realises that it's there you have to programme a delay into it so that you don't get another interrupt the moment it leaves the limits zone.


For now I define the acceptable area for the positioning stage to operate in with a strip of white electrical tape.

One thing that has come obvious with the Hamamatsu chip is that it is very sensitive to IR radiation. I found that I could cause it to decide that it had hit a limit by taking a photo of it in operation with the flash option enabled. As well, having my work lamp on bright and aimed at that area of Tommelise caused false limits detections, too. I expect that I will have to put some sort of shading skirt around the detector to keep stray light out of it. There is enough 0.9 micron IR in ordinary light sources to trigger it without a lot of trouble. I recall that this was a problem when I developed the test board some months ago.

Comments:
Not sure I understand how you are getting a second interupt when it leaves the limit zone. Please more details to help me grok! Maybe I'm still just part caveman. I'm now trying to build a mining cart to help me dig under the house. :)

As for that crystal warm up issue, did not know that. Everything has it's quirk, doesn't it!
 
***Not sure I understand how you are getting a second interupt when it leaves the limit zone.***

That's easy. The PIC chip generates an interrupt any time a pin input changes state. That means that if the pin is reading 0v and goes to 5v you get an interrupt. Similarly if the pin is reading 5v and goes back to 0v you get another interrupt. It's no big deal. You just have to allow for it in the firmware programming.
 
***As for that crystal warm up issue, did not know that. Everything has it's quirk, doesn't it!***

This all what they call "know how". Heretofore I'd been working with 16F628A chips that can take an external crystal but have an internal one rated at 4 MHz. The 16F877A has no internal crystal so being the sort of guy I am I got the fastest one that it could take, viz, a 20 MHz crystal. Turns out that the crystal I am using takes a few moments to warm up and stabilize. You just put it in a WaitMS state for a while till that happens and then you're good to go.
 
Oh yes, now I see. Not the most obvious for my primitive analog brain. ;)

BTW, I'm using bits of RepRapish tech on my mining cart. I sliced up plastic cutting boards and am using them as bushings. Just a prototype.

BTW2 Sebastian pointed out Lee Valley as a source, they sell packages of multipurpose plastic under "3 lb Assortment of UHMW Pieces". Might be of use for RepRappers who want dimentionally stable parts that slide well.

Boy, I have to learn to stick to the topic at hand. :)
 
Post a Comment

Links to this post:

Create a Link



<< Home

This page is powered by Blogger. Isn't yours?

Subscribe to
Posts [Atom]