Go to Post Remember that though we come from different backgrounds and x, y, z, we are all on each other's side. We want people to love STEM, and think FIRST is a great tool to fulfill that desire. - PayneTrain [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 10-01-2013, 21:18
Dillonboy8 Dillonboy8 is offline
Registered User
AKA: Dillon Knight
FRC #3603 (Reed City Cyber Coyotes)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Reed City, Michigan
Posts: 21
Dillonboy8 is an unknown quantity at this point
Motor/Speed control

Hello!

I can't seem to figure out how to make my motor speed up and/or slow down when I press a button. Could you guys maybe help me out? Thanks!
Reply With Quote
  #2   Spotlight this post!  
Unread 10-01-2013, 21:35
propionate's Avatar
propionate propionate is offline
Team co-lead and LabVIEW programmer
AKA: Stephen
FRC #1732 (Hilltopper Robotics)
 
Join Date: Jan 2012
Rookie Year: 2009
Location: Milwaukee
Posts: 93
propionate is on a distinguished road
Re: Motor/Speed control

I'm not on a computer that has labVIEW at the moment, but hopefully I can help you out. If you properly installed LabVIEW, there should be a number of example VIs that you can access. One of these VIs is a motor control example, which will allow you to change the speed of a motor using a slider on the front panel. I suggest integrating this example into your code first, and then moving into using a button.

Speaking of which, you may have some problems controlling speed with just a single button. Do you want it to simply be on or off? Do you want variable speed?
Reply With Quote
  #3   Spotlight this post!  
Unread 10-01-2013, 21:38
Dillonboy8 Dillonboy8 is offline
Registered User
AKA: Dillon Knight
FRC #3603 (Reed City Cyber Coyotes)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Reed City, Michigan
Posts: 21
Dillonboy8 is an unknown quantity at this point
Re: Motor/Speed control

I'll be sure to check that out in a sec.

No, I meant a button on the joystick.

Thanks!
Reply With Quote
  #4   Spotlight this post!  
Unread 11-01-2013, 00:41
propionate's Avatar
propionate propionate is offline
Team co-lead and LabVIEW programmer
AKA: Stephen
FRC #1732 (Hilltopper Robotics)
 
Join Date: Jan 2012
Rookie Year: 2009
Location: Milwaukee
Posts: 93
propionate is on a distinguished road
Re: Motor/Speed control

Let me know if you need any more help... hopefully I will have LabVIEW installed soon so that I can give you example code if you need it. Best of luck!
Reply With Quote
  #5   Spotlight this post!  
Unread 11-01-2013, 07:43
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Motor/Speed control

There are other threads on this, but let me give an overview.

One common approach is to have little Motor Sets all over the code inside various switch blocks testing buttons. If you are careful this will work, but often, the logic isn't quite right and the code doesn't do what you want. Basically, last update wins, and sometimes it isn't clear how the motor got to the speed it is running at.

Another approach is to do the logic and whatnot, but all the code does is to output numbers. LV will help remind you to produce numbers in all cases. Then, in only one location on your teleop diagram, you update that motor. This makes it much easier to trace the logic and debug.

Greg McKaskle
Reply With Quote
  #6   Spotlight this post!  
Unread 11-01-2013, 10:09
Timekeeper00 Timekeeper00 is offline
Registered User
FRC #1391
 
Join Date: Nov 2011
Location: PA
Posts: 14
Timekeeper00 is an unknown quantity at this point
Re: Motor/Speed control

Here is a way to do it. I'm happy to answer any questions you have about it.

-Ti00

p.s. As a word of warning, I wrote this when I was really tired, so I think the logic is right, but I make no guarantees.
Attached Files
File Type: vi Button Throttle.vi (17.8 KB, 37 views)
Reply With Quote
  #7   Spotlight this post!  
Unread 12-01-2013, 11:26
Dillonboy8 Dillonboy8 is offline
Registered User
AKA: Dillon Knight
FRC #3603 (Reed City Cyber Coyotes)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Reed City, Michigan
Posts: 21
Dillonboy8 is an unknown quantity at this point
Re: Motor/Speed control

Thanks!
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 21:49.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi