|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Servo back and forth
Basically what I want my servo to do is start from 0 degree position, and when I press button one, I want it to travel the full 180 degrees but when I let go of the button I want it to return to its original position, here's so code I wrote down, I am an extremely rookie player so I barely have any knowledge on what to do but I gave it try. I'm currently using the HS-322HD servo.
![]() |
|
#2
|
||||
|
||||
|
Re: Servo back and forth
The -1 and 1 constants basically mean the motor is going in full reverse or full forward. I suggest adding something such as a wait command and time how long it takes to go that far. I'm not a guru when it comes to Labview but all you are doing right there is taking the maximum and increasing it by 85. I can probably take a screen shot tomorrow when I get in if you need an example.
|
|
#3
|
||||
|
||||
|
Re: Servo back and forth
It's pretty simple actually. You just use that triangular chooser and choose between 0 and 170 (which I believe is that max angle of the servos, not 180, but I could be wrong), then hook up that value to the Servo Set Angle. I think you just made it too complicated the way you did it, and the problem you had was you tried to perform a Boolean operation on two numbers at the bottom there.
|
|
#4
|
||||
|
||||
|
Re: Servo back and forth
Quote:
As dbeckwith said, the first problem is the boolean operator on the floating point wires. I don't know how this would work, but I'm sure it's not what you intended. From what you stated you only want to have one button to control this, so you don't need to use the OR at all (If you want to use another button to control this, you can use the OR to select either buttons). On the input of your Select use your button and the values should be 0 and your other value (I assume 180). The output of that should go directly into the Set Angle.vi. Finally calibrate your servo down position by removing the screw holding the servo horn, rotating the output gear to it's maximum down position and reinstall the servo horn and screw. |
|
#5
|
|||
|
|||
|
Re: Servo back and forth
Would anyone be willing to give me their email. I constantly have programing issues and I need someone to help me on the spot.
|
|
#6
|
||||
|
||||
|
Re: Servo back and forth
Attached is an example of what I was suggesting, using 2 joysticks. You can PM me if you still need more help.
|
|
#7
|
||||
|
||||
|
Re: Servo back and forth
The maximum travel of the Hitec HS-322HD is 270 deg, not 170.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|