Urgent help required with EMC please

More
16 Aug 2016 21:46 #78911 by sxyuklad
Bytheway, may I ask what country you are from?

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

More
16 Aug 2016 22:54 #78913 by andypugh

Why is linuxcnc so difficult and on top of that no one is up for help yet.


We are all here for fun. Nobody is paid to support LinuxCNC. We help as and when we can, but do have day-jobs, for example.
The following user(s) said Thank You: sxyuklad

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

More
16 Aug 2016 23:19 #78914 by sxyuklad
That is true. Well I was really disappointed as no one for coming up for just a little bit of coding. Anyway, you have been such a great help. I hope to get everything working now tomorrow morning. Thank you again.

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

More
17 Aug 2016 08:24 #78920 by cncbasher
As Previously mentioned the orac atc works with a dc motor , and reverses to a pawl , you mention it uses only 2 optical sensors , and index and a pulse per tool i would recon , also there is an emco atc code , so we can help , but you seem to be wandering from one problem to another . i'm happy to help , but to reliably setup an atc and the correct functionality takes time .

Coding the comp file is only one part of the puzzle , and you can't take mach3 code and convert it , it wont work ,
for example the orac and triac atc's took us weeks .

as well as the comp file you need to integrate it into your hal config and your ini file .
you also need to remember we dont have the same setup as yourself , nor is it in front of me .
The following user(s) said Thank You: sxyuklad

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

More
17 Aug 2016 12:50 #78927 by sxyuklad
Hello cncbasher

I completely understand what you said. I know my setup is not in front of you. However, I have thoroughly explained it and I am always ready to feed more information where you do not understand how my setup is.

The reason I keep wandering from one problem to another is only because I am not getting someone expert like you advice, so I keep trying on my own. So when I succeed in some ways, I try to share the update so you know where exactly I am stuck at the latest.

For example, let us take it from now on where I am standing right now.

I have tried to alter the orac code to suit mine. When I compile the original orac comp, it works obviously my setup is different so it is not going to ever get the right tool.

However on the other hand, the code that I have altered compiles, works fine. It stops to the right tool what I request but I have the following issues:
1. When I issue an M6 command, it really slows down my PC almost like free and then I get latency error. Well, it stops to the correct tool but I do not know what I am missing from the original comp because it does not seem to put any load on the PC.
2. M6 command runs only one time. Like when I issue M6 command for the first time, it stops at the correct tool. Now if I want to change the tool again, M6 command does not work. It runs for a fraction of a second and then stops. Now let me make it clear here. When I check the signals. Let me tell you what is happening as far as I have understood it. When I first issued M6 command tool changed correctly, by the end of the code, obviously I am setting toolchanged signal to true. When I issue the M6 command second time, the toolchanged is still true so I believe this is what is making the toolchange signal to go true and then immediately to false again because the toolchanged is still true. I need to somehow set toolchanged signal to false again when the toolchanged has been completed.

Now, I will not wander around, I will await your response. I am attaching both my hal files and comp file too. Original one is obviously available online so you can make a comparison.

Will be looking forward to hearing from you soon. Any correction to the comp or hal as to correct above two problems will be appreciated from the bottom of my heart.
Attachments:

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

More
17 Aug 2016 13:01 #78929 by andypugh

1. When I issue an M6 command, it really slows down my PC


The "Goto" in your .comp makes me nervous.

A realtime HAL component should run-through to completion as fast as possible every time it is called (it is called every 1mS)

If there is any waiting to do then the component should set a flag for next time through. Take a look at the "switch(state)" part of carousel.comp for a way to implement a wait loop without actually waiting:
github.com/LinuxCNC/linuxcnc/blob/master...s/carousel.comp#L172
states 2, 3 and 11 are wait-states, but they exit immediately and take a look at the conditions next time through, rather than busy-waiting.
The following user(s) said Thank You: sxyuklad

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

More
17 Aug 2016 13:58 #78931 by sxyuklad
Yes, I believe andy you are correct. But the problem is I need to loop back to the top because as you can see I am working with a counter which increment +1 so goto is for looping again and again till I find correct tool number. But I suspect obviously this is not the most elegant way to handle things. You have suggestions? I will really have to think and work out another way to handle it.

I will certainly have a look at the carousal link that you shared if I could grab some more information and a better way to handle this.

Do you think goto statement is the cause for both my problems explained in my previous post?

Thank you. I appreciate.

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

More
17 Aug 2016 14:03 #78932 by andypugh

Do you think goto statement is the cause for both my problems explained in my previous post?.


If the loop runs for more than a few hundred microseconds, then yes.

Bear in mind that your .comp code is automatically called every 1mS. It should never need to loop, it should, instead, check the conditions again next time it is called.

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

More
17 Aug 2016 14:20 #78933 by sxyuklad
OK, I have very throughly gone through the original orac comp and I am very positive I have got a good grip on it this time. I have understood it 99%. There is only one statement that I do not understand. Can anyone explain the following lines?

if(delaydone) // turn off motor after a delay to lock
{
run=false;
delaystart=false;
}

This "if(delaydone), where is this ignal coming from? On initialization or start of linuxcnc, it is set to "false" and I do not see it changing to "true" anywhere in the comp file. Can someone explain how and when it actually turns to "true" and what is changing it.

If someone can explain me this, I am pretty sure I can alter the code to suit my needs this time perfectly.

And also delaystart=true and delaystart=false, what is it doing actually? Like when it is false, what happens and when it is true, then what?

Thank you. I am attaching the original comp here so you can have a look through.
Attachments:

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

More
17 Aug 2016 14:42 - 17 Aug 2016 14:51 #78934 by Todd Zuercher
I think I see it the delaystart sends a signal out to a hal pin to start a hal timer component counting down, and the delaydone returns the signal after the hal timer is finished. It is all there in the snipbit of hal code example at the top of this file.

Attachments:
Last edit: 17 Aug 2016 14:51 by Todd Zuercher.

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

Time to create page: 0.124 seconds
Powered by Kunena Forum