05-11-2017 10:45 AM
I have a project that need 6 axis and there is a sample program that will run 4 in the softmotion module. I should be able to open it up and just duplicate the code for the two extra axis and add them to the project correct? the program in question is the position profile (multi axis) sample project.
Solved! Go to Solution.
05-12-2017 04:47 PM
Hi Lawrence,
Yes, in general you should be able to use the example as a starting point in order to then add additional axes.
However, do note that there are multiple areas of the code that need to be modified in order to interface with additional drives. Notice that each primary loop (the current loop, position loop, etc.) includes a for loop that indexes through each axis defined in the project (or, like the PWM loop, just include the code for each axis in parallel).
You'll need to ensure that in every one of these loops, the appropriate code is duplicated for working with the two additional loops you're adding. In the Mailbox loop, for example, you'll need to duplicate the cases for the two case structures for both of the additional axes that you are adding to your project.
So, yes, you should be able to duplicate the code and then use the new axes, but it will depend on how much of the code you have duplicated.
Regards,
05-15-2017 09:17 AM
Michael,
I added all the required callouts and cases in the VI to interface with the new axis however the two additional axis do not work. I have gone through the program (and project) over and over to try and find out what I was missing that would cause the two new axis to not work but I am coming up blank.
05-15-2017 01:19 PM
Can you post the entire project as a zip file?
Regards,
05-15-2017 02:12 PM
Lets see if this one works for you.
05-15-2017 05:48 PM
I found an error in the FPGA VI that was fixed in the attached version however it did not fix the problem as far as I can tell.
05-18-2017 08:40 AM
Hi Lawrence,
I looked over the code with some colleagues on the development team, and we didn't see anything wrong with the FPGA VI on an initial review. A few questions for you:
Regards,
05-18-2017 10:09 AM
Michael,
If I change the number of axis back to the original four those four still work however the first four motors still work when I have the number of axis set to 6.
I am seeing the position update on the two non working axis and the modules do enable when I turn them on in the control VI. when the two non working axis are enabled I am getting some amount of holding torque however it does not seem to be on the same level as the other four axis (difficult but not impossible to turn vs almost impossible to turn by hand).
If I understand your question correctly then yes I am able to successfully enable and move the motors with the RT control individually until I get to axis 5 and 6 then the module enables and the position updates but the motor does not move.
I have gone through for at least the tenth time the wiring of the hardware and can not find a loose or wrong connection, the two non working axis are wired exactly the same as the four working axis.
Thanks for the help,
Larry
05-30-2017 11:44 AM
Michael,
were you able to come up with any reason why the last two motors would not be moving?
Larry
05-30-2017 01:57 PM
Hi Lawrence,
No, I wasn't able to find any reason based on the code itself. I discussed the information you mentioned in the last post with the development team here, and we can't see any clear reason why the code wouldn't work.
Now that NIWeek is over, I'm currently compiling a modified version of the code to test out here. I hope to try it out myself tomorrow or Thursday to see if I can find anything with the actual hardware.
I'll update you as soon as I've tried it out. Do you have an oscilloscope handy? It'd be nice to scope the output signals from the last two modules and see if anything is being output, or if the data is wrong, etc.
Regards,