Polou Maestro - cant use script when usb is not conected

Hi

I have a problem with running script after i disconect pololu maestro 6Ch from usb. There are 3 servos connected, plus one button. I wrote script that moves 3 servos in proper order to specified positions after i press button once. After second button press servos are moving to starting position in proper order. The problem is, its working fine when its connected to computer via usb port.

When i disconect it from computer and press button once - sequence is started - servos moving in order to open position. When button is pressed second time nothing happend. I cant make my pololu move servos to starting position.

So my idea was - that is problem with power. When Pololu is powered from 2 spots its working - if its only one its not. I checked power lines ( 12v battery 5000mAh fully charged -> device that gives 2A 5.5V -> pololu maestro ) but even when servos are moving there is still 5.5 V , no drops.

I can of course add another 5V line and plug it into usb port but its not solving , its avoiding problem …

Script looks like this :

[code]1 #ustawia stan na zamknieta baza
begin

0 get_position
1 less_than  #Check if button is pushed
if
     
    dup
    if  #If baza zamknieta, run frame to open it

        otworz_baze #Run the otworz_baze subroutine
        drop  #Change the state to 0
        0

    else  #If baza otwarta, run frame to close it

        zamknij_baze #Run zamknij_baze subroutine              
        drop #Change the state to 1
        1

    endif

endif

repeat

otworz_baze

sub otworz_baze
500 0 0 0 5568 6075 frame_1…5 # zamknieta baza
500 8943 frame_4 # otwarte prawe
1500 delay
500 2580 frame_5 # otwarta antena
1500 delay
500 7484 5633 1725 frame_3…5 # zamkniete prawe
500 4246 frame_3 # otwarta baza
500 delay
return

zamknij_baze

sub zamknij_baze
500 0 0 0 8865 2580 frame_1…5 # otwarte prawe
1500 delay
500 5928 frame_5 # zamknij antene
1500 delay
500 5659 frame_4 # zamknij prawe
500 7484 frame_3 # zamknieta baza
500 delay
return

Sequence subroutines:

sub frame_1…5
5 servo
4 servo
3 servo
2 servo
1 servo
delay
return

sub frame_4
4 servo
delay
return

sub frame_5
5 servo
delay
return

sub frame_3…5
5 servo
4 servo
3 servo
delay
return

sub frame_3
3 servo
delay
return[/code]

Can You plz help me to find solution …

Hello.

It sounds like when the servos all move, it draws more current than the regulator can handle, which could be dropping the voltage enough for the Maestro to reset. (The voltage drop is likely very quick and could be hard to see with a multimeter.) You mention using a 2A regulator and 3 servos. We generally recommend budgeting about 1A per standard servo, so your regulator might be a little underpowered for your system. You might try disconnecting two of your servos to see if it handles a single servo without a problem. If it does you can try adding a second back in. Also, you could try powering the Maestro’s VIN pin directly from your 12V battery and only using the regulator to power the servos. Ultimately, if your system is drawing more current than your regulator can handle, you might consider getting a more powerful step-down regulator.

-Brandon

U were right. I changed regulator for smtng with 5,5 A output and all is working fine. Strange think is : on previous regulator first part of the script worked. Subject closed - more power worked :slight_smile:

Hi, somewhat similar situation as BeOwulff in that I can’t run the script when USB is not connected. I have a 10K pot on 0 running a standard servo on 1. Works fine while on USB and a 7.4v 1300 mah Li-ion battery powering the Mini 12 which has the jumper positioned for “VSRV=VIN”. When I disconnect from the USB everything works. When I disconnect the 7.4v Li-ion battery and reconnect the battery, nothing works except the blinking yellow LED. Your thoughts please.

# Sets servo 1 to a position based on an analog input. begin 0 get_position # get the value of the pot, 0-1023 4 times 4000 plus # scale it to 4000-8092, approximately 1-2 ms 1 servo # set servo 0 based to the value repeat
Thanks - Gary

Hello, Gary.

From your description of the problem, it sounds like you do not have the script set up to run when the Maestro starts up. If you want the script to start automatically when you power the Maestro, you can enable the “Run script on startup” option under the “Script” tab of the Maestro Control Center.

-Brandon

OMG! That simple, eh? I’ll try it when I get home after work. Thanks so much for the quick response.

Gary