From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

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 hooked a scope up to one of the poles on modules 5 and 6 and when enabled I did get a square wave however when I set it to move the pulse width of the wave did not vary like it did on module 1 when it was moving.

 

Hopes this helps,

Larry

0 Kudos
Message 11 of 16
(1,186 Views)

Thanks Lawrence, that does help. Still working on troubleshooting this on my end; stay tuned.

Regards,

Michael Whitten
Senior RF Applications Engineer
0 Kudos
Message 12 of 16
(1,172 Views)

Michael,

 

I did a module shuffle and without unhooking the stepper motors from either module I just swap a module (Mod1)  and motor that works with one that typically does not (Mod6). With the new positions the Mod6 now in slot 1 works as instructed and Mod1 now does what Mod6 was before the switch. I also hooked both modules up with separate power supplies to insure that the problem was not being caused by something as simple as not enough current to go around (though that should have prevented all motors from running not just the last ones).

 

These experiments would tend to tell me that if it is hardware it would have to be in the cRIO itself but the more likely scenario in my mind is that it is in the program.

 

hopefully this information helps you with your troubleshooting more than it helped me.

 

Larry

0 Kudos
Message 13 of 16
(1,148 Views)

Hi Lawrence,

 

Thanks for the update. I can confirm that it's not the hardware (at least, not something specific to your hardware) as I see the same issue when running your code on HW that should work fine.

 

I'm still experimenting with the code; I've recompiled the bitfile with a slew of indicators at different points in the loops to see if I can isolate which one specifically is behaving differently. The module is enabling properly, and the position loop is running (or else we wouldn't see the position updating on the UI). Somewhere between the current loop and the PWM loop something is going wrong. I'll be investigating tomorrow when I have access to the hardware again, and will update you with my findings.

 

Regards,

Regards,

Michael Whitten
Senior RF Applications Engineer
0 Kudos
Message 14 of 16
(1,133 Views)
Solution
Accepted by topic author LawrenceD

Hi Lawrence,

 

Finally found it. After the tests I mentioned yesterday, we were able to see that the PWM response for axes 5 and 6 was not the same as the other four.

 

The developer realized that this suggested that the control status loop wasn't updating the PWM output, and we realized that we never checked the "UDV State Machine" code within the control loop. Sure enough, if you open this VI, there are a dozen more cases that you need to make to add the fifth and sixth axis.

 

I went ahead and made the appropriate modifications to the VI, which I have attached. After compiling, I was finally successfully able to use axes 5 and 6 with your code.

 

Problem VI.PNG

 

Replace the UDV state machine file in your project with the one I attached, and you should be able to get up and running. Let me know when you try it out!

 

Regards,

 

 

Regards,

Michael Whitten
Senior RF Applications Engineer
0 Kudos
Message 15 of 16
(1,127 Views)

That did the trick. Thank you for all your help.

 

Larry

0 Kudos
Message 16 of 16
(1,125 Views)