Gallery, Projects and General > Project Logs

Electronic Leadscrew for the New Lathe

<< < (25/32) > >>

vtsteam:
Along with your approach, Tim, there should be a "leadscrew" switch, anyway, so setting a thread pitch could occur before running the LS, and lock the display and pitch while running the leadscrew in threading mode.

I imagine autofeed ought to be variable with a pot, though, but that's easy enough to swtch into a separate non-encoder simple variable timing routine. Then display refresh timing isn't a problem.

There's a million ways to skin this cat for UI, and that will all end up to personal taste.  :beer:

sparky961:
Some thoughts regarding display update and general latency when switching tasks... just off the top of my head, and just in the door from work.... so maybe not well thought out.

Maybe you already know this, but you're better off updating the display and such in the main loop.  You're not going to care if there's a few millisecond delay where it's unresponsive, if that.  Miss an encoder pulse though and it might mean a scrapped part or worse.

Run the encoder off interrupts (as I think you're planning eventually) and then it will always have priority.  Don't disable interrupts once you're in the main loop.  Keep your interrupt(s) as simple as humanly possible.  That said, I've been surprised how quickly my state machine code runs and counts correctly.  If its been a while since you've played with uC's, you will be pleasantly surprised at how far they've come.  I've been away from the mainstream for a while, and I sure am.

I'd be happy to send you a copy of my encoder state machine interrupt handler function... in C - the only FORTH I know is "May the FORTH be with you" ;)

Now stop (lead) screwing around and get the rest of that lathe built!

RobWilson:
 :clap: :clap: :clap: Looking very canny there  Steve  :thumbup:



Were did you purchase  the smaller circuit board  ?   the opto thing



Rob

vtsteam:
Sparky, thanks for replying.  :beer: We'll work out the timing to whatever is needed. FORTH is pretty fast on old and limited procs with tiny memory and also has a built in assembler if we really need to get down and dirty for something. And there are two interrupt input pins on the board, etc.

Like I said a display isn't top priority for me -- a rotary switch and knob can select pitches very conveniently, a dip switch also, though less conveniently. I even have a plan B.

I don't know C so it wouldn't help any to see your code. I do thank you, though!

Nobody uses FORTH these days. Or even knows what it is. Just guys from the early eighties era of computing. And even then, not many.

FORTH is a language that you write your own language in. It suits the way I think. I never felt anything else fit as well. People make a big deal nowadays over various unusual characteristics like the reverse polish notation for math, the use of the stack and untyped variables, 1024 byte blocks for storage, etc. But they never seem to make much mention of the fact that it is a language designed to create your own language in. That's the critical point of interest to me!

A FORTH program works by defining words in your own invented program language at a low level, and combining those into definitions for higher level words until you get to the top of what you want to do -- the last word in your dictionary that does it all.

Utter that word and boom your program runs. I think that's cool! Just a quirk of mine. The rest of the stuff is just mechanical details. I learned them a long time ago, and don't even think about them. But it's easier for people to talk about and give little demos online of using the stack and RP notation. So you don't see much about why you'd ever want to learn a language that requires that.

FORTH isn't useful because of unusual arithmetic operations -- they're a pain in the neck for most experienced programmers. It's the way you create a program that's wonderful, to me. And how compact and fast it is. And that's possible because of the stack and RPN -- they're the primitive base words and functions very close to how the proc works and sees things.

Your program builds up from this low level of words to a level so high, one word does it all. Everything you want, in a single command. That's the highest level of the language. There aren't subroutines and calls. rather every FORTH word is a subroutine, and there is no distinction between the words you define and the base words that come with the system. They are all part of the grand dictionary, and can be used to make up new words.

Okay apologies for going on and on about this. Using FORTH again brings back the interest and excitement I had when I first started using computers, so I start chattering!

Yes, back to building the lathe as soon as the shop dries out. 1/4" of water on the floor because of ice out here. Early crocuses just beginning to show. Daffs not up yet. Still some white stuff out there in patches and the streams are roaring....

vtsteam:
Rob, I found this little gem on ebay and grabbed the whole kit and kaboodle:

http://www.ebay.com/itm/321719649728?

Price is ridiculously low. The Arduino Uno clone isn't the best quality PC board work, but it runs fine so far.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version