08-04-2011 09:17 AM
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
08-04-2011 10:38 AM - edited 08-04-2011 10:38 AM
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.
08-04-2011 11:09 AM
@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
08-05-2011 12:10 AM
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
08-05-2011 08:47 AM
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?
08-05-2011 09:01 AM
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.
08-05-2011 09:11 AM
Maybe someone on the motion control boards can help.