LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ssue with Tetrix Robot - MyRIO Programming

Hello,

I have a Tetrix robot that I am programming using MyRIO. When I power up the card and motor driver, only the left motor remains active. However, when I upload my code, it runs smoothly and as expected. The problem arises when I exit the execution, as the left motor restarts unexpectedly.

Could you please assist me in troubleshooting and resolving this issue?

Thank you.

 

0 Kudos
Message 1 of 4
(230 Views)
  • You mention "the card and motor driver".  What Card?  What "motor driver"?
  • What version of LabVIEW are you running?  I'm guessing LabVIEW 2019 or 2021, as I know these have myRIO Software Toolkits available.
  • Please attach the complete LabVIEW Project that you are using.  It appears you have a "shutdown" problem lurking in your code -- it's tricky enough finding these subtle bugs when you have both the code and working hardware on which to debug the software (looking for what loops are hanging).

Bob Schor

 

0 Kudos
Message 2 of 4
(185 Views)

I use labview 2021 and driver of motor I use myRIO Motor Controller Board 41136

0 Kudos
Message 3 of 4
(157 Views)

Well, the Good News is I have experience with the myRIO, and I also have experience with running Stepper Motors using LabVIEW (I'm working on a Project now with a small NEMA stepper and the A4988 Controller Chip, driven quite nicely by an NI USB-6212).

 

I also see you are using what should be a "workable" LabVIEW configuration, namely LabVIEW 2021 + myRIO Software Toolkit 2021.  [I'm currently running my myRIO with the 2019 versions, but I am planning to migrate to LabVIEW 2021, and have a myRIO "ready to go" with the updated firmware and myRIO Software Toolkit).

 

So it should be a relatively simple procedure to look through your Project, find the concurrent Parallel Loops (many of my Projects have at least 3-5, both in the Host (PC) and Target (myRIO) parts of the Project).

 

You need to look at your code on the Target (myRIO) side, looking for where you control the two motors.  Ask yourself what you expect (or "want") your code to do when you push the "Stop" button on your Front Panel.  In my Stepper Motor code (first paragraph, above), I have three parallel loops running -- an Event Loop, a Channel State Machine Loop, and a Stepper (Channel) State Machine Loop.  The Stop button is "captured" by the Event Loop, sends an "Exit Main" and "Exit Stepper" message to the two State Machines, then stops the Event Loop (by wiring "True" to the Boolean Stop of the While Loop).  The respective "Exit" States in the two Channel Message Handler loops similarly wire "True" to the Boolean Stop.  When all three stop, the program exits.

 

You need to figure out why your code isn't stopping.  Since the Target (myRIO) code doesn't have a real "Front Panel", you need to send a "Stop" message from the Host to the Target.  I use Network Streams for this, as I've found Network Shared Variables unreliable.

 

Can you get the Host code, at least, to stop?

 

Bob Schor

0 Kudos
Message 4 of 4
(145 Views)