Machsupport Forum

Third party software and hardware support forums. => Galil => Topic started by: bbutcher on September 08, 2018, 09:38:45 AM

Title: Limit Switch Connection question
Post by: bbutcher on September 08, 2018, 09:38:45 AM
I had my 3 axis system connected and running fine, but decided to add a 4th axis and rewire my controller to make room for the additional motor amp (all motor amps are Copely 306A). These motor amps take a +/- 10V signal for the input rather than a step and direction signal. I had my limit switches connected only to the motor amps in the old system, and therefore Mach3 was not aware they existed. If any axis hit a limit, the motor would stop for that axis only until it was commanded to move away from the limit, but Mach3 would continue running the program as if nothing was wrong. This led to some interesting shaped parts at times but not exactly what I wanted of course.

My revised controller now connects the limit switches to the Galil ICM 1900 break-out board, and uses the AMPEN(x,y,z) pin to enable the motor amp. The motors, encoders, and limit switches were set up using SmartTerminal to get all motors running the correct direction, not running away, and stopping when they hit a limit switch. I only have limit switches connected to the X,Y,&Z axis. I did discover that I got an error22 in SmartTerminal when the unused limit switch connections were not grounded for the FLSW and RLSW pins on ICM 1900. Do I need to ground other unused limit switch pins?

I then set up Mach 3 and the Galil plugin to match the configuration, but was not sure if my limit switches are active high or active low. I mapped them to the appropriate Mach3 pins per the instructions in the GalilPlugIn.pdf file. When I look at the Mach3 diagnostic screen, I see the limit switches all activated if I configure them as active low in the Ports & Pins setup screen, and not activated if I use Active high.

In either active high or active low, when I reset the controller and try to move a motor, I get an error message about limits and the motor does not move. The motors come on and lock in position when I perform the reset, just no motion. I may have selected the wrong limit switch condition when configuring the Galil plugin, but am unable to run configure a second time without locking up Mach3.

A simplified schematic showing the old and new limit switch connections and the ICM to motor amp connections is attached, along with the limit switch mapping for the GalilPlugIn.
(http://)
Title: Re: Limit Switch Connection question
Post by: bbutcher on September 09, 2018, 01:21:36 AM
I think I resolved the limit switch problem. One switch on the Z axis was mechanically broken which was giving some weird results. Replacing it has solved some of my problems. It does require a rather weird configuration scheme however. For what it is worth, the voltage on the ICM 1900 FLSX, FLRX, etc changed from 5 volts to zero volts when the limit switch opens, which I assume means it is "active". When I get GalilSt to config, which is only one time after creating and opening a new profile in Mach3, I have to configure the limit switches as Active low in GalilSt . If I set them to Active High, it changes the value of the SmartTerminal CN operand from 1 to -1, with the Galil controller stopping motion when the switches are not activated.

Then I have to set up limit switches in Mach3 Ports & Pins, Inputs screen. In that screen I have to configure the limit swithces as Active High in order to get Mach3 to allow motion.
I now have the motors all running the correct direction, and the limit switches stopping motion toward the switch when activated. Not quite sure why Mach3 thinks it is active high, but at least it works.

Now my problem is with the DRO boxes in Mach3. I assume these DROs get their value from reading the DP value stored by Galil as the quadrature encoders are rotated by the motors, and converting to inches. What is strange is that in my old Mach3 profile, the DRO values continued to change if I stopped the motors by clicking Reset and then rotated the lead screws (and motors) manually. The DP counter in SmartTerminal continues tracking the encoders, so it always contains the current position regardless of how the encoder is rotated. In the past 10 or so new profiles I had to create to get to this point, the DRO values freeze when the Reset button is clicked and do not change with manual motor rotations. When Reset is clicked again to restore power to the motors, the DRO thinks it is still at the location where it was reset. This is true for all three axes presently being used. I will post this as a separate topic.