ragzz1995

Using NX-PG0232-5 to control Stepper Motor (NJ PLC)

7 posts in this topic

Hello,

I need to control a stepper motor(have stepper driver) using NX-PG0232-5 with NJ301 PLC. The function is simple, i need to run the stepper motor continuously at a specified velocity. So, in NX-PG module I've made the settings (Ch1 output mode as "Velocity continuous pulse output") and given the tags to IO (as shown below, sorry i'm not able to attach image). I've also added the initialization program to switch on the vfd. Now to move continuously i should should just give speed in pps in "PG_Ch1_Command_Velocity" right? 


    Ch1 Controlword    Control word 1    W    WORD            
    Ch1 Switch On    Switch ON for pulse output 1    W    BOOL    PG_Ch1_SwitchOn        Global Variables
    Ch1 Enable Voltage    Start turning on the power for pulse output 1.    W    BOOL    PG_Ch1_Enable_Voltage        Global Variables
    Ch1 Quick Stop    Immediate stop for pulse output 1    W    BOOL    PG_Ch1_QuickStop        Global Variables
    Ch1 Enable Operation    Start operation for pulse output 1    W    BOOL    PG_Ch1_EnableOperation        Global Variables
    Ch1 Fault Reset    Reset errors for pulse output 1    W    BOOL            
    Ch1 External Output    Aggregated data of external outputs for pulse output 1    W    BYTE            
    Ch1 Command Position    Command position of pulse output 1    W    DINT    PG_Ch1_Command_Position        Global Variables
    Ch1 Command Velocity    Command velocity of pulse output 1    W    DINT    PG_Ch1_Command_Velocity        Global Variables
 

Edited by ragzz1995

Share this post


Link to post
Share on other sites

Haven't worked with it in a while, but pretty sure there's a bit in the control word to turn it on.  Check manual W524.

Share this post


Link to post
Share on other sites

I'm able to run the motor but i have to give position and velocity. How do i run continuously? (Do i have to keep incrementing the position ?? Seems like it ain't right though)

Share this post


Link to post
Share on other sites

What motion instruction are you using to cause the move?  MC_MoveVelocity will make a speed controlled axis, and doesn't need a position.

I never move a motion axis using the variables in the IO map... Configure your motion axis and use the motion function blocks.

Share this post


Link to post
Share on other sites

So I have to assign an axis to NX-PG and the move the stepper motor using MC_MoveVelocity??

Share this post


Link to post
Share on other sites

That's how I do it.  Why reinvent the wheel, the motion commands are built in.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now