Discussion:
[Emc-users] Help with 4bit BCD
t***@cableone.net
2008-06-25 04:32:37 UTC
Permalink
Hi all<BR>
I need to have the tool prep number output as a 4bit BCD<BR>
The machine already has a plc that will use that format (along with a start tool change output<BR>
and a finish tool change input )<BR>
I looked through the archives for an example but most are a swing arm type<BR>
tool changer mine is a carosel where the tool in the spindle will go back<BR>
to the pocket it came from <BR>
I am using a Mesa 5i20 card if that helps or not<BR>
<BR>
<BR>
Thanks in advance<BR>
<BR>
Terry<BR>
<BR>---- Msg sent via CableONE.net MyMail - http://www.cableone.net
Kirk Wallace
2008-06-25 05:31:27 UTC
Permalink
Post by t***@cableone.net
Hi all
I need to have the tool prep number output as a 4bit BCD
You may need to make a small HAL component to convert your
iocontrol.0.tool-prep-number into your 4 bits. It could be a routine to
divide by two to extract each bit. If I recall correctly one four bit
word of BDC is good for 9 tools.

Check here for the current components:

http://linuxcnc.org/docview/html/

and "comp" tool:

http://www.linuxcnc.org/docview/html//hal_comp.html

For my lathe, I used an encoder to get the current turret slot number in
four bit binary, then compared it to the slot requested, and stopped
seeking when I got a match. I converted the binary to decimal with the
weighted sum component:

http://www.linuxcnc.org/docview/html//man/man9/weighted_sum.9.html

which was already available. I then wrote a component to handle the
sequencing and timing. After some study, making your own components is
fairly easy.
Post by t***@cableone.net
The machine already has a plc that will use that format (along with a
start tool change output
and a finish tool change input )
I looked through the archives for an example but most are a swing arm
type
tool changer mine is a carosel where the tool in the spindle will go
back
to the pocket it came from
I am using a Mesa 5i20 card if that helps or not
Thanks in advance
Terry
I have a mill with a tool changer that sounds like it might be similar
to yours. Currently, tool one of twenty four has a home switch on it.
The original system I believe expected the operator to home the carousel
at power-up, then the system would keep track of the number of bucket
moves. I plan on making a six bit encoder and use the same system as my
lathe.
--
Kirk Wallace (California, USA
http://www.wallacecompany.com/machine_shop/
Hardinge HNC/EMC CNC lathe,
Bridgeport mill conversion, doing XY now,
Zubal lathe conversion pending
Craftsman AA 109 restoration
Shizuoka ST-N/EMC CNC)
tomp
2008-06-25 13:58:31 UTC
Permalink
I couldnt figure if you wanted 1 BCD digit with 4 bits ( would allow
0thru9)
or 4 BCD digits (each digit having 4 bits, allowing 0000 thru 9999)

Not much conversion is needed for the single digit,
just limit the range,
but, for the 4 digit scheme, you need some translation from bin to bcd.
tomp
t***@cableone.net
2008-06-26 03:50:37 UTC
Permalink
<P>I need to use a 16 tool changer (it has no encoder it counts the how many times the index motor rotates)</P>
<P>so whatever method of getting the infromation about the tool number requested by EMC to my</P>
<P>PLC I can deal with it.</P>
<P>Thanks </P>
<P>Terry<BR>
<BR>
<BR>
<BR>
<B>On Wed Jun 25 8:58 , tomp <TOMP-***@SBCGLOBAL.NET>sent:<BR>
<BR>
</P></B>
<BLOCKQUOTE style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #f5f5f5 2px solid; MARGIN-RIGHT: 0px">I couldnt figure if you wanted 1 BCD digit with 4 bits ( would allow<BR>
0thru9)<BR>
or 4 BCD digits (each digit having 4 bits, allowing 0000 thru 9999)<BR>
<BR>
Not much conversion is needed for the single digit, <BR>
just limit the range,<BR>
but, for the 4 digit scheme, you need some translation from bin to bcd.<BR>
tomp<BR>
<BR>
<BR>
-------------------------------------------------------------------------<BR>
Check out the new SourceForge.net Marketplace.<BR>
It's the best place to buy or sell services for<BR>
just about anything Open Source.<BR>
<A href="parse.pl?redirect=http%3A%2F%2Fsourceforge.net%2Fservices%2Fbuy%2Findex.php" target=_blank><SPAN style="COLOR: #ff0000">http://sourceforge.net/services/buy/index.php</SPAN></A><BR>
_______________________________________________<BR>
Emc-users mailing list<BR>
<A href="javascript:top.opencompose('Emc-***@lists.sourceforge.net','','','')">Emc-***@lists.sourceforge.net</A><BR>
<A href="parse.pl?redirect=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Femc-users" target=_blank><SPAN style="COLOR: #ff0000">https://lists.sourceforge.net/lists/listinfo/emc-users</SPAN></A><BR>
</BLOCKQUOTE><BR><hr>Msg sent via CableONE.net MyMail - http://www.cableone.net
Kirk Wallace
2008-06-26 06:14:17 UTC
Permalink
Post by t***@cableone.net
I need to use a 16 tool changer (it has no encoder it counts the how
many times the index motor rotates)
so whatever method of getting the infromation about the tool number
requested by EMC to my
PLC I can deal with it.
Thanks
Terry
That sounds just like my QuickDraw changer here:

Loading Image...
Loading Image...
http://www.wallacecompany.com/machine_shop/Shizuoka/tool_changer_video.html

My changer has inputs for Home, CW and CCW Rotation, Tool-In and
Tool-Out. It has an output pulse for Command Completed. The output pulse
activates when a Home, Tool-In and Tool-Out completes or pulses for each
tool move.

If your changer is like mine, EMC and an input on your 5i20 could count
the tool pulses while a tool move was in progress. Once the number of
pulses is counted, you could hold that number for the next carousel
move. You could also route that signal to another part of EMC for the
command complete, but it would only be active for the other commands. A
5i20 output would be needed for each changer command. This would not use
your PLC. I believe all the EMC HAL components you would need are
already available, like Counter or UpDown , And, Or, Debounce, etc.

What PLC do you have? EMC should be able to output what ever you need. I
would guess five 5i20 outputs for your binary; ones, twos, fours, eights
and sixteens bit. A small HAL component would be needed to set these
bits unless someone has come up with a component already. I wonder if
your PLC could use serial data (ModBus?)? You could bit bang the data
out two pins like my SPI(ish) serial DAC component:

http://www.wallacecompany.com/machine_shop/EMC2/serial_dac/serial_dac.comp
--
Kirk Wallace (California, USA
http://www.wallacecompany.com/machine_shop/
Hardinge HNC/EMC CNC lathe,
Bridgeport mill conversion, doing XY now,
Zubal lathe conversion pending
Craftsman AA 109 restoration
Shizuoka ST-N/EMC CNC)
Loading...