scotthew Posted March 25, 2015 Share Posted March 25, 2015 I know this has been discussed before, but this variant may be slightly different. I did try running the compiled sine on the PMAC and it worked fine. But when I stream it, I get some horrible velocity blending artifacts (jumping motion due to oscillating velcoity, when it should be smooth). I'm no sure how to fix this. I am trying to stream a motion trajectory to the Geobrick. It seems to work in spline mode, but PVT mode I get some instability/judder. As far as I can tell this sine command is ok, but not sure why I get the behavior I see in the plot. Is there anything obvious? DEVLOCATIONTYPE location2; pmac.GetPmacLocation(dwDevice,(long *)&location2); // Define a rotary buffer pmac.GetResponseEx(dwDevice,_T("&1 DEF ROT 2500 B0"),0,&szTest1,&status); // Clear the DPRAM rotary buffer pmac.DPRRotBufClr(dwDevice,coordSys); // Clear the PMAC internal rotary buffer pmac.GetResponseEx(dwDevice,_T("&1 OPEN ROT CLR CLS"),FALSE,&szTest1,&status); // Turn the Rotary buffer transfer on pmac.DPRSetRotBuf(dwDevice,TRUE); double pi = 3.1416; const double T = 5; const double A = 10; const double u = (2*pi/T); const double C = 2; const double phi0 = pi / 2; double delta_t = 100e-3; pmac.DPRAsciiStrToRotEx(dwDevice,_T("ABS"),coordSys,TRUE,&status); pmac.DPRAsciiStrToRotEx(dwDevice,_T("LINEAR"),coordSys,TRUE,&status); pmac.DPRAsciiStrToRotEx(dwDevice,_T("X 0"),coordSys,TRUE,&status); pmac.DPRAsciiStrToRotEx(dwDevice,_T("DWELL 0"),coordSys,TRUE,&status); pmac.DPRAsciiStrToRotEx(dwDevice,_T("PVT100"),coordSys,TRUE,&status); pmac.DPRAsciiStrToRotEx(dwDevice,_T("BLOCKSTART"),coordSys,TRUE,&status); CString command; for(double t = 0.0; t < 5; t += delta_t) { const double p = A * sin( u* t - phi0) + A ; const double v = A * u * cos(u * t - phi0) ; command.Format("X %0.7f:%0.7f\n",p,v); pmac.DPRAsciiStrToRotEx(dwDevice,command,coordSys,TRUE,&status); //command.Format("X%0.7f",p,v); TRACE(_T("%.7f,%.7f,%.7f\n") , p,v,t ); } pmac.DPRAsciiStrToRotEx(dwDevice,_T("BLOCKSTOP"),coordSys,TRUE,&status); pmac.DPRAsciiStrToRotEx(dwDevice,_T("DWELL 0"),coordSys,TRUE,&status); pmac.DPRAsciiStrToRotEx(dwDevice,_T("X 0"),coordSys,TRUE,&status);plot.pdf Link to comment Share on other sites More sharing options...
scotthew Posted March 26, 2015 Author Share Posted March 26, 2015 I think I have determined the cause of this. I'm trying to do PVT control in with the Inverse Kinematics Coordinate system, but I don't believe the vendor who implmented the kinematics has implented the velocity kinematics (only the position kinematics). I'm working with the vendor to see if they can fix this. If anybody has other suggestions, they are greatly appreciated! Link to comment Share on other sites More sharing options...
Richard Naddaf Posted March 26, 2015 Share Posted March 26, 2015 I think that you are on the right track. Yes, you have to pass the velocity terms if you are doing kinematics. We do occasionally get involved in programming, but this is typically implemented by the integrator or machine builder. On another note, I would think that it is much easier to execute this profile in a motion program inside the PMAC. Link to comment Share on other sites More sharing options...
Recommended Posts