# Non-smooth flywheel

The flywheel on our robot kind of pulsates, like if I set the velocity at 80% then it will go up and down until stopping at 80 after about 5 seconds. Is there any way to fix this?

1 Like

Yes, you can fix this by using voltage instead of velocity such as: Motor.spin(voltageUnits::volts);
(That is c++, idk what coding software you are using). There is other forum topics about this if you want more information, but I would recommend 10-12 volts for shorter ranged shots (Don’t go past ~14 volts).

1 Like

Yes.
Then someone can have a look at it. The issue may be how your buttons are configured. Ours does something similar, but we have a button to set the speed fast or slow, which fixes it. Post your code and I or someone else will have a look at it.

I think the best way to solve this is to create a feedback loop in your code where you constantly get the motor’s current speed and compare it to the speed you want which gives the error value. You then adjust the speed accordingly to make the error as small as possible. This simple loop is called a proportional feedback loop. For even more precise and accurate control, you could look into a PID controller to make your flywheel speed even better. If you want more information on feedback loops in Vex, you can look here. Also instead of using velocity, use voltage to allow for greater control. Setting a velocity will instead use the motor’s feedback loop which you aren’t able to control.

1 Like

First of all welcome to the forum! This pulsation is likely due to the integrated PID that V5 motors use when you set velocity. The best fix for this is to set voltage rather then velocity. To do this in VexCode V5 pro use the following code:

``````Motor.spin(vex::directionType::fwd, 12 * 0.8, vex::voltageUnits::volt)
``````

The first parameter is specifying to move the motor forward, the second is setting the motor to move at 80% of the maximum voltage (12), and the third parameter is specifying that your unit for the second parameter is volts.

It should be something similar if you use blocks or pros.

3 Likes

Yeahhh that’s kinda what happens when you use maximum velocity because when the motor detects that it goes over, the motor stops itself/slows down to forcibly decrease the velocity.

You can use voltage instead to stop the pulsing, it would look something like this:
`flywheel.spin( forward, voltage, voltageUnits::volt );`
Voltage takes in a float between 0.0 and 12.0 so you can use it to control flywheel velocity

That is the same thing that happens to us.Is their any way that you can show us your flywheel so we can help?

sorry, i cant. I don’t have access to my robot right now.

`flywheel.spin(fwd, 80, percent)`