Hello Guest it is March 28, 2024, 11:25:47 AM

Author Topic: Index ENC  (Read 3731 times)

0 Members and 1 Guest are viewing this topic.

Offline rufan

*
  •  38 38
    • View Profile
Index ENC
« on: June 05, 2014, 03:11:52 PM »
In the past when I have no ENC installed I had a index wired to an input.
I used this Index signal to align my VFD spindle motor.

But now I have the ENC installed, and don't know how to get the Index working.
Is there a way in the software to link "encoder 1 - IN I+" to the Index signal.

Thanks,

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Index ENC
« Reply #1 on: June 06, 2014, 05:12:26 PM »
How did you do it previously?

Hood

Offline rufan

*
  •  38 38
    • View Profile
Re: Index ENC
« Reply #2 on: June 07, 2014, 12:42:54 AM »
Previously I had a sensor mounted on the spindle. That gives me an index signal.
I wrote a script to turn the spindle at slow speed until index signal is high and then apply a break and stop motor.

Now I have mounted an incremental encoder witch signals going to the ENC module.
I was assuming that the index in Mach3 was still working with the ENC module, linked internally by software.

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Index ENC
« Reply #3 on: June 07, 2014, 02:43:35 AM »
You may be able to do similar with the encoder position or angle reading via VB, see here
http://www.cs-lab.eu/en/index.php?m=article&show&aid=128&uinfo=Digital_and_analog_IOs__configuration__its_easy#ENC

Hood

Offline rufan

*
  •  38 38
    • View Profile
Re: Index ENC
« Reply #4 on: June 10, 2014, 05:09:25 AM »
This is just what I was looking for.

I have made a test macro to align my VFD spindle.
But the loop function is too slow to detect if angle is at 0 degree.
Is there any other way to achieve this.


Test Macro:
SetSpinSpeed(100)            'Set Spindle Speed
ActivateSignal(OUTPUT6)         'Spindle Enable

Angle=GetInput(84)            'Get Spindle Angle from ENC
If Angle > 0 then
   DoSpinCW()            'Turn Spindle CW
      Do               'Enter Loop
      Angle=GetInput(84)      'Get Spindle Angle from ENC
      If Angle = 0 then
         DoSpinStop()
         Exit Do
         End if
      Loop
End If

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Index ENC
« Reply #5 on: June 10, 2014, 08:05:25 AM »
Maybe try using a range for the angle rather than just zero, you can then likely fine tune the range to get the desired stopping position.
Hood

Offline rufan

*
  •  38 38
    • View Profile
Re: Index ENC
« Reply #6 on: June 10, 2014, 08:25:15 AM »
Hood

I also done what you said, I give it a margin of 20 degree, but it takes a couple of turns before stopping.
And does not stop always on the same spot.

I have some other options to control the driver.
It is actually not a VFD but a DC driver (Lenze 4900) controlling a DC motor.
Now I control it with 0-10V and direction.
- Driver can accept -10 to +10V or A + B complementary waveform.
So it will be possible to control it with STEP/DIR.

I was looking for the YAPSC:10 but can't find it to buy.
And converting STEP/DIR to A + B complementary waveform seems to be hard because A & B must be 90d shifted.