More info meastro servo controller

I built a 9g servo type Hexapod robot a few months back with a torobot controller which has allowed me to create some cool sequences but you can only get so far with a sequencer and the sample code will not compile with arduino.

Any way i want to finish my Hex but i need a servo controller i can actually code for better results. I like the size of the meastro but i would like to control it wirelessly. Is this possible? Can i use my current wireless PS2 controller sytem?

What compiler can i use to compile the code? If using arduino which board would be chosen for uploading.

Hello.

That sounds like a fun project. There are a variety of ways to send wireless signals to the Maestro, but they all will require additional hardware. I am not familiar with the wireless protocol for a PS2 controller, so I cannot really offer any advice on how to integrate one into a system.

There are two input methods that seem like they could be useful for your application, TTL serial and digital or analog input on channels configured for input. You can find out more about how these inputs work in the Maestro user’s guide, which is linked to under the resources tab of the product page for any of our Maestro products. You might look into using a more general microcontroller board like an Arduino on your robot to receive some form of wireless communication like the signal from your PS2 controller and then pass commands to the Maestro over TTL serial. If you are looking for a compact Arduino compatible board, you might consider our A-Star 32U4 Micro boards.

The scripting language for the Maestro is also detailed in the user’s guide. Code is written in the Maestro Control Center software on a PC and uploaded to the Maestro. The structure of the language and commands available are also detailed in the user’s guide.

You might also be interested in our Wixel Programmable USB Wireless Modules. There is a wireless serial app that can be loaded on a pair of Wixels that you might be able to use. You can find out more about this in the user’s guide for our Wixel, which can be found in the resources tab of the product page for any of our Wixel products.

-Nathan

Would this help?..

store.curiousinventor.com/guides/PS2/

I know Ive seen these tables or commands but i cant remember where.

At a glance, that looks like lower level information than is necessary. I did a quick Google search for “arduino ps2 controller” and it looks like there are resources around for using the two together that might make reading those signals easier. As I mentioned in my last post, it is possible to send commands from an Arduino to a Maestro over serial. If you are considering using a Maestro with an Arduino and a wireless PS2 controller, I recommend using the resources available on our web site I linked to earlier to understand how the Arduino and Maestro would work together and looking elsewhere to understand how to make the Arduino work with a PS2 controller.

-Nathan

Just watched the pololu getting started video and it all looks a lil easier than i thought but let me tell you what i understand so you can correct me if needed.

All right so i can use the M-24 board and the sequencer which will create a script i can download to the board. Then i can use say, my nano, to give the signals from my PS2 handle to the arduino which will trigger the commands downloaded to the pololu.

Sorry that was stupid! I pretty much just repeated what you said.

Ok i found the library and a schematic for hooking up the wireless controller to the Arduino nano but i cant find a diagram for how to hook up the nano to the maestro.

Any help please?

I want to make sure im doinf everything right. Here is a pic showing how to wire the wireless RX to tje arduino. I see that the maestro 24 comes with a 5v out can this be used to power the arduino.

I have no idea how this would hook up the pololu, using the pic above do i still have the needed pins to wire it to a meastro?

Or could you link me to how this is done?

The Maestro can only provide a small amount of current from the 5V onboard regulator, so you should power the Arduino separately.

We recently released a Maestro Servo Controller library for Arduino (also linked to on the Resources tab of the Maestro product pages) and you can find information there about the communication connections required to use the library. The library also contains sample code for controlling the Maestro in different ways.

-Nathan

I got my maestro-24 yesterday and finally got around to doing some reading. Looks like this is a very versatile system here able to do alot more than any other all-in-1 servo controller.

I was thinking maybe they could add an inverse/forward kinematics solver to the program that way even a hobbyist like me could make thier robots have more life-like movements. I would even be inclined to pay gor such an add on.

Just an idea.

Will have questiins soon. Fixing to hook it up to my Hex.

Been playing today. Last night i entered my numbers into the sequencer for a ripple gait which didnt work at first. I blew two Coxa servos and had 2 plugged in wrong. Got up today and it walked just fine.

Also read up on the 5v out and soldered a couple servo leads to one and used it to power my arduino and the arduino powers the wireless PS2 RX. Thats pretty cool but ill need a Higher MaH battery. Its gonna suck my 3s 500mah down quicker.

I dont exactly know what im looking for but i was reading the PSX_lib.h file found here…

github.com/madsci1016/Arduino-P … PS2X_lib.h

About halway down it lists each button and gives its constant. Is this what i need to know in order for my pololu to execute a sequence?

If not could you please give me a link for how to read the signals from the arduino to execute a sequence.

Hello.

I recommend looking at the “Basic” and “Script” examples included in the Pololu Maestro Arduino library to see how to write code for the Arduino that will trigger actions on the Maestro. There is a great deal of flexibility with the way something can be implemented between the two platforms. In general, for more complicated projects like this, I recommend starting with the examples to understand how the functions work, writing pieces of simplified code that do parts of the functionality you want in your project, and then integrating these simplified pieces together to get more complex behavior.

-Nathan

Ok i have been looking at the script examples for pololu and looking at the Maestro\arduino library and im still very confused. What it looks like to me is that its telling you how to make and run subroutine using the arduino. Though i still dont see how its activating the subroutine.

I need to know how to activate a prewritten subroutine.

One thing that would help is knowing and understanding the signals that are passed back and fourth from the arduino to the maestro. I think. I really dont know because i dont understand this stuff. Wish more was written in laymens.

A subroutine is a sequence right?

Looking at the PS2X_lib.H file there are numbers after each button written like this X button 0x1000. Im assuming this is is the Arduinos serial output when X is pressed.

If so how do i convert this number to a number that the Pololu will understand when the signal is sent?

Hello.

If you look at the “Script” example from the Pololu Maestro Arduino library, lines 30 to 51 contain code that is meant to go into the “Script” portion of the Maestro Control Center software and be uploaded to the Maestro. This code contains two different prewritten subroutines (which in these cases are sequences of servo movements that have been put into the script). The execution of the script on the Maestro is controlled by the statements on lines 87, 91, and 99.

The Maestro and the Arduino communicate with each other over TTL Serial. Essentially, the Arduino sends a sequence of digital bits over the line connected to the Maestro when the statements noted above (lines 87, 91, and 99) are executed.

In general, you will probably want to write code for the Arduino that looks at the state of your PS2 controller and if one of the buttons is pressed, executes the maestro.restartScript(i); command, which will send the appropriate serial command from the Arduino to the Maestro.

-Nathan

Ive got a 24 step Ripple sequence ive been using but im not too happy with. I would like to make it a 12 step. Problem is i need to make each leg raise rotate and drop in the same frame. Is there a way to do this with out it being to hard?

Also can i make a seperate script for each sequence or do they all have to be part of the same one.

Is it possible to create movements that start from the last frame executed. Say i release the button with the 3rd leg up and rotated and i push it again it starts from 3rd leg up and rotated?

Hello.

Only one script can be loaded onto the Maestro at a time. Is there a reason separating your code into subroutines and calling the subroutines would not work? The last example I pointed you to shows how to call different Maestro subroutines from the Arduino.

It will probably be difficult to get the Maestro to pick up movements where it left off previously. You might be able to break your movements into smaller steps and have the Arduino call them more frequently so that if you interrupt a movement in your Arduino code, you will have a better idea of where it was interrupted.

-Nathan

No reason thought it might be easier to write several different sequences to keep them seperate. IDK my filing system is weird. i can still work with it.

I was actually thinking of a read call to see where the servos are then an if statement to execute from where it last read.

Can the sequencer go faster than 100ms? I noticed it would allow me to type in under 100 but didnt try to do anything with it. 100ms i know is pretty fast at 10th a second but most of the other bots i see seem to move faster.

Hello.

The getPosition command in the Maestro library will return the current target position the Maestro is sending to the specified channel, so that might also help you determine where your script was stopped. Also, it might help you to know that if a movement command like 6000 0 servo is executed in a script and then the script is stopped immediately, the Maestro will continue commanding the servo to move toward this target.

To change the length of time to wait for a movement to occur for a frame in a sequence, simply double click the frame in the “Frames” portion of the “Sequence” tab, and type in a new duration in the dialog box that appears. However, you should know that this does not affect the movement speed of the servo, only the length of time the Maestro waits before beginning the next action.

For more information on how the Maestro controls servo speed, you can look at the Speed and Acceleration headings under the Channel Settings section of the Maestro user’s guide. To learn how to change the speeds on a channel as the program runs, you can look at the Set Speed and Set Acceleration headings under the Serial Servo Commands section or the Servo, LED, and other output commands table of the Command Reference section of the same user’s guide.

Finally, please note that there is some physical speed limit on the servos themselves as well and even if the Maestro is sending a faster move command, the servo will still be limited by this physical limit.

-Nathan