Forebars

Ok we need a little help… a lot actually so we have a comp tomorrow and our forebers aren’t functioning. They go down but not up. the moters can hold it up because our anti gav is in effect. Basically everything works except for lifting. We have a simple build fo it. we have 4 motors 2 red 2 green each with a piece of metal attached then they are all linked up correctly. If anyone can help please do this is urgent. our code looks like this/----------------------------------------------------------------------------/
/* /
/
Module: main.cpp /
/
Author: VEX /
/
Created: Thu Sep 26 2019 /
/
Description: Competition Template /
/
/
/
----------------------------------------------------------------------------*/

// ---- START VEXCODE CONFIGURED DEVICES ----
// Robot Configuration:
// [Name] [Type] [Port(s)]
// Controller1 controller
// TopRightForebar motor 12
// TopLeftForebar motor 11
// RightMotor motor 13
// LeftMotor motor 16
// RightForebar motor 14
// LeftForebar motor 15
// RightFlip motor 19
// LeftFlip motor 18
// ---- END VEXCODE CONFIGURED DEVICES ----

#include “vex.h”

using namespace vex;

competition Competition;

// define your global instances of motors and other devices here

void StopForebars(){
TopLeftForebar.stop();
TopRightForebar.stop();
LeftForebar.stop();
RightForebar.stop();
}
void pre_auton(void) {
vexcodeInit();
// All activities that occur before the competition starts
}
void StopUArm(){
RightForebar.stop();
LeftForebar.stop();
}

//auton code:
void autonomous(void) {
LeftFlip.spinFor(reverse, 2, turns, false);
RightFlip.spinFor(reverse, 2, turns, false);//turning out the bars
RightMotor.setVelocity(100, percent);
LeftMotor.setVelocity(100, percent);//making motors go fast
RightMotor.spinFor(forward, 3.3, turns, false);
LeftMotor.spinFor(forward, 3.3, turns);//going forward
LeftFlip.spinFor(forward, 1, turns, false);
RightFlip.spinFor(forward, 1, turns);//turning the goal up
RightMotor.spinFor(reverse, 2.8, turns, false);
LeftMotor.spinFor(reverse, 2.8, turns);//moving backwards
RightMotor.spinFor(forward, 180, degrees);
LeftFlip.spinFor(reverse, 2, turns, false);
RightFlip.spinFor(reverse, 2, turns);//dropping the goal
RightMotor.spinFor(reverse, 0.3, turns, false);
LeftMotor.spinFor(reverse, 0.3, turns);//go backwards
LeftMotor.spinFor(reverse, 110, degrees);//turn to get middle goal
RightMotor.spinFor(forward, 4, turns, false);
LeftMotor.spinFor(forward, 4, turns);//going forward
LeftFlip.spinFor(forward, 1, turns, false);
RightFlip.spinFor(forward, 1, turns);//turning the goal up
RightMotor.spinFor(reverse, 2.8, turns, false);
LeftMotor.spinFor(reverse, 70, degrees);
RightMotor.spinFor(forward, 1, turns, false);
LeftMotor.spinFor(forward, 1, turns, false);//moving towards the seesaw
LeftFlip.spinFor(reverse, 1, turns, false);
RightFlip.spinFor(reverse, 1, turns);//turning the goal down
}

//driver code:
void usercontrol(void) {
TopRightForebar.setVelocity(100, percent);
TopLeftForebar.setVelocity(100, percent);
RightForebar.setVelocity(100, percent);
LeftForebar.setVelocity(100, percent);
float ForwardDirection = Controller1.Axis3.value();
float SidewaysDirection = Controller1.Axis4.value();
bool moving = false;

while(1) {
ForwardDirection = Controller1.Axis3.value();
SidewaysDirection = Controller1.Axis4.value();
moving = false;

while (Controller1.ButtonL1.pressing()){
  TopRightForebar.spin(forward);
  TopLeftForebar.spin(forward);
  RightForebar.spin(forward);
  LeftForebar.spin(forward);
  moving = true;

}
while (Controller1.ButtonL2.pressing()){
  TopRightForebar.spin(reverse);
  TopLeftForebar.spin(reverse);
  RightForebar.spin(reverse);
  LeftForebar.spin(reverse);
  moving = true;
} 

while (moving == false) {
  TopRightForebar.spin(forward, 10, percent);
  TopLeftForebar.spin(forward, 10, percent);
  RightForebar.spin(forward, 10, percent);
  LeftForebar.spin(forward, 10, percent);
}

if (Controller1.ButtonUp.pressing()){
  RightFlip.setVelocity(100, percent);
  LeftFlip.setVelocity(100, percent);
  RightFlip.spin(forward);
  LeftFlip.spin(forward);
} else if (Controller1.ButtonDown.pressing()){
 RightFlip.spin(reverse);
 LeftFlip.spin(reverse);
} else{
  RightFlip.spin(forward, 1, percent);
  LeftFlip.spin(forward, 1, percent);
}
LeftMotor.spin(directionType::fwd, ForwardDirection + SidewaysDirection, percent);
RightMotor.spin(directionType::fwd, ForwardDirection-SidewaysDirection, percent);
}

}

int main(){
Competition.autonomous(autonomous);
Competition.drivercontrol(usercontrol);
pre_auton();
while (true) {
wait(100, msec);
}
}

1 Like

Why on earth are you using 4 motors for a four bar? And why are they different speeds? No wonder why it’s not working. Are you powering each joint individually or something? Four bars only have 1 DOF. You would be greatly overconstraining the mechanism if you were. Please send pics

15 Likes

also your code has some major issues.

instead of using while loops to control the lift, you should use if statements.

if (Controller1.ButtonL1.pressing()){
    //spin lift up
}
else if (Controller1.ButtonL2.pressing()){
    //spin lift down
}
else {
   //stop lift
}

and instead of moving your motors up slowly to counter the lift from sinking when not powered, you can set the braketype of the motors to hold, which makes them actively work to maintain their current position.
you can do this like so:
motor.setStopping(hold);
This means that whenever your lift motors stop moving, they will hold the lift in place.

But as @Ethan5956F pointed out, it sounds like you have very severe mechanical problems with the lift that mean it’s very possible it won’t work regardless of how functional the code is.

12 Likes

forebar

19 Likes

Hi, we are 6199E’s sister team here is a picture of their robot:

3 Likes

It is so much worse than I imagined.

24 Likes

This is very unlucky. I would recommend rebuilding and looking at some resources for how to build a fourbar. Maybe look up some reveals from other teams this season. Hope this helps.

1 Like

Simply bad luck.

3 Likes

given you have a competition tomorrow, I am not sure how many hours you can spend rebuilding your robot today.

remove four motors from your lift/arms. Keep two red motors and connect to drive the green gears in your picture.

BTW do you use bearing flat?

Here is Xenon27’s code with more detail. Do not forget to reverse one of the motors.

if (Controller1.ButtonL1.pressing()){
    TopRightForebar.spin(forward,100,pct);
    TopLeftForebar.spin(forward,100,pct);
 //spin lift up
}
else if (Controller1.ButtonL2.pressing()){
    TopRightForebar.spin(backward,100,pct);
    TopLeftForebar.spin(backward,100,pct);
 //spin lift down
}
else {
   TopRightForebar.stop(hold);
    TopLeftForebar.stop(hold);
//stop lift
}
4 Likes

i’m not completely sure if you should even be using that 4 bar for a comp because it might damage the motors (different speeds). And you can’t really get any more motors.

Good luck at comp

1 Like

Did you use tri banding, that might help

That lift simply will not work in its current state.

these might be helpful in understanding why:

Your main problem point is the fact that you are using 4 motors with different speeds in an attempt to direct drive a lift. The motors on their own have way too much speed and not nearly enough torque to power something like a lift, you need to use gear ratios to increase that torque at the expense of speed. A good place to start would be to power 12 tooth gears using red motors, which turn 84 tooth gears on the arm. This will get you a 12:84 (1:7 simplified) gear ratio, meaning that for every rotation of the motor, your arm will rotate only 1/7 as far, but with 7 times the strength.

it is also important to note that you should never be forcing two motors of different speeds to run at the same mechanically, this can be damaging to the motors and will be largely ineffective at solving any problems.

10 Likes

Sad to see that you are ready to share images of your sister team’s robot freely, but not offer solutions to make it better …

1 Like

to be fair they might not have any solutions to offer.

9 Likes


what purpose could these rubber bands possibly serve

4 Likes

and it would have be better if they said so.

Agreed I may be jumping the gun as both teams are relatively new to forum…

From a structural point of view - it may be good to watch and understand how 4-bar and 6-bar lifts work:

4 Likes

plucking them could make a pleasant banjo-like sound.

13 Likes

I would not think too much into the quirks of this robot given the more pressing issues. It’s clear that this team is inexperienced and still learning, and that’s good. Let them learn that rubber bands are not good lift braces the hard way.

5 Likes

Although I have found rubber bands to be the solution to a good % of problems…

As a person that TOTALLY would have done this unironically 2 years ago, I think that a good thing to do is ask around. If you have experienced friends, ask them. Otherwise, you can ask your mentor, or even the VRC server (there are helpful things on there sometimes, believe it or not). I got lucky, I had a good coach to guide me through my rookie year without too much trouble. You can also ask me (although I’m not the best source of information), I’d be happy to answer if I can. In the future of course.

In terms of this post, pretty much all I can say is what the others said, having 4 motors for a 4-bar is too excessive, and as @Xenon27 mentioned, this could damage your robot with the different speeds of motors. I would suggest a 2 motor or even 1 motor lift, with 100rpm (that’s the red one) driving the 12-tooth gear and having it connected to a 60-tooth or 84-tooth gear which would then connect to your arm. You could save two motors for other important things, such as a conveyor belt or a back tilter.

5 Likes