Re:Hardinge CHNC 1 Lathe

More
16 years 8 months ago #2102 by Kirk_Wallace
Why can't you use binary input with EMC2? I used a binary encoder with my tool carousel.

.hal snippet:
Code:
"... ### TURRET ### # create signals for tool loading loopback linkpp iocontrol.0.tool-prepare iocontrol.0.tool-prepared linkpp iocontrol.0.tool-change turret.0.position-change linkpp turret.0.position-changed iocontrol.0.tool-changed # decode turret encoder inputs newsig ones bit newsig twos bit newsig fours bit newsig eights bit linksp ones ppmc.0.din.06.in linksp ones wsum.0.bit.0.in linksp twos ppmc.0.din.07.in linksp twos wsum.0.bit.1.in linksp fours ppmc.0.din.08.in linksp fours wsum.0.bit.2.in linksp eights ppmc.0.din.09.in linksp eights wsum.0.bit.3.in # wsum.N.hold bit in newsig TurretCurrentPosition s32 linksp TurretCurrentPosition wsum.0.sum linksp TurretCurrentPosition turret.0.position-current newsig TurretRequestedPosition s32 linksp TurretRequestedPosition iocontrol.0.tool-prep-number linksp TurretRequestedPosition turret.0.position-requested setp turret.0.settle-stop [TURRET]STOP_SETTLE setp turret.0.settle-park [TURRET]PARK_SETTLE # connect turret to parallel port newsig TurretSeek bit linksp TurretSeek turret.0.seek linksp TurretSeek ppmc.0.dout.00.out newsig TurretStop bit linksp TurretStop turret.0.stop linksp TurretStop ppmc.0.dout.01.out ..."

You would most likely need more digits to get a reasonable resolution.

Using a quadrature reduces the number of wires, but you need to initialize the encoder before use.

Another option is to use something like an Attiny microprocessor to convert the encoder to SPI. Your Mesa card has an SPI feature, but I don't know its status. I need to get a Mesa card so I can try this out.
--
Kirk Wallace
www.wallacecompany.com/machine_shop/
www.wallacecompany.com/E45/index.html
California, USA

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

More
16 years 8 months ago #2105 by robh
Replied by robh on topic Re:Hardinge CHNC 1 Lathe
John is using a Wsum on the tool turret encoder

as its the same encoder as in the little HNC, my hardinge superslants etc
here is the truth table for any one else intrested.

################
# Decode for turrets
################
# Tool 1 2 3 4 5 6 7 8
# BitD 0 0 0 0 0 0 0 1
# BitC 0 0 0 1 1 1 1 0
# BitB 0 1 1 0 0 1 1 0
# BitA 1 0 1 0 1 0 1 0
################


here is the HAL snippet which i have ten fed into classicladder to handle all the spin and lock down etc.
#turret bit ins
#t1
net t1-bit0 wsum.0.bit.0.in <= hm2_[HOSTMOT2](BOARD).0.gpio.063.in_not
net t1-bit1 wsum.0.bit.1.in <= hm2_[HOSTMOT2](BOARD).0.gpio.061.in_not
net t1-bit2 wsum.0.bit.2.in <= hm2_[HOSTMOT2](BOARD).0.gpio.059.in_not
net t1-bit3 wsum.0.bit.3.in <= hm2_[HOSTMOT2](BOARD).0.gpio.057.in_not

net turret1-num wsum.0.sum => classicladder.0.s32in-02

if any one is intrested i will add the ladder logic if john does not mind me spamming his post, or add it on wiki i guess, maybe john will add his when he gets there :)

rob

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

More
16 years 8 months ago #2106 by Kirk_Wallace
I use the same wsum method on my turret:


except I have a Hal component instead of the PLC.
www.wallacecompany.com/cnc_lathe/HNC/emc2/turret.comp

Unless I was mistaken John was talking about an override encoder, which I think could use a similar technique. The down side is the number of wires needed to go from the operator panel to the EMC PC. That's why I was thinking about using SPI.
--
Kirk Wallace
www.wallacecompany.com/machine_shop/
www.wallacecompany.com/E45/index.html
California, USA

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

More
16 years 8 months ago #2107 by BigJohnT
Replied by BigJohnT on topic Re:Hardinge CHNC 1 Lathe
Kirk,

The feed override switch I used wsum to get 0 - 12 but there is no way to use that output ATM in EMC :( To control the feed override. You can only use a + - input to halui to change the feed override.

I wish my turret encoder was nice and clean like yours LOL and wish it worked. Mine is completely enclosed in rubber or some rubber like material so I can't see the switches.

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

More
16 years 8 months ago #2108 by Kirk_Wallace
Thanks. I didn't know that halui worked that way with the override.

My encoder had the same rubber covering, but it was falling off, so I removed it. I figured removing it wouldn't make things any worse, so far, so good.
I made new cork gaskets for the cover and installed o-rings and bushings under the cover screws. The area under the turret table was venting air leaks and oil into the encoder area, so I had to fix all of the air leaks. There are two normal air vents in the system, which I think are placed at the ends of the air passages for carrying the air/oil to the ends of the lines. These vent outside though.

You should be able to fix your encoder board fairly easily. The encoder chips are still available:
search.digikey.com/scripts/DkSearch/dksu...l&name=296-3533-5-ND
www.electronics-tutorials.ws/combination/comb_4.html

The Hall switches are common, here is one example, but is in a smaller package:
search.digikey.com/scripts/DkSearch/dksu...5881LUA-ND&x=16&y=17

If you prefer, you could send your board to me and I'll fix and return it for free.
--
Kirk Wallace
www.wallacecompany.com/machine_shop/
www.wallacecompany.com/E45/index.html
California, USA

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

More
16 years 8 months ago #2111 by BigJohnT
Replied by BigJohnT on topic Re:Hardinge CHNC 1 Lathe
Kirk,

Thanks for the info on the turret encoder and for the offer to fix it. I might take you up on it if I can't figure it out LOL. I will peal the rubber off today and take a look see. How do you troubleshoot the parts? It was mighty wet in there when I took the cover off.

When I took the magnet off I noticed that there was not any key or any other means of lining up the magnet to any specific orientation. Is it just trial and error to get the magnet set so it will drop and lock at the right place?

Oh my and the turret comp is neat. Is it in 2.4? or did you add it locally? As many of these Hardinges that are out there it should be part of EMC I think if it is not all ready.

Thanks
John

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

Time to create page: 0.275 seconds
Powered by Kunena Forum