Another "what do I need" thread. Vmc retrofit

More
23 Apr 2015 17:22 #58039 by andypugh
Replied by andypugh on topic Another "what do I need" thread. Vmc retrofit
Good point about spindle orient, that is a useful thing to get in place first.

I wrote a wiki page on that subject:
wiki.linuxcnc.org/cgi-bin/wiki.pl?SpindleOrient

Please Log in or Create an account to join the conversation.

More
23 Apr 2015 22:26 #58049 by thewho

Is it a bad idea to use a Arduino in you guys opinion?

If you can write Arduino C to do the job you can write LinuxCNC .comp C to do the job.


I'm not so sure about that as it has taken me like a year to learn basic Arduino programming :( (I even had a C++ programming class in school, but that is not important..)
The best thing with Arduino (according to me) is that there is an example for almost anything I want to do. So I just have to copy paste pieces of code that I necessarily don't really know how works.

But I'm pretty sure I'd be able to get that working and that's why I'm asking.
If I where to do the communication myself I'd probably use 4 pins (4bit binary) from the 7i77 card to select what tool is requested.

Example:
if tool == 12 then
set output 1 = 1
set output 2 = 1
set output 3 = 0
set output 4 = 0

Then input pins:
1. Lift Z to level with carousel
2. Lift Z to clear carousel
3. Ok to continue machining

There, now I've made a fool out of myself but now you know the level of programming experience i have :whistle:

Please Log in or Create an account to join the conversation.

More
23 Apr 2015 22:33 #58050 by andypugh
Replied by andypugh on topic Another "what do I need" thread. Vmc retrofit

I'm not so sure about that as it has taken me like a year to learn basic Arduino programming

I taught myself C just to add three-phase motor support to the Mesa drivers, so not being very good at C right now is no handicap.

If I where to do the communication myself I'd probably use 4 pins (4bit binary) from the 7i77 card to select what tool is requested.
Example:
if tool == 12 then
set output 1 = 1
set output 2 = 1
set output 3 = 0
set output 4 = 0


No need for that, there is already an existing HAL component for the job:
www.linuxcnc.org/docs/html/man/man9/bitslice.9.html

Or to do it in C-code
output1 = tool & 1;
output2 = tool & 2;
output3 = tool & 4;
output4 = tool & 8;

No need for 12 if/else statements. "&" is bitwise-AND.

Please Log in or Create an account to join the conversation.

More
24 Apr 2015 07:39 #58057 by andypugh
Replied by andypugh on topic Another "what do I need" thread. Vmc retrofit
As promised, a half-baked attempt at a carousel control HAL component.

Attached should be a zip containing three files. Unzip them somewhere convenient then on that folder you can issue the following commands at the command line.
comp --view-doc carousel.comp
will show the documentation for the new component.
sudo comp --install
will install the component so that you can use it.

To see it in action without hardware attached make sure Linuxcnc is _not_ running and:
halrun
source carousel_test.hal
You should get a halshow watch window and a set of sim_pin buttons to pretend that you are the hardware
Put all the sim_pin boxes into "toggle" mode.
Then set a tool requetst in the pocket-number box.
Then set "enable" true.
You will see that the actuator-0 pin goes true, waiting for you to toggle actuator-1-fb. so do that, then the same for 1,2,3.
At than point you should see the gray-code pins flickering as the "simulated" carousel slowly moves.
It will stop at the right number, then you need to un-toggle the actuators 3,2,1,0 and the carousel state should return to the zero position.

Change the tool number, and repeat.

I actually think that this component can do nearly your whole sequence, except the Z moves. Your G-code might have to sit and wait for the actuator pins to do their thing, and it might well be the case that the feedback pins are driven from G-code outputs.

Early days yet, and rough around the edges.
Attachments:
The following user(s) said Thank You: thewho

Please Log in or Create an account to join the conversation.

More
24 Apr 2015 16:07 #58069 by thewho
Awesome! :laugh:

I'll be trying it in a few hours, has to get off work first...
I'm planning on tuning all axis and get the spindle running this weekend.

Please Log in or Create an account to join the conversation.

More
24 Apr 2015 16:21 #58072 by andypugh
Replied by andypugh on topic Another "what do I need" thread. Vmc retrofit

Awesome! :laugh:

I'll be trying it in a few hours, has to get off work first...
I'm planning on tuning all axis and get the spindle running this weekend.


And then we can start a debate on how it ought to work.

I think I want to change the config string from "u5" (in the case of your machine) to something like:

"pins=5 code=gray bidirectional=0 before=01234 after=345"

This would set pins 0,1,2,3,4 in sequence before moving the carousel and 3,4,5 in sequence after.

But this isn't as flexible as I would like. any ideas? Maybe "before=(1TW1F)(2F3TW1T)" as a format might work. That would set pin1-out "True" wait for pin1-fb to go "False" then set pin2 false, pin 3 true and wait for pin1-in to go "True" ?

Please Log in or Create an account to join the conversation.

More
25 Apr 2015 00:16 #58090 by andypugh
Replied by andypugh on topic Another "what do I need" thread. Vmc retrofit
OK, you can have a fiddle with that component, but be warned that Feature Creep has set in and I intend to change almost everything for extra fun and flexibility :-)
(Though, actually, that version is probably perfectly capable of controlling your changer)

Please Log in or Create an account to join the conversation.

More
25 Apr 2015 01:43 #58091 by thewho
Sounds good! :laugh:
I did what you said but it seems it didn't install the component. When I run "halrun" and write "source carousel_test.hal" it says that there is no such file in "usr.." etc

Quick info as it's late and I have quite a long trip home.
Z need to at least Z=8 so that the tool in the carousel clears the spindle face. (8mm above home switch)
Will that be a problem? Limit switches are directly wired to the servo amplifiers. It was done that way from the beginning and I just left it that way.
And home switches goes only to the 7i77 card.

Been having some troubles to get the machine to home Y correctly as the home switch is in the "wrong" direction. Full + travel in other words. But that is a problem I feel confident in fixing myself :whistle:

Please Log in or Create an account to join the conversation.

More
25 Apr 2015 03:26 #58092 by andypugh
Replied by andypugh on topic Another "what do I need" thread. Vmc retrofit

Sounds good! :laugh:
I did what you said but it seems it didn't install the component.


What was the on-screen output when you did "sudo comp --install carousel.comp"?

It is possible that the missing component is sim_pin

Please Log in or Create an account to join the conversation.

More
25 Apr 2015 03:44 #58095 by thewho
I did take a screenshot of it, saved it and then turned off the computer and left.. :pinch:
I'll have to get back to you on that one tomorrow.

Please Log in or Create an account to join the conversation.

Moderators: PCWjmelson
Time to create page: 0.119 seconds
Powered by Kunena Forum