LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stepper motor and loacell PID control - waveform motion.

Hi, 

 

Hardware :  cRio9073, C series module 9403 for stepper motor control and 9215 for load cell data acquisition. 

 

I am trying to control a stepper motor in a closed feedback loop system with a load cell. The user would have to input two things : the maximum load applied and the frequency of the motion. At the moment I have it working in open loop controlling how many steps forwards or backwards it does and at what rate, with a display showing the load being applied.

 

I am now looking to include the "PID.vi" built into labview into my existing code. I am using the load cell output as the 'process variable' and the 'output' of the PID will control the wait time between an ON and OFF signal to the motor (since I have to do the PWM in software as the 9403 module doesn't do it in hardware. Is this the right way to do it? ) 

 

I wish to make the motor do a sinewave motion, thus the 'setpoint' of the PID would be dynamic. I have therefore linked the "Sinewave form.vi" (also built into labview) to the setpoint and the frequency of the "Sinewave form.vi" will be the user input for the frequency of the motor. However my problem lies with the 'Sampling info' of the "Sinewave form.vi" : Previously that is what controlled my number of steps, defining the maximum displacement of the motor. Now I need the peak of the generated sinewave to coincide with the maximum load applied defined by the user. How can I make it do that? 

 

I have attached my existing code with how I have attached the PID.vi at the moment. 

 

Many thanks for your help

 

Lawrence 

Download All
0 Kudos
Message 1 of 4
(3,902 Views)

Hi Lawrence,

 

Here is an example PID VI.

 

Regards

Rico P
Smiley Very Happy
0 Kudos
Message 2 of 4
(3,851 Views)
Sorry, here's the plant simulator.
Rico P
Smiley Very Happy
0 Kudos
Message 3 of 4
(3,844 Views)

Hi, 

 

I saw your post on NI forums 4 years ago, I met the same problem with you which is making the setpoint dynamic, have you already solved this problem, would you please share your experience with me?

 

Thanks,

CJ

0 Kudos
Message 4 of 4
(3,063 Views)