Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

H-Bridge Control

Has anyone written a LabVIEW program to control an H-Bridge circuit?
I have a valve that uses a 12VDC motor to open & close it. It also has a position sensor. Total valve movement is ~70°. I also have an H-Bridge circuit to control the speed and direction.
I want to control the valve position based off feedback from the position sensor.
 
0 Kudos
Message 1 of 4
(3,547 Views)
Most often H-bridge circuits are run from a digital pulse - usually PWM. I would recommend looking at the PWM-Counter Output.vi example program which ships with LabVIEW (available in the Example Finder under Hardware I/O >> Control >> General). This is a simple control program which reads in an analog signal (your position sensor) and outputs a PWM digital signal which is based on a proportional gain to try to match a given setpoint.
0 Kudos
Message 2 of 4
(3,533 Views)
The valve controller has an analog input for speed and a digital input for direction. The problem I am having is writing code to control the valve. When the valve is opening and goes past it's set point, I need to change direction. The problem is that the voltage is high (because the valve was being driven open) and the valve moves to fast in the other direction. I need a way to change direction and lower the voltage at the same time.
I have attached a VI I am using.
 
Any input would be appreciated.
0 Kudos
Message 3 of 4
(3,525 Views)
Hi bfeddeck,

I looked at your code and considering what you said you may want to try and have some sort of case structure to where you look at the direction on the last iteration and if the current iteration goes for a different direction you could write a value of 0 or something smaller to the write value.  That way you get a power down before the PID tries to take it back up.

Regards,
0 Kudos
Message 4 of 4
(3,505 Views)