05-19-2009 11:09 AM
Hi,
I am trying to implement a logic using State-machine architecture, just to make it more modular for improvements in the future.
However, I am having trouble with the logic. Can anyone please help me? I am attaching the vi for reference.
I want my motor to toggle between the upper and lower voltage limits. This voltage comes from a TEDS torque cell. The problem is that it is not going through the complete cycle. I mean the motor starts moving in the clockwise direction untill it hits lower limit, then changes direction, but doesn't go till upper limit; instead comes back again. I feel there is something wrong in the Compare DAQmx state.
Thanks.
Sasidhar.
05-20-2009 05:19 PM
Hi Sasidar,
I see you have a control there for X values and don't have the reading wired up. Presumeably that is for testing, yes?
05-20-2009 05:55 PM
Yes Jeff. That is for testing. I actually have my test setup with specimen, so did not want to connect n remove everything eachtime. I am sending u a picture of my picture of my project, maybe it might give u a better picture of wht I am trying to achieve. The clockwise n counterclockwise motion of the motor is to simulate the flexion n extesion of a spine specimen.
Thanks a lot. Hope you can help me with clearing the logic part.
Thanks.
Sasi.
05-21-2009 03:06 PM
05-21-2009 05:13 PM
Hi Jeff,
Tried simplifying the code by doing a compare and run fwd rev according to the torque value.
But, still cannot figure out the correctly how the data flow needs to occur.
Can you help clarifying to me step by step.
Sorry for the trouble.
Thanks.
05-22-2009 12:25 PM
I would probably break it down into states like this:
Initialize
Read DAQ
Turn Motor Forward
Turn Motor Backward
Stop Motor
It would start with Initialize then go to Read DAQ. Read DAQ would decide which direction the motor should turn based off the readings and pass it into that state (pass the velocity in as well). The motor states will decide either to go to Stop Motor by a user override or by the loading cycles, or return to Read DAQ.