LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding Case structure implementation to control DC motor using NI9401 and DC motor driver

I am using cRIO 9073 ,NI 9401,DC motor and motor Driver, I have attached my VI , i am acquiring  two signals which i represented with  1 and 2 in my attached block and caluclating their amplitudes and comparing them individually with a set threshold.

 

1)when signal 1 condition is true DI0 and DI1 should be true and false respectively so that motor rotates clockwise if the condition is false no movement that is DIo and DI1 should be 0 and 0

 

2)coming to signal  2 when its condition is true DI0 and DI1 should be false and true so that motor rotates anticlock wise direction if the condition is false no motor movement i.e DI0 and DI1 should be 0 and 0

 

Plese give me some  solution i made two case structures for the two different signals but my motor is rotating only in one direction and it is just vibrating.

 

 

 

Note :both the condition 1 and 2  true at a time  is not possible in my case because signals properties are like that 

0 Kudos
Message 1 of 7
(3,225 Views)

Are you absolutely sure that both are not true at the same time? Try connecting the two booleans to an and gate and wire the output of that to a case structure. In the true case put a message dialog or a breakpoint or something to verify this is never happening. If you have an oscilloscope even better.

 

One thing that I would suggest is to only have one instance of the DIO0 and one instance of the DIO1 node. If you want to use a case structure then just use one. Do a build array on the two booleans and wire that to the case structure. In case 0,1,2 and 3 you have two boolean constants wired out for each of the DIO nodes set to the states that you want.

 

Even better just forget about case structures altogether! Use the Boolean logic functions instead. Something like this might work for you.

 

 

Capture.PNG

=====================
LabVIEW 2012


0 Kudos
Message 2 of 7
(3,217 Views)

@I wrote:
If you want to use a case structure then just use one. Do a build array on the two booleans and wire that to the case structure. In case 0,1,2 and 3 you have two boolean constants...

 

 

 After the build array you would obviously do a boolean array to number Smiley Happy

 

=====================
LabVIEW 2012


0 Kudos
Message 3 of 7
(3,209 Views)

sir the logic given by you is  working thank you very much.

 

 

But i have a small trouble here in your  code,when i tested your given value with a constat value at signal one it worked perfectly , but if my signal one varies satisfying greater what is the position(i.e for example  if it is just oscillating between 1 and 2 satisfying grater than codition)  my motor just gives jerks.

 

please provide me some solution

0 Kudos
Message 4 of 7
(3,196 Views)

Without knowing what the two input signals look like there is no way I can help. Depending on the input the motor could very well jerk. What is generating the signals?

=====================
LabVIEW 2012


0 Kudos
Message 5 of 7
(3,186 Views)

i am taking two muscle EMG signlas continoulsy  from body and filtering them and caluclating their RMS. The condition is  when one muscle is active it will give EMG both muscles active is not possible.

now we are caluclating RMS for a sample lenght of 1800  for both signals and comparing with a thresholld value .if one EMG is active it will enable the motor to movein one direction and if other muscle is active it will rotate in anticlock wise after comparing with thresholds

 

my RMS just keeps on changing without sticking to one value now the problem comes here where my motor just gets disturbed.

 

please provide me some solution so that when one signal is high the motor rotates for some time.

0 Kudos
Message 6 of 7
(3,182 Views)

Maybe someone on the motion control boards can help.

=====================
LabVIEW 2012


0 Kudos
Message 7 of 7
(3,176 Views)