Show Posts
Pages: [1]
1  Using Arduino / Motors, Mechanics, and Power / Re: Gears and connections for Parallax servo motors on: September 26, 2014, 03:32:36 pm
Thanks for the suggestions!
2  Using Arduino / Motors, Mechanics, and Power / Gears and connections for Parallax servo motors on: September 26, 2014, 01:25:34 pm
I'm trying to get into the robotics side of using my arduino but I don't know where to get the gears, shafts, etc associated with building robotic mechanisms. My first project will involve a Parallax continuous rotation servo motor. Do you have any reliable sites for procuring connections to the aforementioned servo?  I have searched a bit on google but I don't want to invest money on parts I can't trust.
3  Using Arduino / General Electronics / Bluetooth Module Communication errors on: March 07, 2014, 06:00:54 pm

So I'm working on a project that uses an HC_06 bluetooth module and an app to control my arduino. The code works and the module works fine. My app sends numbers 1-9 and the micro receives this info and does other crap with it. Recently I migrated the arduino micro to a circuit board following the guidelines laid out by (with the exception of using a ceramic resonator) and the communication got screwed up. Now the micro doesn't receive the right information. It usually receives garbage data.

My questions are as follows:
Should i be using a crystal instead of the resonator?
Is there supposed to be some sort of filter between the bluetooth module tx pin and the  micro rx pin?

Everything works fine if i use my arduino and the only thing that doesn't work is receiving the the transmitted information.

4  Using Arduino / Project Guidance / Re: Mega and 6 Ax-12A Servos on: February 01, 2013, 06:01:48 pm
How would you suggest controlling the frequency?
I tried changing the if statement to multiple ifs (shown below) to only send 1 regwrite command when a given pot is moved. Once that 4th servo is connected, there is still a delay.
Is what I'm trying to do possible? Because the servos need to be able to move all at the same time without delay or choppiness.
if ((present_val > old_val+2)||(present_val < old_val-2))
    old_val = present_val;
5  Using Arduino / Project Guidance / Re: Mega and 6 Ax-12A Servos on: January 31, 2013, 07:47:36 pm
How would i deal with the echo? I turned off the status packets as to avoid transmission errors and I have just implemented the buffer schematic as shown in the AX-12A data sheet. I changed my code to account for the buffer but the problem persists. More than 3 servos connected together and the the performance drops off. I can still move 4 servos but there is an unacceptable delay between turning a pot and the motion of the corresponding servo.
6  Using Arduino / Project Guidance / Re: Mega and 6 Ax-12A Servos on: January 31, 2013, 11:06:00 am
i'm sorry, i'm not sure I know the commands that you're speaking of. Some of the code is written so that I can use connect both the Tx and Rx pins to the 1 data line of the servos and communicate. I know there are libraries for these servos but they don't use this method
7  Using Arduino / Project Guidance / Re: Mega and 6 Ax-12A Servos on: January 31, 2013, 01:57:41 am
is it just not possible or am I missing something? I'm assuming I'm missing something but so far I haven't been able to find any solutions online.
8  Using Arduino / Project Guidance / Re: Mega and 6 Ax-12A Servos on: January 29, 2013, 12:18:59 pm
The high baud rate is the servo's default. I tried lowering the rate for the servos using dynamixel wizard (a program that allows connection between servo and computer) and in the code but then i couldn't communicate with the servos via mega any more. It was odd. The reason I send 6 messages is because multiple potentiometers turn at once to control the motors.
9  Using Arduino / Project Guidance / Mega and 6 Ax-12A Servos on: January 28, 2013, 05:31:33 pm
So I have written a program to control 6 AX-12A servos chained together with 6 potentiometers. The servos are powered by a lab power supply at 10 volts. I have connected the data wire of the servos to serial port 3 on the mega (pins 14, 15) and the program switches between transmitting and receiving to interface with the AX12A's half duplex UART. The program works just fine for 3 servos but as I start to go past 3 everything becomes choppy and delayed. I'm not quite sure what the problem is. Any idea for a possible solution? The code is listed below:
/* This Code is used with an Arduino Mega to communicate with Dynamixel
with Dynamixel AX-12A Servo Motor. All commands use Serial 3 to write
to servo and Serial to write to pc for purpose of recieving status packets

// instruction table for Dynamixel AX-12A
#define ping_ins 1 // checked
#define read_ins 2 // checked
#define write_ins 3 // Checked
#define reg_write_ins 4 // Checked
#define action_ins 5 // Checked
#define reset_ins 6 // Checked
#define sync_write_ins 131


//registers table for Dynamixel AX-12A
#define servo_id 3
#define baud_rate 4
#define max_torque 14
#define alarm_led 17
#define alarm_shutdown 18
#define torque_enable 24
#define goal_position 30
#define moving_speed 32

// Code Begins...

int length,location,temp,checksum,N,L; // used for status packet & return packet
int old_val = 0;
int old_val2 = 0;
int old_val3 = 0;
int old_val4 = 0;
int old_val5 = 0;
int old_val6 = 0;

int present_val = 0;
int present_val2 = 0;
int present_val3 = 0;
int present_val4 = 0;
int present_val5 = 0;
int present_val6 = 0;

int id;
int analogPin = A0;  // 5 Potenimeters. each 1 controls 1 motor
int analogPin2 = A1;
int analogPin3 = A2;
int analogPin4 = A3;
int analogPin5 = A4;
int analogPin6 = A5;
int value;

void setup()
  Serial3.begin(1000000); // Servo Communication Speed
  Serial.begin(9600); // Communication speed Arduino/PC

void loop()

  location = goal_position;
  present_val = analogRead(analogPin); // read value of A0
  present_val2 = analogRead(analogPin2);
  present_val3 = analogRead(analogPin3);
  present_val4 = analogRead(analogPin4);
  present_val5 = analogRead(analogPin5);
  present_val6 = analogRead(analogPin6);
  if ((present_val != old_val)||(present_val2 != old_val2)||
  (present_val3 != old_val3)||(present_val4 != old_val4)||
  (present_val5 != old_val5)||(present_val6 != old_val6)) //
    old_val = present_val; // old_val to present_val
    old_val2 = present_val2;
    old_val3 = present_val3;
    old_val4 = present_val4;
    old_val5 = present_val5;
    old_val6 = present_val6;
    transmit(); //enable trasmission
   // Reg_Write Instructions
   reg_write_2_byte(1,location,old_val);// put location value into buffer
   Action(0xFE); //execute buffer
    recieve(); //enable recieving


void transmit()
  bitSet(UCSR3B,3); // Sets Tx pin
  bitClear(UCSR3B,4); // Clear Rx pin
  bitClear(UCSR3B,7); // Disable Rx Interrupt

void recieve()
  bitClear(UCSR3B,3); // Clear Tx pin
  bitSet(UCSR3B,4);  // Set Rx Pin
  bitSet(UCSR3B,7);  // Allows Rx Interrupt

//Recieve Interrupt Subroutine

void serialEvent3()
  Serial.print(temp,HEX); // prints incoming return packet bit

 Function to reg_write to a 2 byte register
 location = what register to write to
 val = what value to write to register
void reg_write_2_byte(int id, int location,int val)
  length = 5; // length of 2-byte instruction is 5
  checksum = ~((id + length + reg_write_ins + location + (val&0xFF) + ((val&0xFF00) >> 8))%256); //Checksum Value
  Serial3.write(0xFF); // Starts instruction packet
  Serial3.write(val&0xFF); // Lower Byte
  Serial3.write((val&0xFF00) >> 8); // Upper Byte
 Action Function to perform Reg_Write Functions
void Action(int id)
  length = 2;
  checksum = ~((id + length + action_ins)%256);
  Serial3.write(id); // Broadcast(0xFE) is used when sending action to two Dynamixels
10  Using Arduino / Project Guidance / Re: Traffic Light Controller on: October 15, 2012, 12:10:27 pm
Thanks again, I do know how the millis() function works though. I meant specifically with timing being controlled by the potentiometer input. But I think it would work just fine if I just used what is the delay in my code as the interval in a similar code using millis().
11  Using Arduino / Project Guidance / Re: Traffic Light Controller on: October 13, 2012, 02:22:49 pm
Thanks for all the input, sorry my diagram sucks so much but the relay coils are connected to ground in the actual circuit.

And yeah, its a bunch of delay()s controlled by variable resister input so i can change the speed of each pattern. I'm not too picky as long as it works. Although I am curious how I would do it without using delay. here is one of the patterns
     if(buttonCount==0)//light pattern 1: scrolling down
       sensorValue = analogRead(analogInPin);
       else if(cnt1==1)
       else if(cnt1==2)
       else if (cnt1 ==3)
         cnt1=0;//reset counter
12  Using Arduino / Project Guidance / Traffic Light Controller on: October 12, 2012, 04:16:56 pm
So I'm building a traffic light controller for a traffic light I just happen to have laying around my house. I have a code that does various patterns on the lights which works fine on LEDs but I'm having trouble on the large scale design. The patterns are cycled by pressing a switch that calls an interrupt and increments a counter. I've tried connecting the UNO to a darlington array ( ULN2803APG) that in turn enables a 12 volt supply to close relays and turn on certain lights but I've been running into issues. The main problem is that when I connect my circuit to 120 AC, the switch is pulled high and low without a toggle. Any suggestions? Once again, the circuitry and code works when used on a small scale model.

I'm trying to figure out a sturdy solution so if you have any suggestions I would greatly appreciate them. I have attached a crude schematic for reference.

13  Using Arduino / Project Guidance / Re: PWM 12V pump control on: August 16, 2012, 02:07:14 pm
Now it works just dandy. Thanks for the help
14  Using Arduino / Project Guidance / Re: PWM 12V pump control on: August 16, 2012, 09:41:56 am
Currently, the source and the arduino do not share a common ground.
15  Using Arduino / Project Guidance / PWM 12V pump control on: August 16, 2012, 08:52:57 am

So i'm building a simple circuit using arduino's PWM and a potentiometer to control a 12V pump(powered by an external source). I tested the circuit with an LED and it worked just fine. I connected the circuit to a uln2803 darlington transistor pair and again tested the circuit with an LED powered by an external source through a darlington pair. The LED lit up but I could not control its brightness. The LED is connected to the output of the IC and the + of a 5V source. A simple diagram is shown below.

Any idea's as to why it's not working?

Pages: [1]