ravi.joshi53

MrPLC Member
  • Content count

    12
  • Joined

  • Last visited

Everything posted by ravi.joshi53

  1. Hi, I am trying to run the Beckhoff Motor (reference velocity 900mm/s and maximum velocity 810mm/) in a sinusoidal trajectory. Following is the snippet of the PLC code- (* Joint 2 is using the external set point generator functionality *)ExtPosition := theta_max*COS(omega*t); (* t is time in second *)ExtVelocity := -theta_max*omega*SIN(omega*t);ExtAcceleration := -omega*omega*theta_max*COS(omega*t);IF ExtVelocity=0 AND ExtAcceleration=0 THEN ExtDirection := 0; (* stand still *)ELSIF ExtVelocity >= 0 THEN ExtDirection := 1; (* positive motion *)ELSE ExtDirection := -1; (* negative motion *)END_IFt:=t+0.01; (* The task is called at every 10 ms = 0.01sec *)(* feed the dynamic data into the external setpoint generator interface of axis *)MC_ExtSetPointGenFeed( Position := ExtPosition, Velocity := ExtVelocity, Acceleration := ExtAcceleration, Direction := ExtDirection, Axis := Joint_2);The global constants are defined as following- VAR_GLOBAL CONSTANT theta_max: INT := 60; (* in degree *) omega: REAL := 0.62; (* 2PI/Time Period=10sec *)END_VARWhen I set Position Lag Monitoring to TRUE, I get error 17744(0x4550). When Position Lag Monitoring is set to FALSE, the motor moves but not continuous. Also the motion is neither smooth nor instantaneous. I think the way, I am using time variable t is not correct. Somebody please help me to overcome with this problem.
  2. Hi I am trying to use MC_ExtSetPointGenEnable function in TwinCAT v2 PLC Control . Everytime I run the code, it shows 17744(0x4550) error. Please see below the screenshot of TwinCAT System Manager- - Thanks Ravi
  3. Hi, We have Beckhoff CPU module CX1020-0113 and two Beckhoff AC servo drives conneted using EL7201 card. I want to run both of the motors simultaneously using TwinCAT 2 PLC Control. Since I want to control the position, so I am using MC_AbsolutePosition function block. The sinusoidal trajectory can be taken as 60*SIN(w*t) /*here t is time. w is angular frequency which is constant*/Below is the snippet from PLC program - Please see below image for System Manager Info - Can somebody tell me how to provide sinusoidal trajectory as position? Please note that both the motors must run simultaneously. - Thanks Ravi
  4. Hi, I am calculating velocity and acceleration from position inside TwinCAT PLC Control V2. All these equations have only one variable which is time. Below is the PLC code- (* We are using the external set point generator functionality *)NewPosition := theta_max*COS(omega*t); (* t is time in second *)NewVelocity := -theta_max*omega*SIN(omega*t);NewAcceleration := -omega*omega*theta_max*COS(omega*t);IF NewVelocity=0 AND NewAcceleration=0 THEN NewDirection := 0; (* stand still *)ELSIF NewVelocity >= 0 THEN NewDirection := 1; (* positive motion *)ELSE NewDirection := -1; (* negative motion *)END_IFt:=t+0.01; (* The task is called at every 10 ms = 0.01sec *)(* feed the dynamic data into the external setpoint generator interface of axis *)MC_ExtSetPointGenFeed( Position := NewPosition, Velocity := NewVelocity, Acceleration := NewAcceleration, Direction := NewDirection, Axis := Joint_2);-------------------------------------------------------------(* Below parameters are defined in Global Variables file *)VAR_GLOBAL CONSTANT theta_max: INT := 60; (* in degree *) omega: REAL := 0.62; (* 2PI/Time Period=10sec *)END_VARThe MATLAB simulation of the above equations gives me following results- But this does not work in real Beckhoff motor. Please suggest.
  5. BITS N BYTES, thank you for this information. I have seen this info in the Beckhoff Infosystem before posting this question. Unfortunately, I could not understand it. Can you explain it? If required I can post the PLC code here. - Thanks Ravi
  6. Hi, I am trying to implement External set value generation in TwinCAT 2 PLC. An example is provided here which uses virutal axes. Somebody please tell me how to configure/add virutal axes in TwinCAT2 ? - Thanks Ravi
  7. BITS N BYTES, some more explanation please. Any sample code is always appreciated much more. - Thanks Ravi
  8. Hi OutOfControl, Thank you for your answer. However I think that I do not require "Slave Axis". Both the motors may have different-different trajectories BUT the only condition is that they must run simultaneously. Please see your inbox. I have sent you a message with more discription about the setup. - Thanks Ravi
  9. Hi Panic Mode, That was a mistake while posting the reply. Yes. You are right i.e. each joint is controlled by separate motor. Hence in order to control the position of end-effector, I need to move both the motors simultaneously. Just for the demonstration purpose, I want to provide same trajectory (sinusoidal trajectory) to both the motors. Although I actual scenario the trajectories will be different for each motor. I have attached a screenshot of TwinCAT 2 PLC control program in my question. Please have a look. - Thanks Ravi
  10. Hi BITS N BYTES, Thank you for your suggestion. I would like to tell you more about the system. Here I am building a serial chain robot (a manipulator), which has 2 degree of freedom. Each joint is connected to a separate motor. Hence, when I run both the motors simulataneoulsy, I can achive certain trajectory at the final link flange (end-effector). Since, I do not have enough experience with TwinCAT, I would like to hear some more explanation about your suggestion. Can you please elaborate your suggestion more? I would really appreciate, if you can provide some sample TwinCAT project for the same. - Thank you. Ravi
  11. Hi panic mode, Apologize for the inconvenience. Basically I have Beckhoff AC servo motors. I want to run these motors using TwinCAT 2 PLC Control. Presently, I am able to run them using two separate program (FBD) Joint1 and Joint2. These FBDs are later on called from MAIN FBD. Please see the below screenshot of PLC Control- I want to control the position of axis 1 and axis 2 by providing them different-2 profile. It means axis 1 may be runing on linear position profile howvere axis 2 may run on sinusoidal profile. Both the axes must move simultaneously. - Thanks Ravi