It seems to me that there are three key factors that affect the performance of a flywheel:
(1) the maximum possible velocity it can achieve
(2) how long does it take to accelerate to the maximum velocity
(3) how much velocity does it lose after shooting a disk
Then, how does the battery charge level affect the flywheel in these aspects? I do notice that as the battery gradually loses its power the flywheel cannot shoot as far as before even at the same target velocity, However, this does not always occur and I guess there is some threshold.
The motors run off voltage given from the battery, the lower the battery the less voltage it can give henceforth lowering the max speed of the flywheel.
I have noticed that below around 70%, the flywheel usually starts undershooting at the same voltage applied. Switching out the battery every ~6 auton runs (for us) gives consistent results. You should also make sure that you start the match with a full battery every single time.
keep in mind that there are ways to make the second and third factors less important. it would be optimal to add a second wheel for inertia to prevent slowing down after shots(not perfect but it helps) and create a P loop for your flywheel as well to help it speed up faster, and then maintain that speed. I would recommend using voltage rather than percent bc it will give more control bc pct alr has a P loop but its not very good
One drawback of adding weight to the flywheel is that it takes longer time to accelerate to the target speed, right? Currently our robot needs to wait 2s before starting to shoot.
We use RPM but not Voltage, because the Python API does not allow setting voltage directly. Although many suggest using Voltage leads to more consistent results, I tend to think that eventually we still need a target speed, not a target Voltage. Setting voltage allows bypass the internal PID process of Smart motors.
The key measurement is battery voltage rather than remaining battery capacity.
The motor firmware attempts to adjust control for a nominal 12V battery. If battery voltage is higher, which it will be for a good condition freshly charged battery, it will adjust the actual motor control output to simulate a 12V battery input. If battery voltage is below 12V, it will also attempt to compensate, however, when trying to use the maximum allowable control voltage of 12V it obviously cannot adjust beyond using 100% output.
What is the best way to accelerate to a target speed?
I see some other robot can shoot instantly while ours need to wait 2 seconds. One way I can think of is to keep the flywheel spinning even if idle. Is there a better solution?
You should be able to just keep the flywheel on the entire match (and auton) without it overheating significantly. It is more inefficient to constantly spin down and spin up the flywheel every single time you want to shoot.
When controlling the motors using percentage, the motor will use an internal control loop to achieve the requested speed. When using voltage control, you are now completely open loop, the motor will just use the voltage you request, so at very low voltage they may not move. You will need to either limit voltage to some value that keeps the motor moving or implement your own closed loop control (ie. PID etc.)
(and I though you were going to use voltage control for a flywheel, not as good an idea to use on a drivetrain)
If I set 5% power, what will the internal PID do? Target 5% of maximum RPM? I am kind of confused by RPM, Power, Voltage, Current, Watt.
I thought many teams use voltage on drivetrain as well. My impression so far is that using voltage, instead of power, in our PID, the robot drives more straightly and smoothly in an auto model.
By the way, can I have another question?
I understand that setting the voltage to 12v, a motor will spin at the maximum speed. If the voltage is set to 6v, will the speed be roughly half?
If instead the power is set to 100%, will it spin at the maximum RPM? According to the chart RPM vs Power, it is not. Then, what does 100% power exactly mean? How about 50% power?
You are not setting power when using the spin command with percentage. You are asking for a percentage of maximum rpm. For a motor with a green (200 rpm) gear cartridge, 5% would be 10 rpm.
so
m1.spin(FORWARD, 10, RPM)
and
m1.spin(FORWARD, 5, PERCENT)
would request the same motor velocity.
The motor’s firmware will adjust motor voltage to try and achieve that requested speed (in the direction requested), depending on the motor’s load, the amount of current needed will vary.
While V5 motors have a more linear voltage to speed relationship than the old 393 motors we used with cortex, I would not rely on 6V being half the speed of 12V.
power is a measurement of how much work the motor is doing (work done over time). output power is torque x angular speed. I’m not going to go into a long explanation here, plenty of resources available using google.
VEX also has more information here
Thank you for your excellent explanation! The unit PERCENT in the function set_velocity or spin is not really power but % of the MAX speed.
In another case, I would like to maximize the torque without changing the construction. How should I configure the motor? According to chart below, the maximum speed should not be set above 60% to achieve the maximum torque. Is my understanding correct? Thanks.