Hello Guest it is March 28, 2024, 06:28:39 AM

Author Topic: bcd input  (Read 5857 times)

0 Members and 1 Guest are viewing this topic.

bcd input
« on: October 24, 2016, 01:26:40 PM »
I,m running a hardinge chnc with an ahha control and I want to change over to mach3 the turret uses an encoder for the turret position. the encoder needs 3 inputs to communicate with mach3. Ahha used what they called a bcd input. There is also a 4th input for station 8. I think I would need to know how to set up 3 inputs to be able to tell mach what station I am on.

Can anyone help please
thanks
Art
Re: bcd input
« Reply #1 on: October 25, 2016, 11:49:37 AM »
I'm sending more info on how the ah-ha system works. I hope this helps get me started.
thanks
Art

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: bcd input
« Reply #2 on: October 27, 2016, 05:05:29 AM »
Its plain vanilla binary wth inverse logic (not BCD).

set 4 inputs to active low and then you can decode with:

D * 8 + C * 4 + b * 2 + A

so in code:

slot = CINT(isActive(INPUT4)) * -8 + CINT(isActive(INPUT3)) * -4 + CINT(isActive(INPUT2)) * -2 + CINT(isActive(INPUT1)) * -1

Without more info. it's unclear why they've used 4 inputs for 8 states (3 should be enough) but my guess would be that state 0 is returned when it's between slots (is that the case?).
« Last Edit: October 27, 2016, 05:53:24 AM by stirling »
Re: bcd input
« Reply #3 on: October 27, 2016, 11:54:32 AM »
Thanks for the help, but wow am I lost with that code. I'm new to this. When I did the retrofit with ah-ha, they supplied me with the script I attached. I gave them the sequence of the turret change, and the wire voltage for the encoder and they wrote the code for me. I thought I was following what they did, but I don't understand what you sent me. But I'm gonna try do some more reading.

It 's not really an encoder, that is what Hardinge calls it. its more like hall effect switches encased in some resin. there is a magnet that rotates with the turret over the resin. So I'm not sure what state the wires are in between stations. I'll check it when I get a chance. I do know they treated the 8th station differently in there code.

thanks
Art
Re: bcd input
« Reply #4 on: November 02, 2016, 01:48:54 PM »
I checked the state of the wires between stations, you were right 3 of the wires drop to 0 volts the fourth stays at 5 volts all the time except when it is on station 8. I'm sending a pic of the encoder.

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: bcd input
« Reply #5 on: November 03, 2016, 08:00:26 AM »
OK - so if you look at the table in your pdf.

If we re-arrange it as per the following:

1) use 1 to mean the input is active and 0 to mean inactive (rather than voltage levels)
2) put it in order of most significant bit to the left rather than least significant

we get:

Code: [Select]

STATION            D   C   B   A

 none              0   0   0   0
   1               0   0   0   1
   2               0   0   1   0
   3               0   0   1   1
   4               0   1   0   0
   5               0   1   0   1
   6               0   1   1   0
   7               0   1   1   1
   8               1   0   0   0


i.e. plain simple 4 digit binary counting where all 0 (inactive) means between stations.
Re: bcd input
« Reply #6 on: November 07, 2016, 12:24:44 PM »
Thanks, that looks right, I'm going to post the wire color codes from the encoder here. I imagine there are a lot of Hardinge chnc machines out there. The original Allen Bradley Control hasn't been supported for years, and the machine is very high quality. I have been looking at other tool change post to give me some idea where to start. thanks again

Art
Re: bcd input
« Reply #7 on: January 10, 2017, 12:53:52 PM »
to get started i'm trying to turn on an output and nothing seems to be happening

M6 macro reads

ActivateSignal(output2)

shouldn't this turn on output 2? it isn't. I'm using mach2 I have the output enabled and a pin assigned to it but nothing is happening.
Help!
thanks
Art