kandauru Posted April 17, 2018 Share Posted April 17, 2018 Hi, I am trying to implement a "rollover" mode for my rotation table. I am doing the following: &1 #1->Z #2->Y #3->U #4->V #5->X #6->CC 'rotation table Coord[1].FeedTime = 1000 Coord[1].PosRollover[5] = 360 All motors are homed and I make jog, rel, abs moves. I don't see that position of CC is running between 0-360 degrees. It is continuously grows up in + or - direction. What I am doing wrong? Please, advise. I am using PPmac IDE v.2.2.0.39, firmware - 2.3.2.5, CPU:PowerPC, 460EX, Type: UMAC Link to comment Share on other sites More sharing options...
steve.milici Posted April 20, 2018 Share Posted April 20, 2018 Reported motor and axis position is not affected by rollover. (To obtain position information “rolled over” to within one revolution, use the modulo (remainder) operator, either in Power PMAC or in the host computer.) Link to comment Share on other sites More sharing options...
kandauru Posted April 22, 2018 Author Share Posted April 22, 2018 Then, how can I implement a hardware reset of axis position every 360 degrees? There is a sensor and it gets signaled every 360 degrees. At this moment I have to reset axis position to 0. Thank you in advance. Link to comment Share on other sites More sharing options...
Clopedandle Posted April 23, 2018 Share Posted April 23, 2018 Can you explain why you would need to do that? Like Steve said, you can just use modulo to calculate the angle within 360 degrees. If you mean you need a hardware output pulse every 360 degrees, you could set up position compare and use the EQU pins. Link to comment Share on other sites More sharing options...
kandauru Posted August 3, 2018 Author Share Posted August 3, 2018 Hi again, more than one year ago I asked this question, but the problem is still there. I need to reset the position of the rotary axis when it reaches 360° to 0° and so on. Until today I have been doing that in the software on PC side using the modulo. Our application is testing disks with different resolutions. It might be 1 degree and less. It is very critical to have data every scan resolution. With modulo sometimes we missed data in the areas where the reset was done. So, how can I implement it differently? I would like to make it as PLC module that monitors the position and when Home sensor is high, the position becomes 0. The motor is revolving when I want to do that. The sensor is connected to Gate3[0].Chan[0].HomeFlag. On PC side I execute the "#1p" command the get the current position. Is it possible to make something like this: open plc RESETPOSITION if (Gate3[0].Chan[0].HomeFlag == 1) Motor[0].ActPos = 0 close I tried to reset ActPos, it does not work, so what does? Link to comment Share on other sites More sharing options...
curtwilson Posted August 3, 2018 Share Posted August 3, 2018 There are several reasons why trying to reset any internal position registers on the fly is a BAD idea and will not work reliably. The first reason is that in the time gap between deciding you want to change the position value and the time you actually do it, the real position can change, so the new value you try to force will not be correct. The second reason is that it is not possible to change all of the related registers for both commanded and actual position together while anything is happening. On the commanded position side, you have the axis move command value, the motor move command value, and the instantaneous interpolated motor command value, with "pipelined" value in queues between the different stages. On the actual position side, you have the hardware encoder register, the motor software actual position value, and various offsets. A mismatch at any stage of the processing will probably cause a fatal error. There is no fundamental reason why applying the modulo operation to "extended" position value is not robust. There is no reason for it to "miss data" if properly applied. If you can provide us with more information about exactly what you are trying to do in your rollover calculations, we should be able to give you suggestions. Link to comment Share on other sites More sharing options...
kandauru Posted August 4, 2018 Author Share Posted August 4, 2018 Hello, below you can see a piece of source code for position reading: /****/ if (commInThread.SendCommand("#1.." + MAX_AXIS.ToString() + "p", out reponse) == Status.Ok) { try { string[] words = reponse[0].Split(delimiterChars); for (int i = 0; i < MAX_AXIS; i++) { if (i == WIndex) { float Wpos = float.Parse(words); axisPositions = Wpos%360inpulses; } else { axisPositions = float.Parse(words); } } } catch (Exception /*ex*/) { DebugPrint("DTDEBUG::UpdatePosLoop: error while reading position from the controller\n"); } } In case I move modulo operation to PLC program, the "p" command will return the value without modulo. So, I'll be forced to make changes for special position reading of W axis in the software. May be you know the better solution for such a case? Thanks! Link to comment Share on other sites More sharing options...
curtwilson Posted August 6, 2018 Share Posted August 6, 2018 Yes, if you want to report your rotary axis position within a single revolution, you will need to use the modulo operator. Link to comment Share on other sites More sharing options...
Recommended Posts