There was this problem my team always had when programming velocity for the drivetrain motor. Here’s what I noticed.
-
No matter what the speed is, if it’s 100%, 1 RPM, 1%, etc. in the program, it will not change velocity and will always remain the same.
-
This problem specifically happens in driver control, but not 15-second autonomous.
-
There was a topic on this: Setting drive train velocity. However, this topic was closed on the 29th of November, with no actual solution.
I did what I could in the blocks program, even testing the robot on it’s side to see the difference. But what I saw was no differentiation.
For those who require it, this is the code:
Are there any solutions?
Most of the time the issue is trying to mix drivetrain assigned to the controller in the graphical setup conflicting with code. My advise is to use code as everything is then completely under your control.
6 Likes
I did not understand what you have said. What do you mean by that?
If you have created a drivetrain and controller using graphical configuration.
and then assign the drivetrain to the controller
VEXcode will generate code that directly controls the drivetrain for you, it will send controller values to the drivetrain, you really have no control of the maximum velocity in that case.
5 Likes
Last year the team I coach configured a 4-motor drivetrain in a tank driving configuration using the graphical configuration and Blocks code. With this configuration they were able to adjust the drivetrain velocity in their 15-second autonomous and their autonomous skills without any issue. This year the team configured a 2-motor drivetrain in a tank driving configuration using the graphical configuration. When they try to adjust the drivetrain velocity in Blocks code using the “set drive velocity to X%” in the When Started event for their 15-second autonomous and autonomous skills, they’ve discovered the velocity doesn’t appear to change. Based on this thread, is there no way to control the drive velocity when using Blocks programming? Are there any alternatives to making the jump from Blocks to Python/C++?
The team competed in a tournament this weekend and experienced an unexpected surprise. The programmers left the 15-second autonomous code set to 10% drivetrain velocity because the command never changed the robot velocity when manually running the autonomous program. To their surprise, the robot drove at 10% velocity in the autonomous period of their first match. Is it expected behavior that the robot would ignore this command in tests initiated from the controller, but it would follow the command when the controller is connected to the field?
I did a quick test here, using set drive velocity at beginning of the autonomou code worked correctly when started from field control and also timed run on the controller. Perhaps send me the project at some point and I will take a closer look at what you team is doing.
1 Like
Here is the team’s code, the configuration of the robot, and the configuration of the controller. I can send you the code directly if you want to test. The Blocks project was created from the competition template.
1 Like
Can you send the code directly to me please? That would be very helpful.