Buy an Axon, Axon II, or Axon Mote and build a great robot, while helping to support SoR.
0 Members and 1 Guest are viewing this topic.
SERVO Leg1_servo_1 = MAKE_SERVO(FALSE, G5,1500, 500);SERVO Leg1_servo_2 = MAKE_SERVO(FALSE, E4,1500, 500); SERVO Leg1_servo_3 = MAKE_SERVO(FALSE, E5,1500, 500);SERVO Leg2_servo_1 = MAKE_SERVO(FALSE, E6,1500, 500);SERVO Leg2_servo_2 = MAKE_SERVO(FALSE, H3,1500, 500);SERVO Leg2_servo_3 = MAKE_SERVO(FALSE, H4,1500, 500);SERVO Leg3_servo_1 = MAKE_SERVO(FALSE, H5,1500, 500);SERVO Leg3_servo_2 = MAKE_SERVO(FALSE, B4,1500, 500);SERVO Leg3_servo_3 = MAKE_SERVO(FALSE, B5,1500, 500);SERVO Leg4_servo_1 =MAKE_SERVO(FALSE, B7,1500, 500);SERVO Leg4_servo_2 =MAKE_SERVO(FALSE, H7,1500, 500);SERVO Leg4_servo_3 =MAKE_SERVO(FALSE, G3,1500, 500);SERVO Leg5_servo_1 =MAKE_SERVO(FALSE, L0,1500, 500);SERVO Leg5_servo_2 =MAKE_SERVO(FALSE, L1,1500, 500);SERVO Leg5_servo_3 =MAKE_SERVO(FALSE, L3,1500, 500);SERVO Leg6_servo_1 =MAKE_SERVO(FALSE, L4,1500, 500);SERVO Leg6_servo_2 =MAKE_SERVO(FALSE, L6,1500, 500);SERVO Leg6_servo_3 =MAKE_SERVO(FALSE, L7,1500, 500);//SERVO servo_3 = MAKE_SERVO(FALSE, H5, 1500, 500);//SERVO digital_example = MAKE_SERVO(FALSE, H5, 1520, 910);//digital servos have greater range// Create the list - remember to place an & at the// start of each servo nameSERVO_LIST servo1[] = {&Leg1_servo_1};SERVO_LIST servo2[] = {&Leg2_servo_1};SERVO_LIST servo3[] = {&Leg3_servo_1};SERVO_LIST servo4[] = {&Leg4_servo_1};SERVO_LIST servo5[] = {&Leg5_servo_1};SERVO_LIST servo6[] = {&Leg6_servo_1};SERVO_LIST servo7[] = {&Leg1_servo_2,&Leg1_servo_3};SERVO_LIST servo8[] = {&Leg2_servo_2,&Leg2_servo_3};SERVO_LIST servo9[] = {&Leg3_servo_2,&Leg3_servo_3};SERVO_LIST servo10[]= {&Leg4_servo_2,&Leg4_servo_3};SERVO_LIST servo11[]= {&Leg5_servo_2,&Leg5_servo_3};SERVO_LIST servo12[]= {&Leg6_servo_2,&Leg6_servo_3};// Create a driver for the list of servosSERVO_DRIVER bank1 = MAKE_SERVO_DRIVER(servo1);SERVO_DRIVER bank2 = MAKE_SERVO_DRIVER(servo2);SERVO_DRIVER bank3 = MAKE_SERVO_DRIVER(servo3); SERVO_DRIVER bank4 = MAKE_SERVO_DRIVER(servo4);SERVO_DRIVER bank5 = MAKE_SERVO_DRIVER(servo5);SERVO_DRIVER bank6 = MAKE_SERVO_DRIVER(servo6);SERVO_DRIVER bank7 = MAKE_SERVO_DRIVER(servo7);SERVO_DRIVER bank8 = MAKE_SERVO_DRIVER(servo8);SERVO_DRIVER bank9 = MAKE_SERVO_DRIVER(servo9);SERVO_DRIVER bank10 = MAKE_SERVO_DRIVER(servo10);SERVO_DRIVER bank11 = MAKE_SERVO_DRIVER(servo11);SERVO_DRIVER bank12 = MAKE_SERVO_DRIVER(servo12);
here is how i defined the servos and drivers.
axon II resets
I'm not very familiar with the servo part of webbot lib, but I'm pretty sure that act_getSpeed() will not return you the actual position of the servo but will rather return the last speed you set with act_setSpeed(). There is no feedback from a servo to the MCU regarding its current position.Chelmi.
Nope, that is how I defined them lol
btw, I am not 100% sure, but (please try and check) that even if you do NOT put act_speed commands at all... WebbotLib will still give these commands in background continuously (with a speed of '0')... so even if you're keeping 1 command in a loop, it wont make a difference.
Quote from: chelmi on March 12, 2010, 12:05:34 PMI'm not very familiar with the servo part of webbot lib, but I'm pretty sure that act_getSpeed() will not return you the actual position of the servo but will rather return the last speed you set with act_setSpeed(). There is no feedback from a servo to the MCU regarding its current position.Chelmi.I think (I am not sure) that act_setSpeed() for a servo will tell the servo to which position to move rather than how fast to move. If this is the case then act_getSpeed() will return the position of the servo.
act_getSpeedDRIVE_SPEED act_getSpeed(const __ACTUATOR_COMMON* act)Returns the last value from 'act_setSpeed'.NB This is not the actual speed that the actuator is moving at - we have no way of knowingthat without an encoder!
Yes, act_setSpeed() is more like an act_setPosition() when used for a servo. But my comment is still valid. act_getSpeed() (or act_getPosition) will return you the value you passed to the last call of act_setSpeed(). NOT the current position of the servo. I just checked the documentation:
1) When you connect two batteries in parallel... make sure (using Voltmeter, etc) both the batteries have exactly the same voltage at that time. (I'm pretty sure you'd kno that, but its better to warn )
2) The vibrations or noises you hear, I am pretty sure if you use only 12 servos in 12 different banks, they won't vibrate at all) - that is the reason I have been begging my friend Webbot to enable the use of 8-bit timers. So please try to //remove the commands for servo 3 from each leg ! - i.e. program it as if you had only 12 servos, and let me know if you notice any difference)
3) I would agree with chelmi, as "x=act_getSpeed(array1[j]);" doesn't make sense to me...I would recommend using another set of (array of) variables for "desired positions"... for example:While having: act_getSpeed(array1[j],speed); keep on loopinglets say initially: speed = 0;desired position you set as: ds1 = 50;now you can compare, if (speed<ds1) { speed+=1; } so speed (that is the position) will keep on increasing by '1' in each loop, until it reaches the desired position.
Thanks Hasan for your help.
4) Once you have both batteries of same Voltage, connect black to black, red to red... and re-charge.
Is it 3600mAh or 4600mAh (2*2300)?
but, don't you think combining batteries would be still better?..since you'll have to charge only 'once' for both !?