LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Movement, Measurement and time between them

Solved!
Go to solution

I´ve modified the code putting some "waits" but it seems to me not too professional. If motor goes too far, when returning to home it spends a lot of time but not always the same. Any idea how to improve the code? It should be something that instead of time in seconds would act with an order. I´ve been trying to tell the motor to stop when a position is reached but there is no driver for that, so...

 

Thanks people!! 

0 Kudos
Message 11 of 14
(385 Views)

Hi lacorgui,

 

as said before: you need to check, if your motor has reached its goal position. Only then you should go to the next state…

 

Instead of have different states for going to zero and some arbitrary position you should use only one state for going to arbitrary position. This state takes the goal position as parameter and only exits (apart from error checking) when the postion is reached!

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
Message 12 of 14
(382 Views)

I see what you say GerdW, but I do not know how to check that. In MoveNextX and MoveNextY stages I make a comparison of values between final position and actual position in order to go to the next stage, however the process is quicker than motors movement.

 

Moreover I´m using Lab 9 and I´m not able to add more stages to the state machine, sorry (maybe is fault of my lack of knowledge in Labview).

 

Anyway, I´ll try to think about it this weekend! Enjoy yours too!! Smiley Wink

0 Kudos
Message 13 of 14
(375 Views)
Solution
Accepted by topic author lacorgui

@lacorgui wrote:

I see what you say GerdW, but I do not know how to check that. In MoveNextX and MoveNextY stages I make a comparison of values between final position and actual position in order to go to the next stage, however the process is quicker than motors movement.

 

Moreover I´m using Lab 9 and I´m not able to add more stages to the state machine, sorry (maybe is fault of my lack of knowledge in Labview).

 

Anyway, I´ll try to think about it this weekend! Enjoy yours too!! Smiley Wink


I think it is probably your skill level with LabVIEW.  I haven't taken a look at your code, but your state machine is probably controlled by enum?  The only way you will be able to add new states is to add new items to the enum.  Your case structure will then know about these new states.  It's up to you to figure out how to add them to the case structure, since there are several ways, each with their own pros and cons.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 14 of 14
(370 Views)