Beginner - will this work

Go To Last Post
17 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi

A friend of mine is converting a cnc lathe to a new PC based controller. One area that requires some work is the toolchanger. It consists of an electric motor that rotates the toolchanger. When the correct tool is detected the motor is switched into reverse and the motor is driven backwards until a ratchet prevents it going further - the motor stays on but stalled. The position is detected by 3 opto sensors and an encoded disk.

What we want to do is send a number from the RS232 port on the PC. A microchip would detect this, rotate the toolchanger until it is in the correct position and then send a confirm signal back to the PC. (i.e. send RS232 command number, chip checks current tool selected, switch motor on forward, rotate until 3 input lines are at correct states, switch motor into reverse, send confirm back to PC)

We've been looking at the ABC Mini Board to do this with (http://www.quasarelectronics.com...). Would it be possible using this kit? Also any good tutorials around about how to do this sort of thing?

Cheers

Dave

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Of course you can do that.

You'll need to know a little bit about the motors so you can build appropriate drivers for them.

---
Formerly Torby. Stitch626 just seemed a more descriptive nicname.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Don't do it!
You seem to want to learn on machinery that can rip flesh and blood.

Keep it simple it will not bite as hard

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Don't do it!
You seem to want to learn on machinery that can rip flesh and blood.

Maybe the OP is experienced with this kind of machines.....

Klaus
********************************
Look at: www.megausb.de (German)
********************************

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the reply. I suspected that it would work bu wantedto ensure that the RS232 side would be OK. As far as I know the motor simply takes a 12VDC supply (I've got the original wiring diagrams somewhere so I can check) - so I can probably hook up a relay to sort this out. Unfortunately the opto sensors will also probably be 12V so I will probably have to hook up some opto-isolators to get it to 5V for the AVR chip - the original controller was from back in 1984!

Myself, and my friend, use CNC machines on an almost daily basis. He's bought a lathe identical to one we have at work and is updating the old controller to a modern PC based system. I have also built a similar system for my own CNC mill. So we are well aware of the dangers etc.

It can only rip flesh if there is flesh to be ripped!

Cheers

Dave

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Not from the way the OP's message ran.
The problem is not so much being familiar with the machine but being familiar with the devices and software requirements to avoid a disaster.
To have an rs232 link to a seperate board which you are going to instruct to drive motors needs some care. But when you do not have a clue what sort of board is suitable for the job smells to me of a lack of understanding of the fundamentals of the electrical and electronic design requirements.
Not to mention

Quote:

Also any good tutorials around about how to do this sort of thing?

Keep it simple it will not bite as hard

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

was after confirmation that the particular board I had seen would be suitable as I have never used AVRs before. A few years ago I did some work with PICs, but only to a limited degree. I also spent a year developing software for CNC machines via RS232.

The reason I asked for any tutorials was to save re-inventing the wheel.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

also take a look around

http://www.cnczone.com/

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Incidentally, I happen to have written a hardware manual for that exact board. The link is in my sig - but don't forget to leave a comment on my guesbook so I know how I can improove.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Cheers for the links guys. Dean that manual is great - looks like I've got some bedtime reading tonight!

Cheers

Dave

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

One of my "Day Time" jobs use to be repairing NC-CNC machine tools. I did this for about 15 years.

If this was an axis that the OP was trying to control via RS-232, I think I'd be a bit leary.

The OP is sending an instruction to start a motor until a certian three bit code is detected, reversing the motor for "Draw-Down" and confirming that the tool has been selected.

My recommendations...

E-STOP: Make sure that the E-STOP physically removes power to the motor control circutry when active. In the United States, this is a requirement. An E-STOP is not simply a "Stop" switch. This doesn't necessarily mean that the controller board has to be shut down, rather; the high voltage powering the motor control system. You can keep the tool changer controller alive and send status information to the "Host" controller about the status of the E-STOP switch/s, tool changer motor overloads, and such, though.

You will need to provide some sort of communicatios integrety varification protocol. The worst that can happen here is a machine crash or the wrong tool selected. As a safeguard, LOSS OF COMMUNICATIONS SHOULD PUT THE MACHINE INTO AN E-STOPPED STATE! Incorrect tool selection should put the machine into a "Machine-Stop".

This is a great application for a "State Machine" style controller as the combination of states are truely finite in nature.

Depending on other functions that you might incorporate into the controller, this might require nothing larger then a 90S2313 or Tiny2313 controller. A Mega 8535 might possibly be considered "Over-Kill".

This is only my opinion. I think it's a cool project, though... No warrantee implied!!!

You can avoid reality, for a while.  But you can't avoid the consequences of reality! - C.W. Livingston

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Cheers Carl

I normally wire the E-Stop to kill all power to the control circuits but not the PC. There is a second connection on the E-stop button that is looped back into the PC to also tell the PC that an estop has been used. I like a nice big red button to hit - don't trust the software E-stops!

You make a good point regarding communication protocol. Something I will have to look at!

Cheers

Dave

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey,

Sounds like fun - I have always wanted to do this, but never had a lathe to do it with!

There is actually a fairly well-covered topic in general, but your specifics will require some detective work.

Two things I would add:
-Make the controller on the device changer as smart as possible, just so you can send it a command "change to location 3" etc. This makes sure the controller always stays with the device, and you don't have as much to lose.

-Add a lightbeam estop or soft stop if possible, never assume that everone around will be as well trained as you. It might cost a bit extra, but when you start adding features like that people get impressed. What doesn't impress them is when the e-stop button is backordered from Digikey and you put a picture of an e-stop button in it's place while using a master power button instead (better off not asking about this one...).

Those two things are also handy if someone else ever were to come across your lathe. Perhaps in 10 years you will have a better one and you know a friend you want to give it to - the smarts in the driver will mean they can easily reverse engineer it in case you forget. In fact I try to write stuff on the inside of the case like a baud rate and quick connection information.. it's a godsend when you or someone else comes back to it... I've come across tons of random electronics home projects, so don't be too skeptical ;-)

Good Luck!

-Colin

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Put isolation on all the connections between the cpu and the lathe. It will avoid a lot of smoke when Murphys law takes over.

Laurence Boyd II

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

davidimurray wrote:
As far as I know the motor simply takes a 12VDC supply (I've got the original wiring diagrams somewhere so I can check) - so I can probably hook up a relay to sort this out.

Something you may not have considered yet, if the motor needs to run in both directions, a single relay won't work here. You will need a bi-directional controller, probably some sort of H-bridge. While you can build them using relays as the gates it probably is better to get/make a real one out of transistors/FETs. ST Microelectronics (among others) also make H-bridge chips last I checked so you can just get one off-the-shelf as it were.
-Will

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

just a note on h bridges, i have been using an ST on for a similar project with motors at 12V. after much searching the best one i could find was this one (see attachment). Good for up to 30A, available from digikey.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Will

Just had a look through the old schematics and it shows a simple changeover relay to swap the connections of the 12VDC motor.

Cheers

Dave