Maestro 18 24v trigger ...first time servo guy lol

i have the 18 up and running with my simple script via desktop
i would like the script to start by a 24v signal from a scale (i was told i can take the LED signal and not cause any issues with the scale)
i would also like a manual button/trigger to start the cycle
the scripts sequence will run 1 time per signal
i have some knowledge of relays pertaining to pneumatics, but thats just the physical…this is all new

begin
  500 6532 4032 0 0 0 0 
  0 0 0 0 0 0 
  0 0 0 0 0 0 frame_0..17 # Frame 5
  500 6395 frame_0 # Frame 1
  1000 10422 frame_1 # Frame 2
  750 4032 frame_1 # Frame 3
  500 6532 frame_0 # Frame 4
repeat

sub frame_0..17
  17 servo
  16 servo
  15 servo
  14 servo
  13 servo
  12 servo
  11 servo
  10 servo
  9 servo
  8 servo
  7 servo
  6 servo
  5 servo
  4 servo
  3 servo
  2 servo
  1 servo
  0 servo
  delay
  return

sub frame_0
  0 servo
  delay
  return

sub frame_1
  1 servo
  delay
  return

Hello.

I suggest starting with a manual button press to start the cycle, then adding the signal from your scale once you get that working.

To add a button to your Maestro, you will first need to decide what channel to use for the button and configure that channel as an Input in the “Channel Settings” tab of the Maestro Control Center. Then, you can connect the button to that channel with a pull-up resistor as shown in the “Attaching Servos and Peripherals” section of the Maestro user’s guide. Once the button is working (i.e. you can see the value of that channel change correctly in the “Status” tab of the Maestro Control Center when you press the button) you can add code to start your script from that. You can find sample code showing how to handle starting your script with a button press in this post.

As far as starting the script from your 24V signal, please note that the Maestro cannot handle a 24V input, so you would need to convert it to a 5V signal first. You can do that with a simple voltage divider or an appropriate logic level shifter. Once your 24V signal is converted to 5V, you can essentially treat it as a button and connect it to a separate Maestro channel configured as an input… However, please note that the logic might be inverted when compared to the button. If you get to this point and need help updating your script to start when either signal is triggered, please post an updated version of your script, and I would be glad to take a look. Essentially, it will probably involve reading the button and scale inputs, checking if they are low or high, then using a LOGICAL_OR command so either one will cause the script to move on.

Brandon

I’ve tried the same thing 10 times…I must be doing something wrong. It’s almost like I’m getting a direct short.

I wire as instructed (I think lol)

If I push the button/switch I loose contact with my desktop

If I hold it down I’m going to cook something

edit: forgot to add

i was using a 4AA battery pack through the pins for power

i lose comms with the desktop with and with out the battery pack

the little blue jumper is not “jumping” its only on one pin for storage

in the future this will be hooked up to a 5v power supply

additionally my original trigger from the scale was thought to be 25v, but it was confirmed that its 5v.

I’m using #11

White wire on the outside pin goes to one leg of the switch (red wire of switch)

Black is soldered to 5v on board

Yellow wire is on the ground pin (I also tried it on the innermost pin of #11 as the wiring diagram picture suggests and I get the same results)

Black and yellow are on different sides of the resistor

Resistor is then pig tailed to the switch.



It looks like your wiring is directly shorting the 5V pin to GND when you press the button, and it looks like none of your wires are actually going to a Maestro signal pin.

Your white wire is going from one side of the button to ground, which is fine. The yellow wire should go to the signal pin of the channel you configured as an input: (instead of another ground). The resistor should be between the 5V pin and the signal pin (which you can fix by moving the button’s black wire to the same side of the resistor as the yellow wire).

Could you try making those changes and seeing if that fixes the problem? If not, could you post updated pictures of your connections?

Brandon

thanks for getting me straight…HUUUGE help

this is how i got it to work with the button… i dont think its 100% correct but i messed around a while until it let me save it lol

it seems to work every time with the button

ive used the blue jumper and removed from my desktop…so that made me happy

next up is how do i have one cycle for one press, currently if i hold the button the sequence keeps running

please review when you get a chance

THANKS AGAIN!!

begin
  11 get_position     # get the value from button connected to pin 11
	
  200 6532 4032 0 0 0 0 
  0 0 0 0 0 0 
  0 0 0 0 0 frame_0..10_12..17 # Frame 1
  500 6395 frame_0 # Frame 2
  1000 10422 frame_1 # Frame 3
  750 4032 frame_1 # Frame 4
  500 6532 frame_0 # Frame 5
	begin 11 get_position 200 greater_than while #switch high before restart switych low possible
		repeat
repeat
sub frame_0..10_12..17
  17 servo
  16 servo
  15 servo
  14 servo
  13 servo
  12 servo
  10 servo
  9 servo
  8 servo
  7 servo
  6 servo
  5 servo
  4 servo
  3 servo
  2 servo
  1 servo
  0 servo
  delay
  return

sub frame_0
  0 servo
  delay
  return

sub frame_1
  1 servo
  delay
  return

brandon…i received a alert “16 minutes ago”. but i dont see a reply?

thanks

It sounds like that alert was sent when I edited your post to add code tags to your script.

I am glad you got it working! It looks like your script is checking the button after it runs through the sequence once; if this is how you intend it to work, then that’s fine, but if you want it to require a button press to start the sequence, you can move your button processing code just after the first BEGIN. (By the way, if you do want it to work as it is, you can remove the first 11 get_position, just after the first BEGIN, since the rest of your code is not actually using that.)

As you described, right now if you hold the button the script will keep running. If you want it to wait for another separate button press, you can add another WHILE loop that waits for the button to be released before continuing, like this:

begin 11 get_position 500 less_than while repeat

Depending on the behavior you want, you could put this WHILE loop either right before or right after your current button processing code, though since you are not doing anything special to handle button debouncing, it would probably work better if you place it before.

Brandon