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
Jane_42
Member
06-11-202409:37 AM
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- 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 14
(268 Views)
Reply
Re: Trouble with motor control
NIquist
Trusted Enthusiast
06-11-202410:17 AM
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- 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
0Kudos
Message 2 of 14
(247 Views)
Reply
Re: Trouble with motor control
NIquist
Trusted Enthusiast
06-11-202410:20 AM
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- 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
0Kudos
Message 3 of 14
(246 Views)
Reply
Re: Trouble with motor control
Jane_42
Member
Author
06-11-202410:39 AM
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- 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
0Kudos
Message 4 of 14
(236 Views)
Reply
Re: Trouble with motor control
Jane_42
Member
Author
06-11-202410:44 AM
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- 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 14
(231 Views)
Reply
Re: Trouble with motor control
Bob_Schor
Knight of NI
06-11-202403:56 PM
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- 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:
- Open your version of LabVIEW (which I assume is LabVIEW 2024).
- Now open your VI (LabVIEW code) so that you can see its Front Panel and Block Diagram.
- 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 14
(189 Views)
Reply
Re: Trouble with motor control
Jane_42
Member
Author
06-12-202410:37 AM
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- 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:
LAB 3.vi 57 KB
0Kudos
Message 7 of 14
(153 Views)
Reply
Re: Trouble with motor control
Kyle97330
Trusted Enthusiast
06-12-202402:03 PM
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- 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:
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 14
(137 Views)
Reply
Re: Trouble with motor control
NIquist
Trusted Enthusiast
06-12-202402:38 PM
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- 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...
LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0Kudos
Message 9 of 14
(125 Views)
Reply
Re: Trouble with motor control
NIquist
Trusted Enthusiast
06-12-202402:52 PM
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- 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.
LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0Kudos
Message 10 of 14
(122 Views)
Reply
- «Previous
- 1
- 2
- Next»
- All Forum Topics
- Previous Topic
- Next Topic