Starting sequence

More
04 Dec 2012 17:48 - 04 Dec 2012 19:25 #27183 by RomainM
Starting sequence was created by RomainM
Hi,

I have a double push button, like this:


I would like to use it to start the homing sequence by pushing the green part. I will use an Arnduino Uno card to read the input, I think that it is not really difficult. But after the homing sequence, I would like use this same green push button to start the gcode loaded. I guess that I should use classic Ladder to configure this sequence.

Is it possible, is it difficult ?

By the way, is it possible to switch automatic to world mode after an homing sequence ?

Thanks for your reply

Romain
Last edit: 04 Dec 2012 19:25 by RomainM.

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

More
04 Dec 2012 21:56 #27191 by andypugh
Replied by andypugh on topic Starting sequence

I guess that I should use classic Ladder to configure this sequence.


No need for Classic Ladder, you can do it all in HAL with simple logic.

loadrt logic names=home-logic personality=0x502
...
addf home_logic servo-thread
...
net button-in parport.0.pin-01-in home-logic.in-00
net home-state halui.joint.0.is-homed home-logic.in-01
net home-cmd home-logic.xor halui.home-all
net run-cmd home-logic.and halui.program.run

This is off the top of my head, some pin names may be wrong, and it is assuming a parport pin for the button, not your arduino.

What machine do you have? Switching to World mode is normally only necessary on unusual machines.
To switch to World mode neatly, using the Axis interface, you can make a small change to Axis to add a HAL pin with equivalent function to the $ key:
A patched version of axis.py is attached to the mailing list message here:
osdir.com/ml/emc-users-enhanced-machine-...012-11/msg00122.html
I can't find a way to display the whole thread, you might want to explore up-thread and down-thread to get the context.

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

More
04 Dec 2012 22:56 - 04 Dec 2012 22:58 #27195 by BigJohnT
Replied by BigJohnT on topic Starting sequence
Andy,

How do you calculate the personality?
I see this in the man page:
The number of input pins, usually from 2 to 16
256 (0x100) if the ’and’ output is desired
512 (0x200) if the ’or’ output is desired
1024 (0x400) if the ’xor’ (exclusive or) output is desired

I can't figure out how you got 0x502 from the above... 0x502 converted to decimal is 1282 according to my google converter.

John
Last edit: 04 Dec 2012 22:58 by BigJohnT.

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

More
04 Dec 2012 23:08 #27197 by andypugh
Replied by andypugh on topic Starting sequence

The number of input pins, usually from 2 to 16
256 (0x100) if the ’and’ output is desired
512 (0x200) if the ’or’ output is desired
1024 (0x400) if the ’xor’ (exclusive or) output is desired
I can't figure out how you got 0x502 from the above... 0x502 converted to decimal is 1282 according to my google converter.

We want 2 pins, and both the AND and XOR outputs.
So that is 0x2 + 0x100 + 0x400 = 0x502
Or, in decimal, 2 + 256 + 1024 = 1282.

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

More
04 Dec 2012 23:15 #27199 by RomainM
Replied by RomainM on topic Starting sequence
Thanks guys ! I understand that it is possible, but I'm not very comfortable with LinuxCNC, Hal etc... I 'm learning. So I will try to digest your reply, test few things and if I success or fail I 'll give you a backup. :whistle:

Thanks !

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

More
04 Dec 2012 23:35 #27204 by BigJohnT
Replied by BigJohnT on topic Starting sequence

The number of input pins, usually from 2 to 16
256 (0x100) if the ’and’ output is desired
512 (0x200) if the ’or’ output is desired
1024 (0x400) if the ’xor’ (exclusive or) output is desired
I can't figure out how you got 0x502 from the above... 0x502 converted to decimal is 1282 according to my google converter.

We want 2 pins, and both the AND and XOR outputs.
So that is 0x2 + 0x100 + 0x400 = 0x502
Or, in decimal, 2 + 256 + 1024 = 1282.


Now that makes sense, I had no clue from reading the docs that you could have more than one type of outputs.

Thanks
John

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

More
04 Dec 2012 23:46 #27205 by andypugh
Replied by andypugh on topic Starting sequence

Now that makes sense, I had no clue from reading the docs that you could have more than one type of outputs.


I used it in this example precisely because of that, so that we have the XOR and the AND both available.

I don't really see the point in making output pins optional. The function could just as easily always compute all the outputs.

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

More
05 Dec 2012 19:15 #27243 by cncbasher
Replied by cncbasher on topic Starting sequence
Andy,

seeing this thread I thought I give it a go ! ,

on homeing , all I get is the axis sequencing over and over again , arh says he , start button is not latching in the true position until axis are homed , therefore the and gate wont bring the output true .
so manualy held the start button and true enough the axis sequenced once only .. so am I correct we need a latch of some kind and or possibly an invert to the input .

my switches are inverted due to using a mesa card .

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

More
05 Dec 2012 19:27 #27244 by andypugh
Replied by andypugh on topic Starting sequence

am I correct we need a latch of some kind and or possibly an invert to the input .

Yes, some sort of latch may be needed.
I had rather assumed that the homing sequence started on the rising edge of the home-request pin and ran to completion.

my switches are inverted due to using a mesa card .

The Mesa inputs should all have an input-not pin with the inverse logic.
You need a pin which is low until you press the button.

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

Time to create page: 0.152 seconds
Powered by Kunena Forum