aoligei Posted April 8 Share Posted April 8 I am using ethercat and the servo drives are in CSV mode, my current motion program (motion.pmc) is as follows. &1 #1->100x open prog1 f 50 x 100 x 0 close This motion program has a speed of 50, now I want to have an offset for the motor speed, say with a veloffset, but I don't want to modify the motion program, so how do I change the motor configuration file or add a plc program? I found a parameter in ethercat called velorityoffset (60B1) but it doesn't work well and I can't change the speed by adding the variable veloffset directly to the address corresponding to Motor[x].pDac (target speed). Quote Link to comment Share on other sites More sharing options...
leandro.martins Posted April 8 Share Posted April 8 (edited) The simplest way of doing that should be using the "%{constant}" online command, which overrides the motion program time-base. In that way you can increase up to two times the velocity described in motion program, sending via terminal the command %200 To return to default time-base %100 If your application really needs as an offset, and the relation between Motor[x].ServoOut and the velocity is well-known, probably you can use the the variable veloffset in Motor[x].DacBias. Edited April 8 by leandro.martins Quote Link to comment Share on other sites More sharing options...
aoligei Posted April 9 Author Share Posted April 9 It is not easy to use the Motor[1].DacBais parameter as you said. I can only try to operate the existing Motor[1].pDac address, but it still cannot modify the set speed. For example, the original The speed of the motion program is 50, but I want to add 10 to the speed offset. How to do this? Below is my code, where is the problem? xx.pmh Sys.WpKey = $AAAAAAAA Motor[1].pAmpEnable = ECAT[0].IO[3].Data.a Motor[1].AmpEnableBit = 0 Motor[1].pLimits = 0 Motor[1].pDac = Sys.Idata[1].a EncTable[1].pEnc = ECAT[0].IO[4099].Data.a EncTable[1].pEnc1 = Sys.pushm EncTable[1].ScaleFactor = 1 EncTable[1].Type = 1 Motor[1].pEnc = EncTable[1].a Motor[1].pEnc2 = EncTable[1].a Motor[1].pAmpFault = ECAT[0].IO[4102].Data.a Motor[1].ctrl =Sys.servoctrl Motor[1].ServoCtrl = 1 plc0.plc open plc0 ECAT[0].IO[1].Data = Sys.Idata[1] + 1000 //target vel close prog1.pmc open prog1 f50 x300 x0 close Quote Link to comment Share on other sites More sharing options...
leandro.martins Posted April 9 Share Posted April 9 In my opinion your plc is doing exactly the same thing if you set Motor[1].pDac =ECAT[0].IO[1].Data Motor[1].DacBias = 100 but your plc is being executed in a different task, with a different interruption. I assume that can make the motor to use the ECAT[0].IO[1].Data before the offset being applied. My best suggestion would be changing the motion program to open prog1 f(50+Q1) x300 x0 close being possible to use the Coord[x].Q[1] as your veloffset. As that isn't an option, I don't think that I have more suggestions. I hope someone else can help you. Quote Link to comment Share on other sites More sharing options...
David Jan Posted April 11 Share Posted April 11 Actually, I don't particularly understand why changing the speed setting value directly in the Ethercat address doesn't work, I'll keep an eye on your question. Quote Link to comment Share on other sites More sharing options...
aoligei Posted April 11 Author Share Posted April 11 I set it up like you said, but the movement of the motor is something I can't understand, the speed of the motor after the enable on the motor is the reciprocating movement, it is reciprocating around the point where the position is 0. My understanding in this is that the motor can't move properly according to the value I gave for Motor[1].DacBais due to the presence of the position loop that restricts the movement of the motor. When running the motion programme, there is no significant change in its speed, is my understanding of Motor[1].DacBais incorrect? This is how I am using it as you said. Motor[1].pDac =ECAT[0].IO[1].Data Motor[1].DacBias = 100 Quote Link to comment Share on other sites More sharing options...
MoMo Posted Friday at 05:48 AM Share Posted Friday at 05:48 AM 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.