Is it possible?

Is there a way I can change the Follow Goal Example so that instead of a servo it uses a Motor? :frowning:

Can someone enlighten me and show me the way if it’s possible?:frowning:

That is what I have until now…

Can I assume that you have a relatively standard drive train? If so, I would suggest using the Arcade Drive VI for this task. Arcade Drive is a good way of allowing you to control rotation and speed, rather than left speed and right speed.

The Arcade Drive’s X refers to rotation - You can use what the X axis servo was.

The Arcade Drive’s Y refers to forward/back speed- You can use what the Y axis servo was, but you’ll need to massage it a bit.

I got super lost :frowning:
My camera will be attached to my canon and it will spin with a motor. So instead of attaching a servo to move in the X axis I want it to move the whole thing…The motor will move the canon and therefore the camera :slight_smile:

And I wanted to know if I can edit that code with that and know that it will work…

For the drive…I have a 4WD Arcade drive :smiley:

Yep. To elaborate on what Eric is saying, instead of opening two motors, you can probably simplify by opening a Robot Drive. Then inside the loop scale the X setting as if it were a joystick X axis (-1 to 1). Scale the Y from the servo similarly, and wire those to the Robot Drive VI to control the motors.

Greg McKaskle

Is it the same thing I did in the picture above?
Sorry, it’s not autonomous.
I just want the canon to be facing the target always. So when I shoot I won’t have to aim. I will only need to be aware of distance.

you can do this but not with the code you have
the problem is the servos are position controlled, and the motors are velocity(ish) controlled, so you need some way to turn the motor motion into position. i suggest you read up on PID loops for such a task, and attach an encoder to the motor so you know its position.

What about converting the value that goes out into speed?
V=D/T
So if I divide the value it would be acceptable…:S
I don’t really know much about PID :frowning:
I can’t attach a servo to the motor because it will be moving a big gear…How can I do this :S

The problem is that motors are controlled by speed, while servos are controlled by angle or position. You must have an encoder or some other kind of position sensor on the motor for this to work.

If you have that, you can subtract what the software thinks is the middle point (85 I think). Assuming the motor is pointing straight at the beginning, that is the setpoint for the encoder. If it’s negative, turn the motor in that direction and vice versa. Once the encoder gets close enough to the setpoint, stop turning the motor so it doesn’t oscillate.

Okay, so how do I do this exactly?
Where should I connect the encoder? Because the globe motor won’t have a transmision…
And how do I make the change in labview? :S

Hey guys… I can’t seem to fix this :frowning: