Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding Axis to Example Program

Solved!
Go to solution

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.

0 Kudos
Message 1 of 16
(3,691 Views)

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,

Regards,

Michael Whitten
Senior RF Applications Engineer
0 Kudos
Message 2 of 16
(3,646 Views)

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.

 

0 Kudos
Message 3 of 16
(3,640 Views)

Can you post the entire project as a zip file? 

 

Regards,

Regards,

Michael Whitten
Senior RF Applications Engineer
0 Kudos
Message 4 of 16
(3,636 Views)

Lets see if this one works for you.

0 Kudos
Message 5 of 16
(3,633 Views)

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.

0 Kudos
Message 6 of 16
(3,629 Views)

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:

 

  • If you change the "Num of Axes" FPGA front panel item back to four (the original number in the example code), are you able to use this code with the four axes? This will be able to tell us if the issue is with the modifications that added the two extra axes, or if the issue lies elsewhere
  • If I remember correctly, you are seeing the position update, without any motor movement - is that correct? This tells us at least that the position loop is running on the FPGA. When the code is running, are the drives enabled? Is there holding torque on the motors so that you can't turn them manually?
  • If you try to use just one motor at a time in the host RT code, are you able to use it successfully?

 

Regards,

Regards,

Michael Whitten
Senior RF Applications Engineer
0 Kudos
Message 7 of 16
(3,615 Views)

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

0 Kudos
Message 8 of 16
(3,612 Views)

Michael,

 

were you able to come up with any reason why the last two motors would not be moving?

 

Larry

0 Kudos
Message 9 of 16
(3,564 Views)

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,

Regards,

Michael Whitten
Senior RF Applications Engineer
0 Kudos
Message 10 of 16
(3,557 Views)