I used to have a 4 motor flywheel running straight to the cortex with no y splitters now i have 2 y splitters going into the cortex i do not use a power expander does this affect my fltywheel speed because i have been having problems hitting the net now becuase not enough power also i am using ports 1 and 10 and they only run in 1 direction i dont know why
You are drawing more current from a limited amount of voltage. So, the power of your motors is going to decrease. Use a power expander. How do you have y-splitters on ports 1 and 10…?
I do not have y splitters on ports 1 and 10
also i dont have a power expander so i am just using the 4 ports with out y splitters and using ports 1 and 10
it would be easier if you use the power expander and you don’t have to do additional programming.
like I said I do not have a power expander so that is not a option but i do have one being shipped to me but it will not get to me before my next competition
all i need to know right now is why my 1 and 10 ports are only running backwards or forewards depending on weather i reverse them in my program
If you reverse them in the code and they run the other way, then there is no issue with the ports themselves or the motors, so its a code issue. Can you post relevant code?
yep
#pragma config(Sensor, dgtl1, touch, sensorTouch)
#pragma config(Motor, port1, intake, tmotorVex393HighSpeed_HBridge, openLoop, reversed)
#pragma config(Motor, port2, d1, tmotorVex393HighSpeed_MC29, openLoop)
#pragma config(Motor, port3, d2, tmotorVex393HighSpeed_MC29, openLoop)
#pragma config(Motor, port4, d3, tmotorVex393HighSpeed_MC29, openLoop)
#pragma config(Motor, port5, d4, tmotorVex393HighSpeed_MC29, openLoop)
#pragma config(Motor, port6, fly1, tmotorVex393HighSpeed_MC29, openLoop, reversed)
#pragma config(Motor, port7, fly2, tmotorVex393HighSpeed_MC29, openLoop, reversed)
#pragma config(Motor, port8, fly3, tmotorVex393HighSpeed_MC29, openLoop)
#pragma config(Motor, port9, fly4, tmotorVex393HighSpeed_MC29, openLoop)
#pragma config(Motor, port10, intake2, tmotorVex393HighSpeed_HBridge, openLoop, reversed)
//!!Code automatically generated by ‘ROBOTC’ configuration wizard !!//
#pragma platform(VEX)
//Competition Control and Duration Settings
#pragma competitionControl(Competition)
#pragma autonomousDuration(20)
#pragma userControlDuration(120)
#include “Vex_Competition_Includes.c” //Main competition background code…do not modify!
int distance;
/////////////////////////////////////////////////////////////////////////////////////////
//
// Pre-Autonomous Functions
//
// You may want to perform some actions before the competition starts. Do them in the
// following function.
//
/////////////////////////////////////////////////////////////////////////////////////////
void pre_auton()
{
// Set bStopTasksBetweenModes to false if you want to keep user created tasks running between
// Autonomous and Tele-Op modes. You will need to manage all user created tasks if set to false.
bStopTasksBetweenModes = true;
// All activities that occur before the competition starts
// Example: clearing encoders, setting servo positions, ...
}
/////////////////////////////////////////////////////////////////////////////////////////
//
// Autonomous Task
//
// This task is used to control your robot during the autonomous phase of a VEX Competition.
// You must modify the code to add your own robot specific commands here.
//
/////////////////////////////////////////////////////////////////////////////////////////
task autonomous()
{
// …
// Insert user code here.
// …
distance = 0;
while(SensorValue(touch) == 0){
sleep(5000);
motor[fly1] = 110;
motor[fly2] = 110;
motor[fly3] = 110;
motor[fly4] = 110;
motor[d1] = -100;
motor[d2] = -100;
motor[d3] = -100;
motor[d4] = -100;
distance = distance + 1;
}
motor[d1] = -100;
motor[d2] = -100;
motor[d3] = -100;
motor[d3] = -100;
wait1Msec(300);
distance = distance / 2;
motor[d1] = 0;
motor[d2] = 0;
motor[d3] = 0;
motor[d4] = 0;
wait1Msec(300);
motor[intake] = 50;
motor[intake2] = 50;
motor[fly1] = 127;
motor[fly2] = 127;
motor[fly3] = 127;
motor[fly4] = 127;
wait1Msec(5000);
motor[fly1] = 0;
motor[fly2] = 0;
motor[fly3] = 0;
motor[fly4] = 0;
motor[intake] = 0;
motor[intake2] = 0;
while (distance > 0)
{
motor[d1] = 100;
motor[d2] = 100;
motor[d3] = 100;
motor[d4] = 100;
distance = distance - 1;
}
motor[d1] = 0;
motor[d2] = 0;
motor[d3] = 0;
motor[d4] = 0;
}
/////////////////////////////////////////////////////////////////////////////////////////
//
// User Control Task
//
// This task is used to control your robot during the user control phase of a VEX Competition.
// You must modify the code to add your own robot specific commands here.
//
/////////////////////////////////////////////////////////////////////////////////////////
task usercontrol()
{
// User control code here, inside the loop
while (true)
{
// This is the main execution loop for the user control program. Each time through the loop
// your program should update motor + servo values based on feedback from the joysticks.
// .....................................................................................
// Insert user code here. This is where you use the joystick values to update your motors, etc.
// .....................................................................................
//Right side of the robot is controlled by the right joystick, Y-axis
motor[d1] = vexRT[Ch2];
motor[d3] = vexRT[Ch2];
//Left side of the robot is controlled by the left joystick, Y-axis
motor[d2] = vexRT[Ch3];
motor[d4] = vexRT[Ch3];
if(vexRT[Btn6U] == 1)
{
motor[fly1] = 127;
motor[fly2] = 127;
motor[fly3] = 127;
motor[fly4] = 127;
}
if(vexRT[Btn6U] == 0)
{
motor[fly1] = 0;
motor[fly2] = 0;
motor[fly3] = 0;
motor[fly4] = 0;
}
if(vexRT[Btn5U] == 1)
{
motor[intake] = 127;
motor[intake2] = 127;
}
if(vexRT[Btn5U] == 0)
{
motor[intake] = 0;
motor[intake2] = 0;
}
if(vexRT[Btn5D] == 1)
{
motor[intake] = -127;
motor[intake2] = -127;
}
}
}
Try replacing your intake code here with something a little more streamlined:
motor[intake] = (vexRT[Btn5U] - vexRT[Btn6U]) * 127;
motor[intake2] = (vexRT[Btn5U] - vexRT[Btn6U]) * 127;
You can do something similar for your flywheel code if you’d like to shorten that as well.
The problem your having might be that while your not pressing Btn5u, the program will always set the motor value to 0. This will happen even when Btn5d is pressed. Try putting your last if statement in side the one that sets motors to 0 and then 0 the motors in a else statement after.
if(vexRT[Btn5U] == 0)
{
if(vexRT[Btn5D] == 1)
{
motor[intake] = -127;
motor[intake2] = -127;
}else{
motor[intake] = 0;
motor[intake2] = 0;
}
}
Something like that.
If you do not have a motor controller on your motor, then you cannot control speed of the motor. Since motor ports 1 and 10 are 2 wire ports, you cannot plug motor controllers in, therefore you cannot control direction or speed
Thats not true the motor controller for ports 1 and 10 are just built into the actual cortex.
Never mind then
we have run into this problem before. Port ten starts to slow down in one direction then stops completely. the other direction then starts to drop out. then we loose port one all together. Its got to be something with the H bridge overheating