Why does my controller program make the flywheel go slow

Hi, my team and I use VexCode V5 blocks, and our program for our controller actually make it so that the fly wheel is slowed down a whole lot, but when i try to use the velocity block, it makes it so it doesn’t even turn. Here is my program for the flywheel using a motor group:
Capture
It makes it so that the flywheel is toggled on and off by one button, but it seems to be reducing the speed of the flywheel because when we use devices:motor7, it spins how it should, but when we use the auton, motor 7 and 8, the motor spins at around 600 rpm when the rpm should be 4200 rpm, 7:1 ratio with 2 motors 600 rpm cartridge’s

The default speed for motors in vexcode isn’t at max speed, so you need to set the speed to 100% in order for it to go at 4200rpm. Also, When you were using the velocity block before, were you also using the spin block? The velocity block just tells it what speed to spin at, not to actually spin, so you need to use both.

8 Likes

I have spin Fly on there and before that I had velocity 100% and it make the flywheel not work whatsoever

Maybe its not the code but the flywheel itself, maybe try using device info (put the flywheel motor wire to port one and click device info) to see if its a problem with the motor or the physical design, hope this helps, I know how annoying flywheel problems can be

1 Like

Did you have both the spin block and the velocity block at the same time? The velocity block only tells your program the speed to spin at when it spins, not to actually spin. This is why you also need to use the spin block, because tells the motors to actually move.

i have shown my program above, and it shows the spin block, but when i use the velocity block before that, it is not spinning what so ever for some reason.

I think your code is cycling the motor when you are holding the button down.

Pseudo code
//Cycle 1
Spintime  is 0 so 
it calls the first block
turns motor on and 
sets Spintime to 1

//Cycle 2
Spintime is 1 (not 0) so
it calls the second block
turns motor off and
set Spintime to 0

Every 250 milliseconds it flips the motor from on to off then back to on. On / Off / On / Off

The Spintime variable is not latching and essentially running your motor at 1/2 speed.

Shameless plug: On/off switchable motor - #13 by Hudsonville_Robotics

4 Likes

Shouldn’t be, the code is running in an event handler, it only triggers on button press.

7 Likes

we tap it with the paddles for our controller instead of holding it down, we thought we could just add velocity to our flywheel by placing at the when start, but it ended up making the flywheel not work

Is any other code, including assigning to a button in the controller configuration, trying to control that motor ? perhaps just send me the project as a DM and I will have a look.

6 Likes

For ambiguity sake, I’m not sure if I feel depressed or it’s depressing. /s

image

So the When blocks are Pressed events which fire one time
Controller1.ButtonUp.pressed()

and the If blocks are Pressed?
if (Controller1.ButtonUp.pressing())

2 Likes

So is the issue the block that I used is the incorrect block or.?
I am also wanting to let those who read this know that I am switching to textual code, and I’m not sure how I would make a toggling program for text code (on pros or vexcode pro)

The information you provided for the fly event looks correct. You may want to share the rest of your code for further analysis.

Switching to Text
If you click on the Code Viewer button (<>) it will provide you with the text version. You will see the function onevent_Controller1ButtonRight_pressed_0 and below, inside of the main function - the start of the application - adds it to the Controller1.ButtonRight.pressed(...) event.

Note that when you write your own code you can change the long function names provided by VexCode to something simple.

2 Likes