View unanswered posts | View active topics It is currently Mon Oct 20, 2014 5:17 pm






Reply to topic  [ 7 posts ] 
HSR-1425CR setup and programming 
Author Message
Rookie

Joined: Sat Feb 22, 2014 2:48 pm
Posts: 3
Post HSR-1425CR setup and programming
FTC Team 7912 software person

We are using an HSR-1425CR continuous servo for the first time. I don't know how to set up parameter so that I can control which direction the servo turns and to control the speed. Please share code and helpful hints.
Thank you :o


Sat Feb 22, 2014 2:59 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: HSR-1425CR setup and programming
The possible value of a continuous servo is between 0 and 255. With 0 being spinning one way full speed and 255 being spinning the other way full speed. 128 is the neutral value for which the servo stops. Shifting the value either direction will increase the speed of the servo in the corresponding direction. So to program it, you just do:
Code:
servo[YourContinuousServo] = 0;  //full speed one direction
servo[YourContinuousServo] = 128 // stop
servo[YourContinuousServo] = 255 //full speed the other direction


Sat Feb 22, 2014 3:04 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: HSR-1425CR setup and programming
BTW, just found one of my test programs for Continuous servo. You can press the arrow buttons on the NXT to spin it one way and the other. Release the buttons will cause it to stop.
Code:
#pragma config(Hubs,  S1, HTServo,  none,     none,     none)
#pragma config(Servo,  srvo_S1_C1_1,    rollerServo,          tServoContinuousRotation)
#pragma config(Servo,  srvo_S1_C1_2,    servo2,               tServoNone)
#pragma config(Servo,  srvo_S1_C1_3,    servo3,               tServoNone)
#pragma config(Servo,  srvo_S1_C1_4,    servo4,               tServoNone)
#pragma config(Servo,  srvo_S1_C1_5,    servo5,               tServoNone)
#pragma config(Servo,  srvo_S1_C1_6,    servo6,               tServoNone)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main()
{
    while (true)
    {
        if (nNxtButtonPressed == 1)
        {
            servo[rollerServo] = 0;
        }
        else if (nNxtButtonPressed == 2)
        {
            servo[rollerServo] = 255;
        }
        else
        {
            servo[rollerServo] = 128;
        }
        wait1Msec(100);
    }
}


Sat Feb 22, 2014 3:08 pm
Profile
Rookie

Joined: Sat Feb 22, 2014 2:48 pm
Posts: 3
Post Re: HSR-1425CR setup and programming
Hi Guru,
I am still struggling getting the 360 servo to spin at different speed depending on the values i set it to. For example, with no load on the servo,
1) if logitech button A == 1 then i set the value to 255 and if logitech button B == 1 then I set the value to 0, I get a slow speed.
2) if logitech button A == 1 then i set the value to 150 and if logitech button B == 1 then I set the value to 100, I get the same slow speed.

What am I doing wrong? No matter what I do, I can't get it to show me fast vs. slow.


Fri Mar 07, 2014 9:33 am
Profile
Expert
User avatar

Joined: Sat Aug 31, 2013 9:15 am
Posts: 136
Post Re: HSR-1425CR setup and programming
Wait, is this a continuous rotation servo or a standard servo? If it's a standard servo, you have to set servoChangeRate to change the speed the servo moves at. For a continuous rotation servo, the value you set to the servo command should set the speed.

_________________
FTC Team 6100 Chariots of Fire - Programmer (2012-2013)
FTC Team 7468 Blue Chariots of Fire - Programmer (2013-2014)
FTC Team 7468 Blue Chariots of Fire - Mentor (2014-2015)
Check out our team website at http://cof7468.weebly.com/.


Fri Mar 07, 2014 4:24 pm
Profile
Rookie

Joined: Sat Feb 22, 2014 2:48 pm
Posts: 3
Post Re: HSR-1425CR setup and programming
i'm using a continuous servo.


Fri Mar 07, 2014 11:18 pm
Profile
Expert
User avatar

Joined: Sat Aug 31, 2013 9:15 am
Posts: 136
Post Re: HSR-1425CR setup and programming
umass84jackcnh wrote:
i'm using a continuous servo.


Alright. Could you please post your whole code (including the #pragmas) so that we can see exactly what is happening?

_________________
FTC Team 6100 Chariots of Fire - Programmer (2012-2013)
FTC Team 7468 Blue Chariots of Fire - Programmer (2013-2014)
FTC Team 7468 Blue Chariots of Fire - Mentor (2014-2015)
Check out our team website at http://cof7468.weebly.com/.


Sat Mar 08, 2014 4:19 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.