View Single Post
  #11   Spotlight this post!  
Unread 17-01-2013, 13:30
jamie_1930's Avatar
jamie_1930 jamie_1930 is offline
Registered User
FRC #2228 (Cougartech)
Team Role: Student
 
Join Date: Feb 2008
Rookie Year: 2008
Location: Rush-Henrietta
Posts: 371
jamie_1930 is a splendid one to beholdjamie_1930 is a splendid one to beholdjamie_1930 is a splendid one to beholdjamie_1930 is a splendid one to beholdjamie_1930 is a splendid one to beholdjamie_1930 is a splendid one to beholdjamie_1930 is a splendid one to behold
Re: CIM->Victor 884->Arduino not working

Quote:
Originally Posted by tr6scott View Post
This is working code, I have two pots, one is set only goes one direction, the other pot goes full rev -> 0 -> full forward. This was hacked together a couple of years ago, and put in an Altoids can, we are using it to prototype again this year.

Code:
#include <Servo.h> 
 
Servo myservo;  // create servo object to control a servo 
Servo myservo1;  // create servo object to control a servo 
 
int potpin = 0;  // pot in is 13 pwm analog pin used to connect the potentiometer
int potpin1 = 1;  // analog pin used to connect the potentiometerint val;    // variable to read the value from the analog pin 
int val =0;
int val1=0;
void setup() 
{ 
 myservo.attach(9);  // attaches the servo on pin 9 to the servo object 
 myservo1.attach(10);  // attaches the servo on pin 9 to the servo object 
} 
 
void loop() 
{ 
  val = analogRead(potpin);            // reads the value of the potentiometer (value between 0 and 1023) //
  val1 = analogRead(potpin1);            // reads the value of the potentiometer (value between 0 and 1023) 
  val = map(val, 0, 1023, 0, 179);     // scale it to use it with the servo (value between 0 and 180) 
  val1 = map(val1, 0, 1023, 90, 179);     // scale it to use it with the servo (value between 0 and 180) 
   myservo.write(val);                  // pwm 13 sets the servo position according to the scaled value 
   myservo1.write(val1);                  // sets the servo position according to the scaled value 
  delay(15);                           // waits for the servo to get there 
}
Could you show me how you set up this up electrically? In the victor manual it says to use a pwm signal driver if you are not using an ifi controller and I can't really find one on the internet. So I assumed I could boost up the amount of current by using a mosfet. I got that working and then I measured the current over time with an oscilliscope and it's pretty noisy. The voltage is a perfect square wave, but the current starts of at 0A and curves up to around 500mA and does a 10-20mA bounce as it goes up.
__________________
2010
Team 2228(FRC) - Drive Team Lead, Drive Coach, Mechanical Team
Team 3750(FTC) - Team Lead
2009
Team 2228(FRC) - Mechanical Team, Driver at RIT, and Hartford Regionals, and Drive coach at Ruckus
*Second Place at Ruckus
Team 3750(FTC) - Team Lead, and Drive coach at Clarkson Regional
*Second Place at Clarkson Regional
2008
Team 1930(FRC) - Worked on Mechanical, Electrical, and Programming.