01-07-2010 08:26 AM
Hello All,
Question 1:
I have an application for which there is no direct example seems to be available. I have a stepper motor based Cartesian robot which is supposed to follow a trajectory. The trajectory data is not available at once. We have the starting point, the next point to move comes in and the robot has to move to that point. Then the next point comes in and it has to KEEP MOVING to follow this trajectory. The physical system cannot stop and restart again since the sampling rate is between 30ms to 90ms. It is a continuous trajectory but not available completely. We can accept a little delay in it. That is we can wait for two points to come in and then ask the system to move. Based on the next point available we know it has to keep moving in that direction hence the system can coast to the next value. When the system changes direction we will know one or two points in advance and can let the motors stop and then start moving in the opposite direction. This is a tracking application.
Currently I have this trajectory data stored in a matrix to simplify work by avoiding sensor interface. The stepper generation example VI that comes with the softmotion development module could be made to follow a contoured move but to my understanding it is reading all the data at once and then planning the trajectory using spline generation function on four consecutive points.
Question 2:
Related to the previous question I want to understand how the spline generator works. Let’s say we have a series of first few points (contour) available: P1, P2, P3 and P4. That seems to be sufficient for spline generator to generate spline. Now the question is, if a fifth point comes in, will it generate a new trajectory based on P2, P3, P4 and P5 (that is using a FIFO buffer) or will it wait till it has P6 and P7 also available to make a new set of points P4, P5, P6 and P7?
Question 3:
Funny though it may sound, we also want to use a closed loop PID control in the above stepper motor based system. This is because this system is soon to be replaced by another system which will need this type of loop. I will be happy at this point even if I get a PID with both I and D terms zero and P constant to be one. Hence I want to read the first data point, compare it with the first encoder position and if there is a difference, move to that point. The process will repeat. Hence the output of PID will have only the difference of current and next position for which stepper generator will generate STEPS to move. Sounds like do able work but I have failed to implement it. I think the Stepper Generation example VI (that comes with the Sofmotion development module) is doing something like this anyway but implicitly since absolute position doesn’t make sense. A relative distance has to be calculated.
Please help, even if you can answer only one of the questions at a time.
Thanks,
Ali
Solved! Go to Solution.
01-08-2010 05:45 PM
Hi Ali,
Which version of the Softmotion module are you using. In 2009, the Contour Move has a method called Update Points (right click on the function block to change teh method type). This method lets you update the trajectory as the motor is moving and keeps the motor moving until you tell it stop.
With regards, I believe that the spline generator will create a new trajectory based on whatever points are presently available.
You should be able to implement the PID control that you have discribed. When you say it doesn't work, what happens? In the example program, did try it using the Relative or Relative to Reference operation mode?
01-09-2010 03:06 PM
Thanks. Your short reply seems to be well targeted as it's first suggestion, that of using update points, has solved all the problems, at least apparently.
I dont have 2009 version of SoftMotion Development Module but still the option is there.
I had to read a subarray of length L to see it working. I have varied L from 10 to 1 and still it works. Hence
somehow spline can handle such a small data size. PID is working too. I am not 100% sure about its "real"
behavior but next week I'll show my VI to someone who knows more LV than myself to get a confirmation.
Till then, thanks for your expert advice.