I am new to robotics and batteries and am trying to create a moving art piece. Here are the specs of everything that I am using and their links:
4PCS Servo Motor MG995 Control Angle180 Metal Gear Servo 20KG Digital High Speed Torque Servo Motor for Smart Car Robot Boat RC Helicopter
Wishiot 4 Cell AA Battery Holder Case with JR Connector 2P Black Red Wire + 3CH Digital Servo Tester ESC Speed Controller Checker CCPM Servo Consistency Master for Helicopter Car Boat Robot Servo
Tenergy NiMH Receiver RX Battery with Hitec Connectors 6V 2000mAh High Capacity Rechargeable Battery Pack for RC Airplanes/RC Aircrafts and More
Micro Maestro 6-Channel USB Servo Controller (Assembled)
And a couple of dupont wires.
Everything seems to be connected and moving fine, but I am having trouble with the script aspect of things. Ideally, each servo would be mounted on its own canvas and move 90 degrees once every hour. How would I go about programming this? I have tried to search for similar topics online but I have been unable to find anything. Any help would be appreciated.
Could you post some more specific information about what you need help with? It sounds like you are planning on using a Maestro script to control the servos. If that’s the case, you might start by looking through the “Example Scripts” section of the Maestro user’s guide. If you’re new to the Maestro scripting language, walking through some of those examples would be a good starting point (if you copy/paste them into the “Script” tab of your Maestro Control Center, you can step through them one line at a time with the “Step Script” button). Additionally, there is an example script in there about handling long delays, which I suspect will be useful to you. However, please note, as described there, the delays could easily be off by 1% or so.
Hello! Thank you for your timely response.
Yes I am wanting to run a script, but I am having trouble copying the delay script example in the script examples you provided and applying it successfully to what I wish to accomplish. I also have two questions:
I was wondering if it was possible to program the servos (0-3 in my case) to move at the exact same time? How would I go about this? From what I’ve experienced, I am only able to save a frame after one individual move, causing the servos to all move one after the other. The following are what the servos need to be moved to from their original target of 1500.00 (where the default is):
As you can see the change in each servo is a total of 250.00, with servo 0 needing to shift once an hour clockwise, servo 1 shifting counter clockwise once an hour, servo 2 shifting clockwise once an hour, and servo 3 shifting counter clockwise once an hour. There are canvases attached to each servo via custom plastic parts, which is why the servos need to move in unison once an hour in order to create a moving art piece. How would I go about writing this script?
Also as mentioned above, I tried to input the example script for delays into my own script section, but seem to be unable to save this change. Is not possible to copy and paste scripts?
Thank you in advance. I am very new to this so please let me know if I need to be more specific.
Since you mentioned frames, it sounds like you are using the Sequencer in the Maestro Control Center. When you save a frame using the sequencer, it essentially takes a snapshot of the current state of each servo channel. So, if you want them all to move to those positions at the same time, you can set those desired target positions in the “Status” tab, then go to the “Sequence” tab and click the “Save Frame” button. Any time that new frame is called, the servos will all move to those positions.
As far as the long delays example, you should be able to copy the relevant parts of that code into your script. Are you getting some kind of error? Could you post a copy of your script here so I can see what you have? If you are able to click the “Apply Settings” button without an error, could you post a copy of your Maestro settings file? You can save a copy of your settings from the “File” drop-down menu of the Maestro Control Center while the controller is connected.
By the way, the standard pulse width for servos is between 1000µs and 2000µs (although some servos can be stretched beyond those limits), so it sounds like you’re going to run out of range after your canvases turn 2 (maybe 3) times. Do you just plan on having them switch directions once they reach the limit? Ultimately, it might be simpler to write your own script instead of using the sequencer for that kind of thing (you’ll have to write some to handle that anyway), but starting with the sequencer could still be helpful.