12-27-2011 05:18 PM
I have a question on implementing the "Reset Position" method in soft motion. I'm using the Soft motion axis interface. My system is setup similar to the unbound axis example "Servo Interface (9263 & 9401 & 9411)" project. When I execute a Reset Position method
it resets the postion in the trajectory generator, but it does not implement the reset of the physical encoder. I notice that in the trajectory generator data there is a newly computed position offset value.
My encoder code in the FPGA has an input to reset the position, but I'm not sure exacly the proper sequence in implementing this.
Steve
Solved! Go to Solution.
12-28-2011 10:10 AM
HI Steve,
Unless you have a good reason to reset the encoder position on the FPGA, I would just let SoftMotion handle the 'Reset Position' for you (in other words, call the 'Reset Position' function and leave the encoder on the FPGA alone). I say this because resetting the position on the FPGA could have unintended results. Imagine that your spliner is outputting a position setpoint of 100000 and you reset the encoder position to 0. The motor will try to immediately jump from 100000 to 0, which will cause the motor to fault due to a following error. By trusting SoftMotion, you will avoid a situation like this.
Thanks,
12-28-2011 11:25 PM
Thanks for the response Paul. In the past with the Trajectory Generator API I have used the reset position in conjuction with disabling the drive. As you said bad things will happen if you don't. I was wondering if with the new Soft Motion API if that had changed. If you never reset the encoder on the FPGA, then how do you use the "Position Offset" in hte Trajectory Data so you can display the correct encoder position? I don't see how this I64 in the Trajectory Data cluster relates to the motor encoder.
Steve
12-29-2011 02:03 PM
Hi Steve,
In your axis interface VI, you should be writing the encoder position to the SoftMotion engine every scan period. Internally, SoftMotion knows when you reset the position and it will automatically display the encoder position relative to the reset position. Therefore, after a reset position, it is likely that your FPGA encoder position will differ from the position that SoftMotion reports. This is because SoftMotion is doing the scaling for you. Therefore, you don't have to use the Position Offset value (and in fact this probably doesn't even need to be exposed to the user). The reason why Position Offset is an I64 is because it actually represents a fixed point value (this was implemented before LabVIEW supported fixed point so we implemented our own FXP). I believe that the most significant 32 bits represent an I32 integer and the least 32 significant bits represent the fraction, so it is similar to a +/-64,32 representation.
All that being said, are you seeing an incorrect reported position after performing a position reset? If so, what are you seeing?
Thanks,
12-30-2011 02:05 AM
Thanks Paul,
That works. I had not looked at the Read Axis Encoder Method.
Steve