Skip to main content
2 of 5
deleted 788 characters in body
Noy
  • 11
  • 1

give zero volts to specific servo motors in a certain time

I have a robot that uses 4 mechanical arms. Each mechanical arm have 4 "READYTOSKY 30kg" servo motors on them. There is a moment that I need to use the absolute maximum force of only two mechanical arms (while the other two will stay still). Even though I do not change the coordinates of the other two mechanical arms (which I am not using) they consume voltage and "takes away" the full potential of force from the other two. Is there a way to stop the voltage consumed by the two other arms just for a brief moment using the Arduino code? shortly afterwards they will get back the voltage they need.

if(level==25)                                                     
  { 
    pwm.setPWM(12, 0, 200);
    pwm.setPWM(13, 0, 255);
    pwm.setPWM(14, 0, 430);
    delay(100);
    pwm.setPWM(1, 0, 380);                                      
    pwm.setPWM(2, 0, 520);
    delay(500);
    pwm.setPWM(0, 0, 170);
    delay(600);



    stepperten.setCurrentPosition(0);                            
    while (stepperten.currentPosition() != (-3*200)) 
    {
    stepperten.setSpeed(-600); 
    stepperten.runSpeed();
    }

    steppertwist.setCurrentPosition(0);                        
    while (steppertwist.currentPosition() != (100)) 
    {
      steppertwist.setSpeed(200);
      steppertwist.run();
    }

    stepper1.setCurrentPosition(0);
    while(stepper1.currentPosition() != (30))         
    {
      stepper1.setSpeed(200);
      stepper1.run();
    }

    // stepperten.setCurrentPosition(0);                         
    // while (stepperten.currentPosition() != (-3*100)) 
    // {
    // stepperten.setSpeed(-600); 
    // stepperten.runSpeed();
    // }

    pwm.setPWM(1, 0, 295);   //THIS IS THE MOEMENT I NEED TO STOP VOLATE FOR OTHER ARMS                               
    pwm.setPWM(2, 0, 400);   //AND GET THE MAXIMUM VOLTAGE POSSIBLE ON THESE TWO ARMS
    delay(1500);                                  
    pwm.setPWM(12, 0, 125);
    // pwm.setPWM(14, 0, 395);

    array1[25][0] = 170;                           
    array1[25][1] = 295;
    array1[25][2] = 400;
    array1[25][3] = 153;
    array4[25][0] = 125;
    array4[25][1] = 255;
    array4[25][2] = 395;
  }
  

Thank you

Noy
  • 11
  • 1