Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Controling valve opening with stepper motor-home position?

Hello,

 

currently i'm controling valve opening with steepper motor. System consist of cRio, output module card NI 9472, NEMA 34 motor and motor driver.

For driving motor, I have signal for turning left, turning right, motor eneble and train of impuleses(for speed reason running of FPGA).

 

As motor driver does not have home switch option, I would like to implement it with additional input card and inductive sensor.

How to do the additional coding home position of motor and valve -

go to home position, home position reached (reading from sensor) and when home position is reached(sensor is on) reset valve opening indicator to zero?

 

 

 

0 Kudos
Message 1 of 2
(3,795 Views)

I will give you a really bad example of how to add this functionality to your code (see attachment).

 

The problem is, that you use many local variables, and I added even more, because I don't wanted to change your design. Try to think about how it could be implemented in a more nice way... I suggest the use of state machine design and in a ideal situation don't use any local variables (and property nodes reading the actual values from the controls).

 

Also I suggest to think right from the begining about the FPGA - in project explorer you can also add a FPGA target and simulate it (dont need to have the actual target).

 

 

Good luck with your project!

Jozef Lipták
Message 2 of 2
(3,720 Views)