Duranthas
Lifetime Supporting Member
First, a background on the equipment so you know what is going on. I have an AB ControlLogix L63 processor controlling some Mitsubishi MR-J4-500TM4-EIP servos. The AOI instructions from Mitsubishi controlling the drives make it very similar to the native AB motion commands. The position field of a MAM (MMAM using Mits AOI) is REAL, just like AB.
Now, all that said, I have a part which requires a second cut that is a specific distance from the first cut. On the HMI, I only give the option to adjust the distance of the first cut, and then I use a math function to add the 0.780" distance from the first cut for the second cut. For some reason unbeknown to me, my value is a bit off and it doesn't matter if I use ADD or CPT to do it. If I add 0.78 to 13.74, instead of getting 14.52 which is what I would expect, I get 14.5199995. Why is there a discrepancy in the math? The only reason I found this is that I was using the equals (EQU) to compare the servo actual position to the assigned position. If they matched, then I knew the horizontal slide was where it needed to be before I commanded the vertical slide to move to cut depth. As it turns out, 14.52 does not equal 14.5199995 so my EQU run was never going true.
Any guidance as to why adding a constant to a REAL does not give the expected value would be greatly appreciated. I know this is going to be detailed and nerdy, but I really want to know.
Now, all that said, I have a part which requires a second cut that is a specific distance from the first cut. On the HMI, I only give the option to adjust the distance of the first cut, and then I use a math function to add the 0.780" distance from the first cut for the second cut. For some reason unbeknown to me, my value is a bit off and it doesn't matter if I use ADD or CPT to do it. If I add 0.78 to 13.74, instead of getting 14.52 which is what I would expect, I get 14.5199995. Why is there a discrepancy in the math? The only reason I found this is that I was using the equals (EQU) to compare the servo actual position to the assigned position. If they matched, then I knew the horizontal slide was where it needed to be before I commanded the vertical slide to move to cut depth. As it turns out, 14.52 does not equal 14.5199995 so my EQU run was never going true.
Any guidance as to why adding a constant to a REAL does not give the expected value would be greatly appreciated. I know this is going to be detailed and nerdy, but I really want to know.