Trouble with motor control (2024)

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Search instead for

Did you mean:

Topic Options

  • Subscribe to RSS Feed
  • Mark Topic as New
  • Mark Topic as Read
  • Float this Topic for Current User
  • Bookmark
  • Subscribe
  • Mute
  • Printer Friendly Page
  • All Forum Topics
  • Previous Topic
  • Next Topic
  • «Previous
    • 1
    • 2
  • Next»

Trouble with motor control

Trouble with motor control

Trouble with motor control (1)

Trouble with motor control (2)Jane_42

Member

‎06-11-202409:37 AM

Options

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Report to a Moderator

Hello, I am a first time LabVIEW user and barely started this week. I been having issue creating this code for a motor. The motor must spin clockwise and counterclockwise. The issue I been having is the question presented, " if the user were to change the voltage, (from counterclockwise to clockwise or vise versa) would the motor crash as the sudden change of voltage would be too fast for the motor?" My task has been to make a program that will cause the motor to go clockwise and countrclockwise, ( my teammate suggest we should decrease the voltage by 0.5 to change into the different speed?) and to also time how fast the motor can generate one rotation around the field we are placing it in.

Attached to the bottom is a code given to us, the first code is not the best as we do not need half of the code for the motor. And the second code is what I have been working on.

Test1 - OELab-1.vi ‏47 KB

Test 2 - OELab.vi ‏52 KB

Download All

0Kudos

Message 1 of 13

(202 Views)

Reply

Re: Trouble with motor control

Trouble with motor control (3)

Trouble with motor control (4)NIquist

Trusted Enthusiast

‎06-11-202410:17 AM

Options

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Report to a Moderator

A hint for getting much more help is to back save your VI for older LabVIEW versions since very few of us have 2024 installed.

File > Save for Previous Version... Choose 18.0.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{

0Kudos

Message 2 of 13

(181 Views)

Reply

Re: Trouble with motor control

Trouble with motor control (5)

Trouble with motor control (6)NIquist

Trusted Enthusiast

‎06-11-202410:20 AM

Options

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Report to a Moderator

One more thing. It's always a good idea to tell us what hardware you are using.

If it's a DAQ card or other external hardware, tell us the model and how it's wired up. A simple diagram always helps.😉

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{

0Kudos

Message 3 of 13

(180 Views)

Reply

Re: Trouble with motor control

Trouble with motor control (7)

Trouble with motor control (8)Jane_42

Member

Author

‎06-11-202410:39 AM

Options

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Report to a Moderator

Hello NIquist, thank you so much for your feed back and from my understanding I am using a DAQ by national Instruments, that I found in the lab I am currently at. I will send photos, and I hope it will help. Please let me know if it doesn't I can also try to figure it out further with the person who may have purchased it.

USB-6346

Item details
Supported Power Input: -
Maximum Number of Single-Ended Analog Input Channels: 0
Analog Input Resolution: 16 bits
Maximum Sample Rate: 500 kS/s/ch
Number of Analog Output Channels: 2
Maximum Update Rate: 900 kS/s
Bus Connector: USB 2.0
Number of Counters/Timers: 4
Number of Bidirectional Digital Channels: 24
Analog Input FIFO Buffer Size: 4095 samples
Maximum Number of Differential Analog Input Channels: 8
Simultaneous Sampling: Yes
Analog Input Absolute Accuracy: 3225 μV
Analog Input Isolation: -
Enclosed: Yes

and its connected to a Electro-Craft Max-100 115V PWM SERVO DRIVE P/N 9078-0121 B

Trouble with motor control (9)

Trouble with motor control (10)

0Kudos

Message 4 of 13

(170 Views)

Reply

Re: Trouble with motor control

Trouble with motor control (11)

Trouble with motor control (12)Jane_42

Member

Author

‎06-11-202410:44 AM

Options

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Report to a Moderator

I am so sorry, the LabVIEW software I am currently using is provided in the lab I am currently working at. But I will take this into consideration as well, and may as a friend if I can use their older LabVIEW software to reprogram 🙂

0Kudos

Message 5 of 13

(165 Views)

Reply

Re: Trouble with motor control

Trouble with motor control (13)

Trouble with motor control (14)Bob_SchorTrouble with motor control (15)

Knight of NI

‎06-11-202403:56 PM

Options

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Report to a Moderator

You don't have to "use other software" to save your LabVIEW 2024 code in a "previous version". Here's how to do this:

  1. Open your version of LabVIEW (which I assume is LabVIEW 2024).
  2. Now open your VI (LabVIEW code) so that you can see its Front Panel and Block Diagram.
  3. Go to the "File" menu (near the upper right corner) and choose "Save for Previous Version". It will offer you a choice of Versions -- I believe 2018 was suggested.

LabVIEW has a "version" problem. In a text language, like C++, Python, or Matlab, the code is in a "speaking" language (often English, French, or Chinese). LabVIEW, however, is "written in Pictures", and the "Pictures" contain the code in mysterious ways. LabVIEW 2024 "knows" how LabVIEW 2018 "encoded this picture" (because it can "see how it was done 6 years ago"), but LabVIEW 2018 cannot read LabVIEW 2024 code because it (unfortunately) cannot (yet) "predict how NI will encode it six yearslater".

Bob Schor

0Kudos

Message 6 of 13

(123 Views)

Reply

Re: Trouble with motor control

Trouble with motor control (16)

Trouble with motor control (17)Jane_42

Member

Author

‎06-12-202410:37 AM

Options

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Report to a Moderator

Thank you so much for the input! I will attached the new file below, I been working on it and made some improvements but I am a bit uncertain of it still :,)

I also ran into the issue of an error that mentions:

Trouble with motor control (18)

LAB 3.vi ‏57 KB

0Kudos

Message 7 of 13

(87 Views)

Reply

Re: Trouble with motor control

Trouble with motor control (19)

Trouble with motor control (20)Kyle97330

Trusted Enthusiast

‎06-12-202402:03 PM

Options

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Report to a Moderator
@Jane_42wrote:

Thank you so much for the input! I will attached the new file below, I been working on it and made some improvements but I am a bit uncertain of it still :,)

I also ran into the issue of an error that mentions:

Trouble with motor control (21)

This message is saying that you are trying to do something with a serial port but you didn't give it a usable serial port reference. It could be that you only have COM1 and COM2 on your PC and you are telling it to initialize COM3, or it could be that you're passing it a blank reference or some other unusable string that isn't a COM or ASRL reference at all.

1Kudo

Message 8 of 13

(71 Views)

Reply

Re: Trouble with motor control

Trouble with motor control (22)

Trouble with motor control (23)NIquist

Trusted Enthusiast

‎06-12-202402:38 PM

Options

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Report to a Moderator

Kyle97330 is correct. I can run your code fine with my USB DAQ, but I don't have an Arduino connected or your hardware, so I only see the motor speed voltage change.

If I change my COM port from COM1 (which I have), to COM2 (which I don't have), I get the exact same error you posted.

Are you using a USB to Serial converter perhaps? Maybe you need to install drivers?

You can check your COM ports with NI-MAX under Devices and Interfaces. Make sure it's working before you run your VI...

Trouble with motor control (24)

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{

0Kudos

Message 9 of 13

(59 Views)

Reply

Re: Trouble with motor control

Trouble with motor control (25)

Trouble with motor control (26)NIquist

Trusted Enthusiast

‎06-12-202402:52 PM

Options

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Report to a Moderator

A little hint. When you want to select options like CW, CCW, STOP, etc. that should only run one at a time, use an ENUM control with a case structure. This code does the same thing as all your buttons and local variables😝 and you can't choose two commands at once. You can also use the radio button control if you prefer buttons.

Trouble with motor control (27)

Trouble with motor control (28)

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{

0Kudos

Message 10 of 13

(56 Views)

Reply

  • «Previous
    • 1
    • 2
  • Next»
  • All Forum Topics
  • Previous Topic
  • Next Topic
Trouble with motor control (2024)
Top Articles
Latest Posts
Article information

Author: Allyn Kozey

Last Updated:

Views: 6322

Rating: 4.2 / 5 (43 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Allyn Kozey

Birthday: 1993-12-21

Address: Suite 454 40343 Larson Union, Port Melia, TX 16164

Phone: +2456904400762

Job: Investor Administrator

Hobby: Sketching, Puzzles, Pet, Mountaineering, Skydiving, Dowsing, Sports

Introduction: My name is Allyn Kozey, I am a outstanding, colorful, adventurous, encouraging, zealous, tender, helpful person who loves writing and wants to share my knowledge and understanding with you.