Jump to content
OMRON Forums

MoMo

Omron
  • Posts

    36
  • Joined

  • Last visited

  • Days Won

    6

Posts posted by MoMo

  1. The simplest way is to create a virtual motor #1, and then let real motor #2 and real motor #3 follow the virtual motor.

    Then set Motor[2].JogSpeed and Motor[3].JogSpeed
    And use the Jog+ or Jog- command for real motor #2 and #3. The motion speed of the real motor is the speed of virtual motor #1 + the speed of real motor JogSpeed.

  2. 12 hours ago, David Jan said:

    Another problem is that I am using CSV (Cyclic Synchronous velocity) mode and my motor configuration file is as follows:
    Motor[1].pDac = ECAT[0].IO[2].Data.a
    EncTable[1].pEnc = ECAT[0].IO[92].Data.a
    Where ECAT[0].IO[2].Data is the desired speed value of the motor and ECAT[0].IO[92].Data is the actual position value of the motor, can this still use pDAc = pEnc + Mtr2VelOffset from your rticplc?
    In your programme
    pDAc(pushm, motor desired speed) = pEnc(motor command current) + Mtr2VelOffset
    In my programme
    pDAc(motor desired speed) = pEnc(motor actual position) + Mtr2VelOffset
    Does this make sense? Why your desired speed can be obtained from the motor command current + Mtr2VelOffset, can you tell me the principle?
    Then I want to modify the speed in CSV mode, what should I do?

     can this still use pDAc = pEnc + Mtr2VelOffset from your rticplc?

    No

     

    PMAC always controls the motor in position mode, so if you want to control a certain motor for speed offset, you must convert the speed offset into position. This has nothing to do with whether you use CSV mode or not. It can still be achieved using CSP mode. And using CSV mode in the EtherCAT system does not bring good servo performance.

    The only way to achieve this is to let the real motor follow the virtual motor.

    You can see in my example, I'm not tampering with any motor output values, I'm letting the other motors follow. Motor2 and Motor3 follow the modified Motor1 position.

     

    Position and velocity are the same at a given time. Just like your monthly income of $5,000 represents speed, then you have earned $25,000 this year, which represents position.

    If you go to a bank for a loan, the bank needs to confirm your monthly income, but PMAC is a special bank. It only confirms how much you earned this year.

    The most important thing is how to convert the offset speed into position information. In my example, this is achieved through the encoder conversion table.

     

    • Thanks 1
  3. Normally, when EtherCAT works in CST mode, the driver will complete the current loop control and motor commutation control by itself.

    You can place speed loop and position loop control in the controller using user-defined servo algorithms.

    But due to the huge delay of the EtherCAT bus, your control performance will be far worse than that of the servo drive working with CSP mode.

     

  4. Because the scripting language of PMAC is not an object-oriented language, it will be more difficult to program in an object-oriented way.

    Regarding blocking issues, Switch case can be used in scripting languages to replace the delay method of Call Timer, including using Sys.CdTimer[i].

    Instantiation can only be implemented using base address + offset address addressing for the variables in it.

    Or you can consider using CPLC, there are many explanations and instructions on how to program C language in an object-oriented way. Even in a single thread, multi-threaded operations are implemented.

    All in all, other methods are more complex than using multiple PLCs. Of course, if you are very willing to pursue the elegance of programming, you can consider the above methods.

     

     

     

     

     

  5. 7 hours ago, David Jan said:

    Can you help me with my problem? If I want the speed of axis 1 to be 50, then the speed of axis 2 is equal to the speed of axis 1 minus 10. the speed of axis 3 is equal to the speed of axis 1 plus 10. how can I achieve this? I don't want to set the speeds of motor 2 and motor 3 in the motion programme, i just want to find motor 2 and motor 3 by the speed of motor 1. it can be understood that the speeds of motor 2 and motor 3 are coupled with the speed of motor 1.

    The following is a simple demonstration using CPLC and virtual motor. There are many ways to achieve similar effects, including not using CPLC.

    The difficulty in using it on a real motor is the control of acceleration and deceleration. Since you did not specify an explicit application, this method does not guarantee that your device can be used.

     

    VelocityOffset.zip

  6. Can you answer a few questions for me?

    ① Do you want motor #2 and motor #3 to have a fixed speed deviation from motor #1? And this deviation will change at any time?

    ② If the motor changes speed while it is moving, positional alignment cannot be guaranteed, or there is a speed change process when changing speed online.Is this acceptable?

    ③When motor #1 is moving forward, its speed minus the deviation is less than zero, is motor #2 or motor #3 moving in reverse?

  7. We have not received similar reports from other customers.

    In the case that we can't reproduce your issue on our end, we can't be sure it's a bug.

    Please provides the necessary conditions to reproduce the failure, ensuring that we can reproduce yours.

  8. 1.You can use the free directive to see the remaining cache size

    image.png.928913f1e833bb2c6c2817bfcfc65d90.png

    image.png.06c891f9073fe9302afc558118447254.png

    2.You can use the "Clear Prog N" command to clear the specified motion program, where N represents the motion program sequence number.

     

  9. PMAC actually only controls the position of the motor (closed-loop control).

    When you plan a position-time motion curve, the velocity-time curve is also determined.

    Because speed is the derivative of position, if you just want to change the speed without updating the program, you can use TimeBase.

    Quote

    Can I directly add or subtract from the output address corresponding to Motor [1]. pDac?

    No, because PMAC is a closed-loop control that controls the motor position. If you use CST or CSV mode, PMAC's PID algorithm will correct the offset you apply.

    Give a simple example:

    If you are a boiler worker, you have a supervisor who monitors the boiler temperature and tells you how much coal to add.

    You want to get off work early and speed up adding coal to the boiler.

    At this time, your supervisor finds that the boiler temperature rises too fast and will start to order you to reduce the coal addition.

    If you do not obey your supervisor's orders, your supervisor will think that there is a risk of the boiler losing control and will open the boiler's pressure relief valve and shut down the boiler directly (PMAC kill the motor).

    This is similar to if you have two bosses in the company and give you two opposite instructions, how should you execute them?

     

    I suggest you tell us your project requirements, because your idea is basically impossible to implement now, and this is not a limitation brought by PMAC.

     

    • Like 1
  10. I think DaveBarnett's method is actually a good method.

    You can ensure precise synchronization of the two coordinate systems through TimeBase and achieve precise delay through PLC0.
    First set Coord[x].DesTimeBase=0 in the two coordinate systems, and then run the running program. At this time, the motor will remain stationary. Then first restore the Coord[x].DesTimeBase of the first coordinate system to Sys.ServoPeriod, and start the countdown, and then restore the Coord[x].DesTimeBase of the second coordinate system.

  11. First you must clarify the following:

    ①No matter what mode your motor uses in PMAC, CSP, CSV or CST, PMAC will eventually change it to position control mode.

    ②When you use a motion program, the controller plans a position-time curve, so its speed-time curve is also determined.

    ③If you want to simply offset the motion speed through DacBias, this is only possible when the motor is in open loop mode, which for your current situation means that you cannot control the position.

    ④The easiest way for your current situation is to use the TimeBase or Coord[].SegOverride mentioned above to change the speed. The premise of using Coord[].SegOverride is that Coord[].SegMoveTime is not 0

  12. I think the IDE cannot run on WinXP because the IDE was developed and tested without considering WinXP at all. Even if you install it successfully, there is no guarantee that it will work properly.

     

  13. I use the following RS232 to Ethernet module.

    image.png.35f838fb115b93003a23004aa71fe43c.png

    About $30

     

    image.thumb.png.e15d8829864a63bb5ab70690988c03fd.png

     

    image.thumb.png.5d3c426d596f6e7cbaf34ef5600d26ee.png

     

    /*For more information see notes.txt in the Documentation folder */
    #include <gplib.h>   

    #define _PPScriptMode_        // for enum mode, replace this with #define _EnumMode_
    #include "../../Include/pp_proj.h"

    #include <gplib.h> 
    #include <stdio.h> 
    #include <sys/socket.h> 
    #include <arpa/inet.h> 
    #include <stdlib.h> 
    #include <string.h> 
    #include <unistd.h> 
    #include <netinet/in.h>

    #define PORT_NUM 9739 //端口号

    int main(void)
    {
        InitLibrary();  // Required for accessing Power PMAC library
        int server_sockfd = -1;
        int server_len = 0;
        int client_len = 0;
        char Cmd[256],Recv[256];
        int result = 0;
        int i,length_of_Cmd_Recv;
     
        struct sockaddr_in server_addr;
        struct sockaddr_in client_addr;

        // 创建数据报套接字
        server_sockfd = socket(AF_INET, SOCK_DGRAM, 0);
     
        // 设置监听的端口、IP
        server_addr.sin_family = AF_INET;
        server_addr.sin_addr.s_addr = htonl(INADDR_ANY);
        server_addr.sin_port = htons(PORT_NUM);
        server_len = sizeof(server_addr);
     
        client_addr.sin_addr.s_addr = htonl(INADDR_ANY);
        client_addr.sin_port = htons(0);
        client_len = sizeof(client_addr);
        // 绑定(命名)套接字
        bind(server_sockfd, (struct sockaddr *)&server_addr, server_len);

        length_of_Cmd_Recv=sizeof(Cmd);

        for(i=0;i<256;i++)
        {
            Cmd[i]=0;
            Recv[i]=0;
        }

        while (1)
        {
            // 接收数据,用 client_addr 来储存数据来源程序的IP端口
            result = recvfrom(server_sockfd, &Cmd, length_of_Cmd_Recv, 0,(struct sockaddr *)&client_addr, &client_len);
            result = GetResponse(&Cmd,&Recv,length_of_Cmd_Recv,0);
            //发送处理后的数据
            sendto(server_sockfd, &Recv, length_of_Cmd_Recv, 0, (struct sockaddr *)&client_addr, client_len);
            //清空缓存
            for(i=0;i<256;i++)
            {
                Cmd[i]=0;
                Recv[i]=0;
            }
        }
     
        // 关闭套接字
        close(server_sockfd);
        CloseLibrary();
        return 0;
    }

    The above is the Socket communication code of PPMAC. I recommend using UDP communication because UDP communication is closer to the serial port and is carried out in the form of messages.

     

    • Like 1
    • Thanks 1
  14. On 2/23/2024 at 9:12 PM, DaveBarnett said:

    Thanks for the reply.... For sure the settings created by the IDE need to be heavily scrutinized! … But that's not what I’m talking about.  Imagine you have dozens of machines out in the field, but the only difference between them is, let’s say… a gearbox ratio, and this could change over time. It would be cleaner to put that gearbox ratio in an f-saved variable than to have an entirely different project just to deal with one variable change.  But, it means someone in the field needs to be trained in the use of the IDE, exposes other problems, etc.  I suppose a custom application could be written to handle manipulating only this single variable…but that carries some baggage, too.  

    For one project, I added a rotary BCD switch wired to some unused I/O that allowed maintenance to choose among 16 options for the machine without using a computer.  It worked out well.  I’m looking for something akin to that, but that would work for a floating point number with high precision.  

     

    IMG_3357.jpeg

     

    You can use the script's preprocessing instructions to implement different settings.

    image.thumb.png.94c654ba129e913ec7c4db9fc6387c1d.png

     

    The example is as follows:

    image.thumb.png.4d525fa8f5291aff1b43b08906710eb8.png

    image.png.f74ed399086a13d4201a85d5a56c5c4a.png

     

     

    Then you can directly modify the predefinition in us'rflash via the sed command in Linux, such as the “_Machine_1” in the example above.

    Use the instructions below to switch the _Machine_1 to _Machine_2.After that, all you have to do is send $$$ and you'll be able to use the new settings

    system mount -o remount,rw /opt
    system sed -i 's/#define _Machine_1/#define _Machine_2/g' /opt/ppmac/usrflash/Project/PMAC\ Script\ Language/Global\ Includes/global\ definitions.pmh
    system mount -o remount,ro /opt

     

    image.thumb.png.a7e812c18f337f29a496224df27136c0.png

     

     

     

     

    • Like 1
    • Thanks 1
  15. I think your idea is very creative.

    I don't know much about your equipment, something like this can be fixed in the controller as a file. Or modify and set through a host computer software.

    I may not want unrelated personnel to easily change the PMAC controller configuration through DIP switches. I personally prefer to perform this operation through a dedicated host computer software.

    I think your needs can be met, but it will be a little more complicated.

     

  16. My personal experience is that I don't trust the settings generated by the IDE software.

    Usually I write the settings into the Global Includes folder, and disallow PPMAC from using systemsetup.cfg.

    It is very reliable to use the "fsave" command to temporarily save the contents of certain variables. Our users have been using it without any problems.

    • Thanks 1
  17. Add your slave station in my IDE, PDO can be edited, just add the content is still byte.

    The content that can be added or modified in PDO is also determined by the ESI file, so you still need to consult Hilscher on this issue.
    But there is a high probability that it will be what I guessed before, and it won’t be very elegant.

  18. If you are using a direct drive motor (linear motor), you do not need to compensate for backlash. In other words, the reverse error you measure in a laser interferometer cannot be compensated and is due to mechanical precision.

    The compensation table can only improve the absolute positioning accuracy of the motor, but cannot improve the repeated positioning accuracy.

×
×
  • Create New...