LinuxCNC for low level stepper motor control?
- BigJohnT
- Offline
- Administrator
- Posts: 7000
- Thank you received: 1172
Please Log in or Create an account to join the conversation.
- Smecky
- Topic Author
- Visitor
Please Log in or Create an account to join the conversation.
- wizard69
- Offline
- Senior Member
- Posts: 40
- Thank you received: 1
As an aside the PLC approach makes for easy programming and debugging of I/O.
Please Log in or Create an account to join the conversation.
- Smecky
- Topic Author
- Visitor
Thanks Wizard.
Please Log in or Create an account to join the conversation.
- BigJohnT
- Offline
- Administrator
- Posts: 7000
- Thank you received: 1172
linuxcnc.org/docview/html/ladder/classic_ladder.html
I use Classicladder to control my tool turret on my CHNC lathe.
You might use a mix of Classicladder and G code to control your machine.
You can write a HAL component in C but it is much easier to use comp to create a HAL component.
This is a cycle timer I wrote using comp as an example that might relate to what your doing.
John
Please Log in or Create an account to join the conversation.
- wizard69
- Offline
- Senior Member
- Posts: 40
- Thank you received: 1
As to specific answers about LinuxCNC I can't answer any as I'm new to LinuxCNC myself. My experience though lies in industrial automation. I have a bit of experience with machines that implement what amounts to a CNC controller and a PLC, this on separate hardware. As such I can reccomend implementing functionality in a way that makes sense on the hardware/software you have. In this case I/O a sequential control on the PLC (ClassicLadder) closely linked to CNC code.
While it certainly can be done, I don't reccomend doing a lot of I/O control via NC code. Generally it is better to have that code running independently of the NC code. There are exceptions though, I once worked on a system that had two threads of NC code running. One to sequence hardware, a chuck loader, and another to drive the actual machining operations. These days though it appears that most manufacture prefer to run a PLC process along with the NC process. The idea being to use the best tool for the job. In your case it looks like the NC element is really simple relative to the larger control issue thus the suggestion to control the NC unit from out side of the NC interpreter.
As to getting your code to interface there is most likely multiple possible approaches. That will require going over documentation and some experimentation. However I would start off learning ClassicLadder first as a soft entry into LinuxCNC.
Smecky wrote:
Industrial automation does sound very much like what I'm trying to do. Though I'll take simplicity over features, are there any resources you might recommend to give me a basic idea of the PLC functionality? If I could write C code, that might be advantageous, how might LinuxCNC be made to accept C code?
Thanks Wizard.
Please Log in or Create an account to join the conversation.
- BigJohnT
- Offline
- Administrator
- Posts: 7000
- Thank you received: 1172
I do the same thing by day industrial automation...
John
Please Log in or Create an account to join the conversation.
- wizard69
- Offline
- Senior Member
- Posts: 40
- Thank you received: 1
The funny thing is I actually have a lot of CNC machinery in the plant almost none of which machine metal. We have CNC based plastic injection molders running FANUC controllers and a packaging machine with an embedded CNC controller. This is why the post originally jumped out at me, using a CNC controller in this way is not impossible or even unusual. It might however be a lot of work for a one off machine compared to a couple of indexing drives and a PLC.
BigJohnT wrote:
Hey Wizard,
I do the same thing by day industrial automation...
John
Please Log in or Create an account to join the conversation.
- marzetti
- Offline
- New Member
- Posts: 9
- Thank you received: 0
Please Log in or Create an account to join the conversation.
- BigJohnT
- Offline
- Administrator
- Posts: 7000
- Thank you received: 1172
John
Please Log in or Create an account to join the conversation.