Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   FIRST Tech Challenge (http://www.chiefdelphi.com/forums/forumdisplay.php?f=146)
-   -   [FTC]: Servo daisy chain problem (http://www.chiefdelphi.com/forums/showthread.php?t=127922)

andidani 16-03-2014 19:05

[FTC]: Servo daisy chain problem
 
Hi, my team just finished rewiring our robot, and in the process we rearranged the setup of our motors and servos. Before now, things have always functioned quite well, but as soon as we changed the servo controller to 3rd in the daisy chain, the servo was no longer recognized as a servo in the pragmas. Below is the setup, with the "ploop" servo refusing to turn brown after compiling:
#pragma config(Sensor, S2, gyro, sensorI2CHiTechnicGyro)
#pragma config(Sensor, S3, HTSMUX, sensorI2CCustom)
#pragma config(Sensor, S4, , sensorI2CMuxController)
#pragma config(Motor, motorA, bristle, tmotorNXT, PIDControl, encoder)
#pragma config(Motor, mtr_S1_C1_1, liftLeft, tmotorTetrix, openLoop, reversed)
#pragma config(Motor, mtr_S1_C1_2, backLeft, tmotorTetrix, openLoop, reversed, encoder)
#pragma config(Motor, mtr_S1_C2_1, frontLeft, tmotorTetrix, openLoop, reversed, encoder)
#pragma config(Motor, mtr_S1_C2_2, flagRaiser, tmotorTetrix, openLoop)
#pragma config(Motor, mtr_S4_C1_1, liftRight, tmotorTetrix, openLoop, reversed, encoder)
#pragma config(Motor, mtr_S4_C1_2, frontRight, tmotorTetrix, openLoop)
#pragma config(Motor, mtr_S4_C2_1, backRight, tmotorTetrix, openLoop, encoder)
#pragma config(Motor, mtr_S4_C2_2, dropper, tmotorTetrix, openLoop)
#pragma config(Servo, srvo_S4_C3_1, ploop, tServoStandard)
#pragma config(Servo, srvo_S4_C3_2, servo2, tServoNone)
#pragma config(Servo, srvo_S4_C3_3, servo3, tServoNone)
#pragma config(Servo, srvo_S4_C3_4, servo4, tServoNone)
#pragma config(Servo, srvo_S4_C3_5, servo5, tServoNone)
#pragma config(Servo, srvo_S4_C3_6, servo6, tServoNone)
Has anyone else had an issue with the servo controller when not placed first in the chain?

dcribbs 17-03-2014 11:31

Re: [FTC]: Servo daisy chain problem
 
Quote:

#pragma config(Sensor, S4, , sensorI2CMuxController)
It looks like you are configuring S4 as a Sensor here


Quote:

#pragma config(Motor, mtr_S4_C1_1, liftRight, tmotorTetrix, openLoop, reversed, encoder)
#pragma config(Motor, mtr_S4_C1_2, frontRight, tmotorTetrix, openLoop)
#pragma config(Motor, mtr_S4_C2_1, backRight, tmotorTetrix, openLoop, encoder)
#pragma config(Motor, mtr_S4_C2_2, dropper, tmotorTetrix, openLoop)
#pragma config(Servo, srvo_S4_C3_1, ploop, tServoStandard)
#pragma config(Servo, srvo_S4_C3_2, servo2, tServoNone)
#pragma config(Servo, srvo_S4_C3_3, servo3, tServoNone)
#pragma config(Servo, srvo_S4_C3_4, servo4, tServoNone)
#pragma config(Servo, srvo_S4_C3_5, servo5, tServoNone)
#pragma config(Servo, srvo_S4_C3_6, servo6, tServoNone)
and here you are trying to use S4 as a motor/servo controller.
I am not sure, but I don't think the S4 port can do both at the same time.

FTC4211 17-03-2014 12:12

Re: [FTC]: Servo daisy chain problem
 
I think the problem is that RobotC didn't add in the necessary pragmas to have controllers on the ports S1, and S4.

This should work:

Code:

#pragma config(Hubs,  S1, HTMotor,  HTMotor,  none,    none)
#pragma config(Hubs,  S4, HTMotor,  HTMotor,  HTServo,  none)
#pragma config(Sensor, S1,    ,              sensorI2CMuxController)
#pragma config(Sensor, S2,    gyro,          sensorI2CHiTechnicGyro)
#pragma config(Sensor, S3,    HTSMUX,        sensorI2CCustom)
#pragma config(Sensor, S4,    ,              sensorI2CMuxController)
#pragma config(Motor,  motorA,          bristle,      tmotorNXT, PIDControl, encoder)
#pragma config(Motor,  mtr_S1_C1_1,    liftLeft,      tmotorTetrix, openLoop, reversed)
#pragma config(Motor,  mtr_S1_C1_2,    backLeft,      tmotorTetrix, openLoop, reversed, encoder)
#pragma config(Motor,  mtr_S1_C2_1,    frontLeft,    tmotorTetrix, openLoop, reversed, encoder)
#pragma config(Motor,  mtr_S1_C2_2,    flagRaiser,    tmotorTetrix, openLoop)
#pragma config(Motor,  mtr_S4_C1_1,    liftRight,    tmotorTetrix, openLoop, reversed, encoder)
#pragma config(Motor,  mtr_S4_C1_2,    frontRight,    tmotorTetrix, openLoop)
#pragma config(Motor,  mtr_S4_C2_1,    backRight,    tmotorTetrix, openLoop, encoder)
#pragma config(Motor,  mtr_S4_C2_2,    dropper,      tmotorTetrix, openLoop)
#pragma config(Servo,  srvo_S4_C3_1,    ploop,                tServoStandard)
#pragma config(Servo,  srvo_S4_C3_2,    servo2,              tServoNone)
#pragma config(Servo,  srvo_S4_C3_3,    servo3,              tServoNone)
#pragma config(Servo,  srvo_S4_C3_4,    servo4,              tServoNone)
#pragma config(Servo,  srvo_S4_C3_5,    servo5,              tServoNone)
#pragma config(Servo,  srvo_S4_C3_6,    servo6,              tServoNone)
//*!!Code automatically generated by 'ROBOTC' configuration wizard              !!*//


dcribbs 19-03-2014 14:58

Re: [FTC]: Servo daisy chain problem
 
1 Attachment(s)
Quote:

#pragma config(Hubs, S1, HTMotor, HTMotor, none, none)
#pragma config(Hubs, S4, HTMotor, HTMotor, HTServo, none)
#pragma config(Sensor, S1, , sensorI2CMuxController)
#pragma config(Sensor, S2, gyro, sensorI2CHiTechnicGyro)
#pragma config(Sensor, S3, HTSMUX, sensorI2CCustom)
#pragma config(Sensor, S4, , sensorI2CMuxController)
Did your program work with S1 and S4 both defined as a Hub and a Sensor.

I did not think that was possible. When I used the motor and sensor setup tab it gave me an error when I tried to define a sensor port (S4) as 2 different things.

andidani 24-03-2014 20:11

Re: [FTC]: Servo daisy chain problem
 
Thanks for the responses, everyone. In the time since I first posted, I found an odd peculiarity with robotc that seems to be the culprit: it seems as though it is indeed impossible for RobotC to properly recognize a servo when used in a daisy chain run through the 4th port, wherein it is not first in the chain. I found this out through simple trial and error, changing nothing but the ports and position of the servo and its controller. My team and I just switched a sensor multiplexer to port four and then put the controller chain in port 3, and voila! Problem solved. Feel free to verify, but at least in my version of robotc (3.62), which should be the latest, this seems to be the only way around the oddly-specific issue.


All times are GMT -5. The time now is 18:16.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi