|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: Scaling motor speed in LabVIEW
So what I'm asking is when I'm not pressing we'll say button A, the motors aren't spinning. However, when I press A, the motors will slowl speed up until they reach their max RPM possible and will sustain the max speed until I release the button.
|
|
#2
|
||||
|
||||
|
Re: Scaling motor speed in LabVIEW
Quote:
Code:
if (buttonIsNotPressed) {cmd=0; setMotor(cmd)}
else {cmd+=epsilon; if (cmd>1) cmd=1; setMotor(cmd)}
|
|
#3
|
|||
|
|||
|
Re: Scaling motor speed in LabVIEW
The attached image shows how to do it using a feedback node.
A feedback node is a very local variable that keeps the value from the last iteration. This allows execution N be based on the values of execution N-1. Replace the button with the one you want to read, replace the 0.1 with the delta you want to add, and don't forget to connect the refnum to the joystick and motor VIs. Ask questions if some portion of it doesn't make sense. Greg McKaskle |
|
#4
|
||||
|
||||
|
Re: Scaling motor speed in LabVIEW
Ah, there is always an easier way!
|
|
#5
|
|||
|
|||
|
Re: Scaling motor speed in LabVIEW
When you say this, what exactly do you mean? Sort've a noob at LabVIEW still, but I understand some of it. When you say connect the refnum to the joystick and motor VIs, do you mean connect the button portion with the current joystick running our drive motors?
|
|
#6
|
|||
|
|||
|
Re: Scaling motor speed in LabVIEW
Quote:
The refnum is created by the Open block and can be stored and retrieved by name. Take a look at Begin to see some being opened and saved, and Teleop to see them being retrieved and used for RobotDrive and Joystick. Greg McKaskle |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|