fdsa
peeka:
im using the simplified serial, baud 19200 pin 13,
dip switches are corect , 1 on , 3 on , 5 and 6 on ...the rest off
That selects 9600 baud but you seem to be sending the motor commands to a port set for 19200 baud.
now in my arduino coding , weneva i use a delay function so i can have the robot using waypoints without a gps....the delay screws up the motors some how. only 1 motor works , and its only wen i use the delay(wateva) so i run motors forward, delay, stop, then forward again..... any ideas would b good.
The code you provided doesn't do much. It sets Motor 1 and Motor 2 to slow forward:
72 = motor 1 forward 1/8th speed
200 = motor 2 forward 1/8th speed
From the code it's not clear what you intended to do.
I know there slow....i just want a delay function in there to make the robot draw a square on the grass..u know wat i mean.
thanx for that early reply aswell.
Forward both motors then delay 5seconds
then turn left for 5 seconds .forward...left....etc
peeka:
I know there slow....i just want a delay function in there to make the robot draw a square on the grass..u know wat i mean.
So something like:
const speed = 8; // Move at 8/64ths speed
Forward(speed); // Both motors forward
delay(5000);
TurnRight(90); // Left motor forward and right motor reverse long enough to turn 90 degrees
Forward(speed);
Delay(5000);
TurnRight(90);
Forward(speed);
Delay(5000);
TurnRight(90);
Forward(speed);
Delay(5000);
Stop(); // Turn both motors off.
Thats exactly what i want.but the problem is weneva i use the delay function only one motor works ...its like it causes a problem ciz it wont continue.at the forward only 1 motor works then just hangs there
f
fdsafdsafsad
Does the red LED on the Sabertooth ever blink, indicating an error?
hi what the softwareserial.h inferring.
May I know if it is possible using arduino 2560 with sabertooth to control the robot from one point to another point with turn and some obstacles like object avoidance , I intend to interface it with Ping ultrasonic sensor.
Currently using mega 2560.
The red led doesnt blink on the saber...johnwasser
ronn0011 im not sure about the mega 2560 , it could b different coding i just have the arduino uno. i imagine its probably the same. just make sure u use the same pins , 3 - pwm - to s1, and gnd to gnd and positive to positive , my coding will probably not work with urs but cant hurt to try.
Hi are you referring that the connection using PWM or TX 1 of the Arduino Board ? ,
And by the way, whats the softwareserial.h referring to. I am keen to know your sharing, cool, that u re using wheelchair motor, what kind of motion path, have you tried, I am looking to control the turning left and right as currently the program i get is only allow me to go straight and still understanding some of the program I willl post the program here
peeka:
// Labels for use with the Sabertooth 2x25 motor controller// Set to 9600 through Sabertooth dip switches
#define SABER_BAUDRATE 9600// Simplified serial Limits for each motor
#define SABER_MOTOR1_FULL_FORWARD 127
#define SABER_MOTOR1_FULL_REVERSE 1#define SABER_MOTOR2_FULL_FORWARD 255
#define SABER_MOTOR2_FULL_REVERSE 128// Motor level to send when issuing the full stop command
#define SABER_ALL_STOP 0#define SaberSerial Serial1
void initSabertooth( void )
{
SaberSerial.begin( SABER_BAUDRATE );// 2 second time delay for the Sabertooth to init
delay( 2000 );// Send full stop command
setEngineSpeed( SABER_ALL_STOP );
}
/*****************************************************
- setEngineSpeed
- Inputs - cSpeed_Motor1 - Input a percentage of full
- speed, from -100 to +100
*****************************************************/
void setEngineSpeed( signed char cNewMotorSpeed )
{
unsigned char cSpeedVal_Motor1 = 0;unsigned char cSpeedVal_Motor2 = 0;
// Check for full stop command
if( cNewMotorSpeed == 0 )
{
// Send full stop command for both motors
SaberSerial.print( 0, BYTE );return;
}// Calculate the speed value for motor 1
if( cNewMotorSpeed >= 100 )
{
cSpeedVal_Motor1 = SABER_MOTOR1_FULL_FORWARD;cSpeedVal_Motor2 = SABER_MOTOR2_FULL_FORWARD;
}
else if( cNewMotorSpeed <= -100 )
{
cSpeedVal_Motor1 = SABER_MOTOR1_FULL_REVERSE;cSpeedVal_Motor2 = SABER_MOTOR2_FULL_REVERSE;
}
else
{
// Calc motor 1 speed (Final value ranges from 1 to 127)
cSpeedVal_Motor1 = map( cNewMotorSpeed,
-100,
100,
SABER_MOTOR1_FULL_REVERSE,
SABER_MOTOR1_FULL_FORWARD );// Calc motor 2 speed (Final value ranges from 128 to 255)
cSpeedVal_Motor2 = map( cNewMotorSpeed,
-100,
100,
SABER_MOTOR2_FULL_REVERSE,
SABER_MOTOR2_FULL_FORWARD );
}// Fire the values off to the Sabertooth motor controller
SaberSerial.print( cSpeedVal_Motor1, BYTE );SaberSerial.print( cSpeedVal_Motor2, BYTE );
}void setup()
{
// initialize the serial communication:
Serial.begin(9600);initSabertooth( );
}void loop() {
setEngineSpeed(0); // Zero is full stop
setEngineSpeed(20); // The minimum is twenty.
setEngineSpeed(100); // One hundred is the maximum.
}
I am a Novice and wanted to do a few things autonomously with our controller.
I have a few questions and it seems that you guys really know what you are doing.
Maybe you can help?
If you can assist me with answering these questions we would like to these your products?
What circuit would I buy to make autonomous and programmable?
Preferable one that we can switch between manual control and autonomous programs on the fly?
What software would I buy to program?
What is the programmable interface?
How does the circuit “your product” save the memory?
I would like to be able to save many programs and select them from screen-lcd that we can mount on our system?
Can the circuit accommodate a thumb nail drive for memory or sending programs?
Is it all done on computer then USb to circuit?