http://forum.pololu.com/atom.php?f=162010-03-05T00:00:00ZPololu Servo Controllers and Servos - Pololu robotics forumSupport for Pololu RC servo controllers and our RC servos.Re: Maestro vs ServoCity 8 Servo ControllerLukeAhttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=103062015-03-03T09:09:43-08:002015-03-03T09:09:43-08:00http://forum.pololu.com/viewtopic.php?p=43459#p43459Forum: Pololu Servo Controllers and ServosDoes anyone have an opinion on this?]]>
Re: Angles and speedsD6equj5http://forum.pololu.com/memberlist.php?mode=viewprofile&u=156432015-03-03T08:11:18-08:002015-03-03T08:11:18-08:00http://forum.pololu.com/viewtopic.php?p=43458#p43458Forum: Pololu Servo Controllers and ServosThank you Brandon,I see what you're saying and understand that servos are not like steppers and a bit of trial and error is usually required when setting the things up however, is there not some calculation I can do or can get the script to calculate to get any hint of accuracy about them?

All I need is for the servo to default to its exact mid-position at power-up and then on the flick of a switch or press of a button, move 90 degrees and then upon release of the button move 30 degrees back toward mid-position (doesn't really matter in which direction at this juncture)

I am using "Tower Pro" Micro Servo 90 SG90 servos. (small blue things and quite noisy but size was the important aspect)

BTW if I (we) can get the servos and maestro to do this with a script to make it autonomous I may just fall in-love with Pololu.

Peace and LoveX]]>
Get variables, servo position in VB 2010hdavy1234http://forum.pololu.com/memberlist.php?mode=viewprofile&u=156632015-03-03T03:01:51-08:002015-03-03T08:33:46-08:00http://forum.pololu.com/viewtopic.php?p=43455#p43455Forum: Pololu Servo Controllers and ServosI am attempting to read the position of a servo (channel 0) using the following code in VB 2010 with the minimaestro 6, however I am getting the exception appear in the message box when button 1 is clicked as opposed to the servo position data.

'Index is out of range of the array'

Does anyone know why this might be?

Thankshdavy1234

Code:

Public Class MainWindow

Public Property Stack As Object Dim st As Short()

''' <summary> ''' Attepts to get variables from the stack ''' </summary> Public Sub TryGetVariables() Try Using device As Usc = connectToDevice() ' Find a device and temporarily connect.

device.getVariables(st) MessageBox.Show(st(0).ToString())

' device.Dispose() is called automatically when the "Using" block ends, ' allowing other functions and processes to use the device. End Using Catch exception As Exception ' Handle exceptions by displaying them to the user. displayException(exception) End Try End Sub

]]>
Re: getVariables and Visual Basic (2010)hdavy1234http://forum.pololu.com/memberlist.php?mode=viewprofile&u=156632015-03-03T02:34:59-08:002015-03-03T02:34:59-08:00http://forum.pololu.com/viewtopic.php?p=43454#p43454Forum: Pololu Servo Controllers and ServosI am having the same issue with the indexoutofrange exception. Has anyone managed to shed any light on this yet?

Thanks!]]>
Re: controlling a sequence from a switched inputAmandaShttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=131772015-03-02T17:34:10-08:002015-03-02T17:34:10-08:00http://forum.pololu.com/viewtopic.php?p=43449#p43449Forum: Pololu Servo Controllers and ServosI recommend looking at the "Using a button or switch to control servos" example code under the "Example scripts" section of the Maestro user's guide to get started with implementing a switch in your script. You can read the comments in the example script to get a better understanding of how the code works. As for your "skip" feature, you can disable the output of a channel by setting the target position to 0, so you could create one subroutine that controls channel 2 how you want and another that sets the target position of channel 2 to 0, disabling it. Then, your script could call either subroutine depending on the position of your switch.

If you try to add those features to your code and continue to have problems doing so, you can post your updated code here, and I would be happy to take a look.

The Maestro's speed command works by breaking the position command into multiple smaller divisions. A speed setting of 0 means the Maestro is not limiting the speed, and the speed is only limited by your servo. A speed setting of 1 is the slowest speed setting, and the speed will increase as the setting value increases. You can find more information about how the speed command works in the "Channel Settings" section of the Maestro user's guide. In general, each servo will react differently to the signals it receives, so for the most part settings like speed and acceleration, or commanding a servo to a specific position (such as turning 90 degrees), will depend heavily on your servo and require some trial and error.

Could you try setting the speed to 1 and seeing if you notice a difference? You should be able to see the effects of the speed setting in the "Status" tab of the Maestro Control Center. The ball on each slider indicates the position that the Maestro last sent, so when you move a slider with a speed setting, you should see the ball lag behind the pointer, eventually catching up. Please note that the first target position that a channel sends (after startup or enabling the channel) will not have any speed or acceleration limits. Information about why this happens can be found in the last question listed under the "FAQs" tab of the Maestro product page.

-Brandon]]>
Maestro vs ServoCity 8 Servo ControllerLukeAhttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=103062015-03-01T18:19:07-08:002015-03-01T18:19:07-08:00http://forum.pololu.com/viewtopic.php?p=43433#p43433Forum: Pololu Servo Controllers and ServosIf I have several Maestros at my disposal do I need the ServoCity 8 Servo Controller I own?

Forgive me if it is a dumb question but I am not quite sure I need the Servo City Controller.

ThanksLuke]]>
Angles and speedsD6equj5http://forum.pololu.com/memberlist.php?mode=viewprofile&u=156432015-02-28T12:01:19-08:002015-02-28T12:01:19-08:00http://forum.pololu.com/viewtopic.php?p=43428#p43428Forum: Pololu Servo Controllers and ServosHi forum,I am an interested 'new person' to the Pololu range and have a Maestro 6 servo controller.

Sadly I can not get my head around the speeds and angles I wish the servos to travel to.How might I get, say, servo 0 to move by 90 degrees at a fast rate of knots? And at the same time get, say, servo 5 to move 5 degrees slowlyWhy is speed 0 the same as speed 68? and for that matter 30? Is there any correlation or are these things purely set by trial and error?I'm not intending to pour scorn on Pololu's fine product but I just don't get it.I would appreciate any advice.Many thanksD6]]>
Re: controlling a sequence from a switched inputroyfri89http://forum.pololu.com/memberlist.php?mode=viewprofile&u=156402015-02-28T09:23:32-08:002015-02-28T09:23:32-08:00http://forum.pololu.com/viewtopic.php?p=43426#p43426Forum: Pololu Servo Controllers and ServosI don't have any script to post as I don't know how to write the script for the sequence with the "skip" feature. Do you want me to post the script that I have that does not include the switched input nor the "skip" feature?]]>
Re: controlling a sequence from a switched inputAmandaShttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=131772015-02-27T14:39:47-08:002015-02-27T14:39:47-08:00http://forum.pololu.com/viewtopic.php?p=43421#p43421Forum: Pololu Servo Controllers and ServosHello, Roy.

Can you post your script so I can see what it is doing? Also, when you post your script, please use code tags ([ code ][ /code ] - without spaces) to make your code readable.

- Amanda]]>
controlling a sequence from a switched inputroyfri89http://forum.pololu.com/memberlist.php?mode=viewprofile&u=156402015-02-27T11:39:49-08:002015-02-27T11:39:49-08:00http://forum.pololu.com/viewtopic.php?p=43418#p43418Forum: Pololu Servo Controllers and ServosI want my sequence to "skip" a servo cycle when my switch is inputting "1" or full voltage to the Maestro. I have a Maestro 6 and am using channels 0 and 1 to control servos. Channel 2 is controlling an electric motor through a medium mofset switch. I am ok with wiring the switch to the Maestro per section 7.b. para., Button or Switch. I have read the section regarding writing the instruction for the maestro but am now lost, i.e., this is well beyond my experience level.Can someone provide me with the directions to: 1. Tell the Maestro to delete Channel 2 from the sequence when the switch is "on". 2. Tell the Maestro to include Channel 2 in the sequence when the switch is "off".Also, when Channel 2 is deleted, the Maestro should operate Channels 0 and ! without any delay for Channel 2, in other words, the Maestro should treat Cnannel 2 as being inactive (status box unchecked).Thanks, Roy]]>
Re: Maestro and Shiftbritekevlar87http://forum.pololu.com/memberlist.php?mode=viewprofile&u=156122015-02-24T22:55:44-08:002015-02-24T22:55:44-08:00http://forum.pololu.com/viewtopic.php?p=43382#p43382Forum: Pololu Servo Controllers and ServosThanks for the info!]]>
Re: PWM With Raspberry PiJeremyThttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=102522015-02-23T17:11:29-08:002015-02-23T17:11:29-08:00http://forum.pololu.com/viewtopic.php?p=43367#p43367Forum: Pololu Servo Controllers and ServosHello.

ESCs typically accept RC servo pulses for control, so you probably could use the same commands you are already using for controlling your steering servo with your ESC.

If your ESC needs a PWM input, you can use the "Set PWM" serial command to set the on time and period. You can read more about this in the "Serial Servo Commands" section of Maestro user's guide.

I took some measurements here and it takes about 55ms for the Mini Maestro 24-Channel to update the R, G, and B values and latch them in on a single ShiftBrite using the demo code in our Maestro User's Guide. To update the entire string of 12 would take about 660ms, though you could do something faster if you reuse the values sent to LEDs earlier in the chain since these work like shift registers.

The Maestro Control Center does not have a built-in feature that allows it to be controlled from a game controller. However, it is probably possible to control the Maestro with a game controller from your computer. Unfortunately, we do not have any example code for doing that, so you would probably have to write your own program to interpret the signals from your game controller and then send commands to the Maestro.

We do not know of any projects that involve using a game controller to control the Maestro Control Center, but one of our forum members seems to have gotten his Xbox 360 controller to communicate with his Maestro via serial commands sent from his computer. He posted some code you can look at in this forum thread.

I am sorry you are having trouble with your Maestro servo controller. I am not entirely sure what it is you are doing. It sounds like you suspect you damaged the board, but it also sounds like you are trying to send the Maestro serial commands. If you just connect your Maestro to your computer, does your computer recognize the device?

If your Maestro is working, can you post a picture that clearly shows your connections? Can you also attach a video that shows the behavior of the LEDs? Did anything in your setup change between when it was working and when it stopped working?

- Amanda]]>
Re: MP3 Trigger with Mini Maestro 24 channelsBrandonMhttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=109542015-02-23T12:38:07-08:002015-02-23T12:38:07-08:00http://forum.pololu.com/viewtopic.php?p=43357#p43357Forum: Pololu Servo Controllers and ServosI am not sure which jumper you are referring to. From your original question it sounded like you were triggering the MP3 using the Maestro, but now it sounds like you might be using a physical jumper to start the MP3. From the description in the user's guide, it sounds like the MP3 trigger only looks for the jumpers once it finishes playing the selected MP3. However, there is a on-board navigation switch that can be used to start or stop the current MP3 file. When the switch is in the middle position, pushing it in should start or stop the current MP3. If you want to be able to stop the MP3 from the Maestro, you should be able to send the "Navigation - Start/Stop" serial command.

-Brandon]]>
Re: Control Pan/Tilt using Visual Studio 2013thjdeckershttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=156162015-02-23T00:08:08-08:002015-02-23T00:08:08-08:00http://forum.pololu.com/viewtopic.php?p=43349#p43349Forum: Pololu Servo Controllers and ServosInteresting: I'm using the Maestro for a similar project, but would like to have the ability to control the Maestro Control Center with a a wired XBOX 360 gamepad or alternatively a PS3 controller.

I want to make an RC controlled pan/tilt/zoom head that I constructed for a video camera (for live streaming) computer controlled: see video http://youtu.be/j04zkO31gjA(since the video it has been slightly modified though: I replaced the tilt servo with rod by a continuous one with gears for more accuracy and a larger range; new video still to be posted)

The idea is to use the Maestro to make it manually controllable with a wired XBOX 360 gamepad (or alternatively a PS3 controller) with the extra possibility to store a number of camera positions under the buttons of the gamepad. For the latter I want to add two potentiometers for feedback of the horizontal/vertical camera positions that will be connected to the analog inputs of the Maestro (because for horizontal and vertical I use continous servos).

I think the basic functionality for this is already available in the Maestro Control Center, except for the possibility to control the sliders and buttons of the Control Center by the gamepad (although I haven’t tested this yet, maybe it is possible out-of-the-box?).

Do you know of any other projects that use a game controller to interface with the Maestro Control Center?]]>
PWM With Raspberry Pinweinthalhttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=156152015-02-22T21:58:46-08:002015-02-22T21:58:46-08:00http://forum.pololu.com/viewtopic.php?p=43346#p43346Forum: Pololu Servo Controllers and ServosHello,I'm pretty new to this, so apologies in advance if this is a noobish question. I was gifted a Maestro 24 and it came with absolutely no documentation - I'm trying to configure it to control both a steering servo and for PWM Output from a Raspberry Pi to an electronic speed control on an RC car, but I can't use the Maestro Control Center because it isn't meant for ARM. I've been able to get the steering servo to work just from the command line interface and guessing at the config files, but I was wondering if anyone could share a config file for setting output 12 to do PWM and the associated settings?

Pierre]]>
Red Steady, Yellow Flashing upon executionBodhiScihttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=154902015-02-21T21:25:07-08:002015-02-21T21:25:07-08:00http://forum.pololu.com/viewtopic.php?p=43343#p43343Forum: Pololu Servo Controllers and ServosThank you for helping if you can, I'm a university student working with code in Zbasic and a ZX-1280 devboard to control my Mini Maestro (12V board power and 6V Servo Power, Servos all were tested in Control Center ). I am using the RX pin. Whenever I run the programs, the RED led turns on and Yellow flashes. I see this in the manual:

"When the Maestro is reset in some other way than being initially powered up, the red and/or yellow LEDs blink four times to indicate the reset condition:

-Yellow blinking, red steady: A firmware error resulted in a soft reset. This should never occur during normal usage."

I don't know if this is that situation or what but before I got Zbasic to control the Servos at least in a basic way and now it always does this.

Thanks for your help, I plugged in the USB while a 12V battery was powering the board. It specifically says in the manual that you can do that. Now the USB will not communicate at all, it just turns off after a few yellow and green flashes. Control center doesn't recognize anything. Thanks]]>
Maestro and Shiftbritekevlar87http://forum.pololu.com/memberlist.php?mode=viewprofile&u=156122015-02-21T16:29:22-08:002015-02-21T16:29:22-08:00http://forum.pololu.com/viewtopic.php?p=43341#p43341Forum: Pololu Servo Controllers and ServosI searched the answer for this question but could not find a definite number.

What would be the maximum flashing rate of this setup:

One Maestro running the RGB code alternating between 1023 and 0 hooked up to 12 shiftbrites.

I hope this makes any sense.

Thanks]]>
Re: scripting languageBrandonMhttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=109542015-02-20T15:42:20-08:002015-02-20T15:42:20-08:00http://forum.pololu.com/viewtopic.php?p=43324#p43324Forum: Pololu Servo Controllers and ServosThank you for the clarification. It sounds like you are using the "Restart Script at Subroutine" command to call your sequence of frames on the Maestro. Please note that when using the "Restart Script at Subroutine" command, it is recommended that your subroutines either contain infinite loops or end with a QUIT command (e.g. they should not end in a RETURN command since there is no place to return to). Since you are using the "Get Script Status" command to determine when the subroutine has ended, you should probably be ending each subroutine with a QUIT command. Also, it sounds like you are confused on how the "Get Script Status" command works. This command should return 1 when the script is finished or if it is stopped and return 0 if the script is currently running. If this does not help you solve the problem, I recommend posting your script here, and I would be happy to take a look.

-Brandon]]>
Re: scripting languageomryofechttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=125702015-02-20T07:21:46-08:002015-02-20T07:21:46-08:00http://forum.pololu.com/viewtopic.php?p=43317#p43317Forum: Pololu Servo Controllers and Servoshi Brandon, thanks for the reply!we'll try to clarify what we want to achieve - we're using an arduino nano board & mini maestro 24 channel to control a robot with 19 servo motors. we send serial commands from the arduino board to the maestro board which in turn calls a sequence of frames to move the servo motors. our current goal is to know when a sub-sequence in our script is done so we could move on to the next step.we've tried using "get script status" but, since the WHOLE script is still running, it still returned "1" even after our sequence has ended.

is there a way to get a sub-sequence's status from the maestro? or a way for us to know if any servo motor is still moving?

There is a description and schematic of how to wire a single button or switch to a Micro Maestro in the Attaching Servos and Peripherals section of the Maestro Servo Controller User’s Guide. You can wire multiple switches to the Maestro by using one input channel for each switch. You will need a separate circuit (including the resistor) for each switch.

You can use a multiple way switch to provide different analog voltages to one channel on the Maestro which is set as an analog input. To do this you would simply connect one side of the switch to the Maestro's channel and each of the leads on the other side of the switch to different analog voltages between 0 - 5V.

]]>
Re: Controlling Micro Maestro and from Phyton with Raspberypratyadihttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=155812015-02-17T19:44:22-08:002015-02-19T19:07:16-08:00http://forum.pololu.com/viewtopic.php?p=43268#p43268Forum: Pololu Servo Controllers and ServosHas anyone ported the setAngle function to Python 3 version yet? I've experienced so much trouble trying to convert the command char into bytes before sending it through to the serial write function.

The servo will work well with any target positions between 0-90 degrees, as well as 180 degrees, but when I tried anything between 91 and 179 it would go erracticly or just wont respond at all.]]>
Re: Looking for VB6 sample code for ‘get_ position’AmandaShttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=131772015-02-17T16:50:55-08:002015-02-17T16:50:55-08:00http://forum.pololu.com/viewtopic.php?p=43261#p43261Forum: Pololu Servo Controllers and ServosI added code tags ([ code ] [ /code ] without spaces) to your post to make it easier to read; please use this method to post code in the future.

You are correct. Your output line is not formatted properly. It looks like you were sending some ASCII-encoded strings instead of just sending the binary bytes that are needed. You might try making the output like this:

Also, I noticed that you are trying to read in 10 bytes from the receive buffer. The get position command should only returns 2 bytes (position low 8 bits, position high 8 bits), so you probably would want to change the number of bytes to read from the buffer to 2.

It sounds like your servos or power supply might have some start up characteristics that are causing the problem. Is the Maestro commanding the servos to go to a position as soon as they are powered up? You might try making sure none of the Maestro channels are sending a signal before powering the servos. You can do this by going to the "Status" tab of the Maestro Control Center and unchecking the "Enable" box for each servo before connecting power for the servos. Please note that if you are using a script, you might need to go to the "Script" tab and make sure it is not running (when it is not running the "Run Script" button should be green). Also, if you are powering everything from a single power supply, you might need to disable to "Run script on startup" box, also found in the "Script" tab. If this fixes the problem, you could try adding a delay to let the power supply boot up before the Maestro sends commands to your servos.

By the way, we typically recommend budgeting around 1A per standard size servo. An alternative solution might be powering some of the servos from one supply and the rest from another. The Mini Maestro's servo power rail can be split into banks for doing this. The dashed lines in the diagram below show where the power rail trace (VSRV) can be cut from the bottom of the board:

The values listed in the "Connected to:" drop-down menu are the serial numbers of each Maestro unit connected to your computer. The device number can be found under the "Serial Settings" tab in the Maestro Control Center.

It looks like you are missing the RXTX library. I do not know what IDE you are using, but if you are using Eclipse, you can open the project's properties build path and add the RXTX library to the project.

You can find an example of how to play a specific MP3 from the MP3 trigger using serial commands from a Mini Maestro in this post from Jon. Please note that along with the connection between TX from the Maestro to RX of the MP3 Trigger, you will also need a ground connection between the two boards. Also, you should double check that the MP3 Trigger's initialization file is set up to make it expect serial signals. You can learn more about this initialization file and the MP3 triggers settings in the MP3 Trigger's user's guide. Once you have that set up, you can configure the Maestro's serial settings to match (e.g. it sends the serial signals with the same baud rate).

By the way, if you are only trying to play one MP3, it might be more practical to trigger it using a digital output from a Maestro channel configured as an output, which can be done with the sequencer. According to the "Using the Trigger Inputs" section of the user's guide linked above, when the MP3 Trigger is set up for using the trigger inputs, grounding the pin that corresponds to your MP3 filename should play that file. This can be accomplished by sending a digital low output from a Maestro channel to that pin.

java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriverException in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path

Not long after my last post, I tried a few things and got it to work. (I read Amanda's reply a bit closer)!

Like Amanda said, I had to go to the Properties of each control and set the minimum and Maximum values, then set the "Value" propertie to 1500 which centered the control on startup.

Here is the Modified example code "a bit sloppy, I'm a newbie"

' MaestroEasyExampleVb:' Simple example GUI for the Maestro USB Servo Controller, written in' Visual Basic .NET.' ' Features:' Temporary native USB connection using Usc class.' Button for disabling channel 0.' Button for setting target of channel 0 to 1000 us.' Button for setting target of channel 0 to 2000 us.' ' NOTE: Channel 0 should be configured as a servo channel for this program' to work. You must also connect USB and servo power, and connect a servo' to channel 0. If this program does not work, use the Maestro Control' Center to check what errors are occurring.

''' <summary> ''' This function runs when the user clicks the Disable Servos button. ''' </summary> Sub ButtonDisable_Click(ByVal sender As Object, ByVal e As EventArgs) ' Set target of channels 1,2 to 0. This tells the Maestro to stop ' transmitting pulses on that channel. Any servo connected to it ' should stop trying to maintain its position. TrySetTarget(1, 0) TrySetTarget(2, 0) End Sub

''' <summary> ''' Attempts to set the target of ''' </summary> ''' <param name="channel">Channel number from 0 to 23.</param> ''' <param name="target"> ''' Target, in units of quarter microseconds. For typical servos, ''' 6000 is neutral and the acceptable range is 4000-8000. ''' </param> Sub TrySetTarget(ByVal channel As Byte, ByVal target As UInt16) Try Using device As Usc = connectToDevice() ' Find a device and temporarily connect. device.setTarget(channel, target) ' device.Dispose() is called automatically when the "Using" block ends, ' allowing other functions and processes to use the device. End Using Catch exception As Exception ' Handle exceptions by displaying them to the user. displayException(exception) End Try End Sub

''' <summary> ''' Connects to a Maestro using native USB and returns the Usc object ''' representing that connection. When you are done with the ''' connection, you should close it using the Dispose() method so that ''' other processes or functions can connect to the device later. The ''' "Using" statement can do this automatically for you. ''' </summary> Function connectToDevice() As Usc ' Get a list of all connected devices of this type. Dim connectedDevices As List(Of DeviceListItem) = Usc.getConnectedDevices()

For Each dli As DeviceListItem In connectedDevices ' If you have multiple devices connected and want to select a particular ' device by serial number, you could simply add some code like this: ' If dli.serialNumber <> "00012345" Then ' Continue For ' End If

Dim device As Usc = New Usc(dli) ' Connect to the device. Return device ' Return the device. Next

Throw New Exception("Could not find device. Make sure it is plugged in to " & _ "USB and check your Device Manager.") End Function

]]>
Re: Control Pan/Tilt using Visual Studio 2013Mike C.http://forum.pololu.com/memberlist.php?mode=viewprofile&u=155052015-02-14T07:35:23-08:002015-02-14T07:35:23-08:00http://forum.pololu.com/viewtopic.php?p=43213#p43213Forum: Pololu Servo Controllers and ServosWell, I got that to work, but what I would like to do is have the servo centered and move it left or right.

I can do it in the control center, but I'm at a loss as to how I can transfer that motion into a simple program that would allow me to do it without the control center?

I do not plan to send the script to the Maestro and have it run at startup or anything like that. I just want to control it from the desktop without the control center.

I would just like to have a small ".exe" like desktop app to do that. This is why I chose Visual Studio.

If I could figure out how to put the slider in the center, and slide it left or right from the app to move the servo, that would accomplish what I am after.

I'm a student and I haven't made electronic before, and for my university project, I have to make a droid (like G2 droids in the Star Tours queue at Disneyland).

I bought a mini maestro 24 channels, I made all the animation for the relays, and servos ( a 5 minutes animation) and the software was very easy to use!

Now I want to use the Sparkfun MP3 Trigger to play the music at the same time as the droid moves. I let a "frame 0" to make a delay between the "start" command and the beggining of the animation and I want the MP3 trigger to play only one track. I don't know how to script it, I plugged it (Rx to Tx, Tx to Rx) and when the micro controler is under voltage, it plays the music even if I haven't launched the program.

I'm here to get help with this script, and I have to show the droid in front of a jury in april.

Not so much intrinsically Maestro related, but I figure other Maestro users may have encountered this

I have 10 digital servos (all 6v capable and of various but reputable brands) plugged into my 18 channel Maestro - they are powered via the VSRV line which is powered by a DC benchtop supply set at 6v and at full current allowance - the unit is rated at 5A continuous.

If I run all servos at once under moderate load and speeds the supply seems to cope just fine with the current demands.

However, to get it into a running state I have to plug the servos in after having switched on the supply. If I switch it on with all servos plugged in (even if they are at their home positions already), the supply will say it's providing 2.7V at 5A (or whatever I limit the current to on the supply) and the servos wont operate.

It is only when I disconnect around half of the servos before powering the unit on that it will go straight to 6v and display a nice and expected low unloaded holding current when I switch it on (mA's). I can then plug the rest in one by one, and the supply and system operates as I would expect it to, that is, until I switch it off again and the problem starts over.

I get similar behavior with a 6V wall-wart power supply - although I get slightly different numbers probably as the current is limited to 2A on that particular unit.

Questions:~ Why the 2.7V and seemingly damaging currents upon switch on ?~ How to get around it? Maybe some kind of electronic version of the 'slowly adding the servos' solution ?

Any help appreciated ]]>
Re: Maestro 24 PWM LinuxDavidEGraysonhttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=10152015-02-13T17:25:06-08:002015-02-13T17:25:06-08:00http://forum.pololu.com/viewtopic.php?p=43205#p43205Forum: Pololu Servo Controllers and ServosAfter trying the scripts on a Raspberry Pi here, I was able to reproduce your problem and solve it. The problem is that by default Raspbian or some component of it decides to do some manipulation of the bytes that are sent and received on a virtual COM port. The solution to that is to use the stty raw command on /dev/ttyACM to change those settings. Here are updated scripts that should work for you:

--David]]>
Looking for VB6 sample code for ‘get_ position’APFreakhttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=155532015-02-13T13:58:01-08:002015-02-13T13:58:01-08:00http://forum.pololu.com/viewtopic.php?p=43201#p43201Forum: Pololu Servo Controllers and ServosMini Maestro 12It works in Maestro Control Center.Maestro Control Center says, connected to #00100775Does that mean my device number is 100775?

Trying to send this,Pololu protocol: 0xAA, device number, 0x10, channel numberCan’t get a response other than blank.I have channel 6 configured as an Input.I just want to know if a button has been pushed or not.I know I am antique, but VB6 is the only language I am proficient with.If anyone has any sample code that works I would greatly appreciate it.

Thanks]]>
Re: Maestro 24 PWM Linuxsezamhttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=155222015-02-13T13:44:31-08:002015-02-13T13:44:31-08:00http://forum.pololu.com/viewtopic.php?p=43199#p43199Forum: Pololu Servo Controllers and ServosPlatform Raspberry Pi (model B).Version of the system: Linux raspberrypi 3.18.5+ (Raspbian)Your script prints nothing, even when working in the two terminals.]]>
Re: Maestro 24 PWM LinuxDavidEGraysonhttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=10152015-02-12T11:33:08-08:002015-02-12T11:33:08-08:00http://forum.pololu.com/viewtopic.php?p=43175#p43175Forum: Pololu Servo Controllers and ServosYou should be able to set the PWM output with a serial command without using the Maestro Control Center. I am not sure why it has not worked for you yet.

Thank you for sending your settings file. I looked at it and I did not notice any problems.

Here is a Bash script you can use to read the errors from the Maestro:

#!/bin/bash

DEVICE="/dev/ttyACM0"

byte() { printf "\\x$(printf "%x" $1)"}

{ byte 0xA1 od -N 2 -x -An | tr -d ' ' >&3} > $DEVICE < $DEVICE 3>&2

It prints them in the same hex format as the Maestro Control Center. For example, if it prints "0010", that would be a Serial Protocol Error. After running this script, the red LED should turn off, and running the script a second time should give a result of "0000". By the way, I noticed that this script runs forever without doing anything when I try to run it in Dash, so you should definitely keep using Bash.

Another option for seeing the errors would be to install the Maestro Linux software and run the command "UscCmd --status".

What Linux distribution are you using? What type of hardware your Linux system running on?

--David]]>
Re: Maestro 24 PWM Linuxsezamhttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=155222015-02-11T15:11:01-08:002015-02-11T15:11:01-08:00http://forum.pololu.com/viewtopic.php?p=43164#p43164Forum: Pololu Servo Controllers and ServosIf we use the structure of the "Set Target" to activate LED, then:1. Turn on or work only occur when the period of more than 6000.2. During the LED brightness can not be changed.]]>
Re: Maestro 24 PWM Linuxsezamhttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=155222015-02-11T15:05:37-08:002015-02-11T15:05:37-08:00http://forum.pololu.com/viewtopic.php?p=43163#p43163Forum: Pololu Servo Controllers and ServosThe script uses the same as that given above.Sending a configuration file.When you run under Windows means the program Maestro Control Center all works fine.In the Linux graphical shell is not used. Works only on the command line console. Connects to your computer via SSH.On one of the forums I was answered that PWM can be switched on / off only from the Maestro Control Center, thus limiting the possibilities of this product.Now an error.Error executing the above script and remained. The error code still can not provide, as it works in batch mode, however, when trying to display an error in the file are displayed here such characters: "Є^A!" (Encoding: 1251 - ANSI). Trying to translate into a more readable form.]]>
Re: Calibrate potentiometers?BrandonMhttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=109542015-02-11T14:13:40-08:002015-02-11T14:13:40-08:00http://forum.pololu.com/viewtopic.php?p=43158#p43158Forum: Pololu Servo Controllers and ServosYour code for doing a single decimal would probably work fine. Please note that the when dividing integers like this, the results will get truncated. This is why dividing by 100 and multiplying by 65 (from your second example) is probably not as practical. There is no "percent" command in the Maestro scripting language; you can find all of the mathematical commands under the "Mathematical commands (unary)" and "Mathematical commands (binary)" headings in the "Command Reference" section of the Maestro controller's user's guide.

As far as your question about serial communication, the bytes you listed for the GET_POSITION command would work fine (e.g. you can mix hex and decimal bytes in the same command). For the two cases you gave, the conversion from decimal to hex is simple (1 in decimal is 0x01 in hex and 2 in decimal is 0x02 in hex). You should be able to find a lot of resources online for doing these conversions. For example, a quick Internet search led me to this "Binary to Decimal to Hexadecimal Converter" from Math is Fun.

-Brandon]]>
Re: Maestro 24 PWM LinuxDavidEGraysonhttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=10152015-02-11T13:37:49-08:002015-02-11T13:37:49-08:00http://forum.pololu.com/viewtopic.php?p=43156#p43156Forum: Pololu Servo Controllers and ServosIt sounds like when you ran your Bash script for setting the PWM, the red LED on the Maestro turned on. It also sounds like you are able to control the PWM output fine from the Status tab of the Maestro control center, without the red LED turning on. Is that correct?

The red LED indicates that an error happened. After the red LED turns on, I recommend looking in the "Errors" tab of the Maestro Control Center to see what error occurred.

If you want to continue troubleshooting the script, please use the Maestro Control Center to save a settings file and then post it here as an attachment. Also, please provide the exact command that you typed in your shell to run the Bash script. If the script produces any output (including error messages), please post the entire output here.

--David]]>
Re: Maestro 24 PWM Linuxsezamhttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=155222015-02-11T12:37:33-08:002015-02-11T12:37:33-08:00http://forum.pololu.com/viewtopic.php?p=43153#p43153Forum: Pololu Servo Controllers and ServosI have a startup command from bash red LED (error). As with the command bash read the error code?And if you run through the program Maestro no error.]]>
Re: Maestro 24 PWM LinuxDavidEGraysonhttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=10152015-02-11T12:06:47-08:002015-02-11T12:06:47-08:00http://forum.pololu.com/viewtopic.php?p=43151#p43151Forum: Pololu Servo Controllers and ServosI just tried your Set PWM script on a Linux computer here, with an 18-channel Maestro, and it worked fine. I was able to control the brightness of an LED connected to channel 12, and the specific values that you were using (12, 108) also worked fine.

The PWM-related controls in the "Status" tab of the Maestro Control Center do not always reflect the current state of the PWM output. Whenever you start the Maestro Control Center, the "Enable PWM" checkbox will be unchecked and the parameters will be at their default values.

The "Set PWM" and "Set Target" commands are documented in the "Serial Servo Commands" section of the Maestro User's Guide. You can disable the PWM output by setting the target of channel 12 to 0, using the "Set Target" command.

If you would like to keep troubleshooting the PWM Bash script, please post your Maestro settings file and the exact command you used to run the script. Also, do you see the Maestro's green LED blink briefly when you run the script?

--David]]>
Re: Maestro 24 PWM Linuxsezamhttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=155222015-02-11T11:43:55-08:002015-02-11T11:43:55-08:00http://forum.pololu.com/viewtopic.php?p=43150#p43150Forum: Pololu Servo Controllers and ServosIn general, gradually begin to understand the current problem.When you turn on Maestro, exit "PWM Output" remains off. Accordingly, the line "Enable PWM on channel 12" is also in the off position. In this regard, management of this channel is not possible.Tell me how you can programmatically using bash script in Linux to control the state of the channel (turn on and off)?]]>
Re: Maestro 24 PWM Linuxsezamhttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=155222015-02-11T03:57:56-08:002015-02-11T03:57:56-08:00http://forum.pololu.com/viewtopic.php?p=43145#p43145Forum: Pololu Servo Controllers and ServosMaestro mode is set to "USB Dual Port". The device number is set to 1. The settings file will lay out later.

Spaces after the dollar sign ($) - it's a typo when posting on forums. Corrected.

May suggest a sequence of commands to enable "Set PWM" and "Set Target"?]]>
Re: Maestro 24 PWM Linuxsezamhttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=155222015-02-11T03:45:54-08:002015-02-11T03:45:54-08:00http://forum.pololu.com/viewtopic.php?p=43144#p43144Forum: Pololu Servo Controllers and ServosHere is a full working code bash script (test1.sh):

but the team does not work.]]>
Re: Calibrate potentiometers?geeknesshttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=153812015-02-10T22:48:49-08:002015-02-10T22:48:49-08:00http://forum.pololu.com/viewtopic.php?p=43142#p43142Forum: Pololu Servo Controllers and ServosIn regards to serial communication, if I want to "get_position" from device number 2/channel 1, is the command as follows:

or do I have to convert my device number "2" and channel number "1" to a hex format?If so, how?

Does the number 2 = 0x2 in hex?Does the number 1 = 0x1 in hex?]]>
Re: Calibrate potentiometers?geeknesshttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=153812015-02-10T15:55:11-08:002015-02-11T00:38:33-08:00http://forum.pololu.com/viewtopic.php?p=43135#p43135Forum: Pololu Servo Controllers and ServosDo you have a specific formula to calculate the slope and y-intercept?edit: I realised I just need to set the values out as a linear simultaneous equation and solve for x and y.

Dividing by 100 to enable a slope with 2 decimals would end up being inaccurate as the answer to "100 divide" would be just rounded to the nearest whole number, when it goes to the stack.Is there is a command to get the percentage of the top stack number?It would allow me to use a slope with 2 decimals as it eliminates the "100 divide" step.something like

It sounds like you are trying to write a Bash script to send a serial "Set PWM" to a Mini Maestro 24-channel servo controller, and it is not working. Your script looks similar to the example Bash script in the Maestro User's Guide.

You should make sure that you have set the Maestro to an appropriate serial mode like "USB Dual Port", and that the PWM pin is configured as an output. You should also make sure that the Maestro's serial device number is set to 1 to match the device number that you are sending in your code.

I noticed that you have spaces after the dollar signs ($) in your Bash script. I do not think that will work; you should remove the spaces after the dollar signs.

If this advice does not help, could you please use the Maestro Control Center to save a settings file and then post it here as an attachment? Also, please post your entire Bash script and provide the exact command that you are using to run it. If the script produces any output (including error messages), please post the entire output here.

You can enable PWM by sending the "Set PWM" serial command. You can disable PWM by sending a "Set Target" command, or you can simply set the PWM on time to 0 to make the output go low.

--David]]>
Re: Calibrate potentiometers?BrandonMhttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=109542015-02-10T13:53:32-08:002015-02-10T13:53:32-08:00http://forum.pololu.com/viewtopic.php?p=43133#p43133Forum: Pololu Servo Controllers and ServosYou can find the values you need for fine-tuning your scaling factors by doing a little bit of algebra to find the equation for the line. For example, the 4 times 4000 plus values would create a line with a slope of 4 and a y-intercept of 4000. Using the two points you want as a reference, with some extra margin of safety, (y equals 4200 quarter microseconds when your potentiometer, x, reads 120 and y equals 7800 quarter microseconds when your potentiometer reads 920), you should get a slope close to 4.5 and a y-intercept of approximately 3660. However, since the Maestro does not have script commands for floating point algebra. you can use the following work-around to multiply the reading by 4.5:

begin 1 get_position

dup 4 times #duplicate the potentiometer reading then multiplies the duplicate by 4 swap #swap the duplicated (and multiplied) reading with the original reading 2 divide plus #divide the original reading by 2 and add it to the duplicated reading

I think that is what I needed (I'll try it out), I did not see the "TrackBar" control in Visual Studio 2013 until you mentioned it, But I did find an "HScrollBar" and an "VScrollBar" in the Toolbox under "all Windows Forms".

The bit of code you provided in showing me how to employ it should give me the nudge I need to make things happen!

I'll cross my fingers, and giver it a whirl!]]>
Maestro 24 PWM Linuxsezamhttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=155222015-02-10T09:55:41-08:002015-02-10T09:55:41-08:00http://forum.pololu.com/viewtopic.php?p=43121#p43121Forum: Pololu Servo Controllers and ServosThe boards have access Pololu Maestro PWM.Decided to "play" with the connection of low-power light bulbs.When controlling a computer using the program Maestro Control Center to determine the parameters: start time 12, the period of 108 - at such parameters lamp lights. Changes in the period from 12 to 108 can control the lighting from minimum to maximum.Now the question is how all the same to alter the command set of parameters.Wrote this sequence, according to the documentation for the device Pololu:

Pololu protocol: 0xAA, device number, 0x0A, on time low bits, on time high bits, period low bits, period high bits

Along the way, tell me, how can the same set of enable and disable PWM?]]>
Re: controlling the speed of a servoAdehhttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=154922015-02-10T06:50:17-08:002015-02-10T06:50:17-08:00http://forum.pololu.com/viewtopic.php?p=43118#p43118Forum: Pololu Servo Controllers and ServosHi NathanSORTED!

Thank you for your support and help and for a fantastic product!

RegardsAde]]>
Re: Calibrate potentiometers?geeknesshttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=153812015-02-09T15:00:56-08:002015-02-09T15:00:56-08:00http://forum.pololu.com/viewtopic.php?p=43106#p43106Forum: Pololu Servo Controllers and ServosThanks for the reply Brandon. I know my values are close, but I need them to go closer. For my min values, when the pot goes to 29 I need my servo to go to 1050 or lower, and scaled evenly in between. Similarly at the max when the pot reads 232 I need my servo to go to 1950 or more,and scaled evenly in between. At the mid point I need my servo to read 1500.]]>
Re: Control Pan/Tilt using Visual Studio 2013AmandaShttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=131772015-02-09T14:17:19-08:002015-02-09T14:17:19-08:00http://forum.pololu.com/viewtopic.php?p=43101#p43101Forum: Pololu Servo Controllers and ServosHello.

You would probably need to add a button or track bar component to the main form and call TrySetTarget in the event handler subroutine. I added a track bar event to the MaestroEasyExampleVb example using Microsoft Visual Studio and tested the code with a Maestro and a servo. It worked. Here is the event handler code:

I set the minimum and maximum properties of the track bar to 1000 (1ms) and 2000 (2ms), but you could set them to 4000 and 8000 if you do not want to perform calculations in the code.

By the way, in case you did not notice, you might consider using the Maestro Control Center. You can download the Maestro Servo Controller under the "Resources" tab on any of the Maestro product pages. The program contains a slider control feature for each channel, which can be found under the "Status" tab.

It looks like you are using the example script from the "Using an analog input to control servos" heading of the "Example Scripts" section of the Maestro user's guide. You might be able to fine-tune that script a little bit more (like you mention), but it looks like it should be doing very close to what you are asking for.

For example, when your potentiometer is at the lowest point, the value of 29 in the "Status" tab is read as about 116 in your script. After multiplying by 4 and adding 4000, you should end up with 4464 quarter microseconds (or 1116 microseconds). Similarly, a value of 232 for your upper limit results in a target of 7712 quarter microseconds (or 1928 microseconds).

By the way, the inputs on the Maestro are intended for 5V, so you should make sure that your potentiometer signal does not exceed 5V when it is at its maximum output.

-Brandon]]>
Re: Calibrate potentiometers?geeknesshttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=153812015-02-09T03:44:44-08:002015-02-09T03:44:44-08:00http://forum.pololu.com/viewtopic.php?p=43094#p43094Forum: Pololu Servo Controllers and ServosI should clarify that when my Pot is at its lowest I want my servo to be at about 1050.When the pot is at its max I want my servo at about 1950.I need to have all the pot values in between the min and max to be scaled evenly

I believe the pot is restricted mechanically. It is embedded within an RC transmitter 2 axis control stick. Usually in the RC transmitter there is an option to calibrate the sticks/switches so that the computer knows what values to use in the formula to create the output value.

Im hoping that since I know my min and max values of my pot (29 & 232), I can modify my script to get the servo values I need.

________Min Values____Max Values________Pot__Servo____Pot__ServoStatus___29___1115_____232__1920Stack___115___4460_____918__7672]]>
Calibrate potentiometers?geeknesshttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=153812015-02-09T00:25:23-08:002015-02-09T00:25:23-08:00http://forum.pololu.com/viewtopic.php?p=43093#p43093Forum: Pololu Servo Controllers and ServosIs there a way to calibrate my potentiometers attached to my Maestro 12?I am seeing that the range goes only from 29-232 in the status tab of the MCC.I am using a variable power source which I have adjusted (to 5.372V) to get the middle of the pot to be exactly mid range.The pot is a 2.4k linear pot.This is the code im using:

begin 1 get_position 4 times 4000 plus 0 servorepeat

]]>
Control Pan/Tilt using Visual Studio 2013Mike C.http://forum.pololu.com/memberlist.php?mode=viewprofile&u=155052015-02-07T16:08:10-08:002015-02-07T16:08:10-08:00http://forum.pololu.com/viewtopic.php?p=43084#p43084Forum: Pololu Servo Controllers and ServosHi, I have the Maestro 6-Channel with two Hitec servos attached.

I'm new to VB programming. I've been able to load and run the "MaestroEasyExample". and it works.

However, I would like to modify this example to using either a button-down click event or use a slider to move the servos and have them stay there when I have them in the orientation I like.

I plan to only use this small program to operate the Maestro connected to the PC from my desktop.

I've sorted through many pages in this forum, and found next to nothing regarding programming examples using Visual Studio 2013 save the above mentioned "MaestroEasyExample"

It should be simple, and I'm sure someone must've already done something very similar, any help would be appreciated.]]>
Re: controlling the speed of a servonathanbhttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=137002015-02-05T17:25:17-08:002015-02-05T17:25:17-08:00http://forum.pololu.com/viewtopic.php?p=43064#p43064Forum: Pololu Servo Controllers and ServosHello, Adrian.

From the configuration file you sent, it looks like you used the sequencer to generate the script, which does not save channel settings like speed and acceleration. The default speed and acceleration for each channel are set to 0, and will make the servos move as fast as they physically can. To limit these, you can change the values in the "Channel Settings" tab and then click the "Apply Settings" button at the bottom right of the program. These settings will then take effect for all movements on the channel after the first.

You can also change the speed or acceleration values of each channel at any time within a script. To do this, you can use the "SPEED" and "ACCELERATION" commands. You can find more about these commands in the "Command Reference" section of the Maestro User's Guide. Please note that after setting a speed or acceleration value within a script, subsequent movements of that servo will use those settings until they are changed again.

-Nathan]]>
Re: controlling the speed of a servoAdehhttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=154922015-02-05T12:05:47-08:002015-02-05T13:58:35-08:00http://forum.pololu.com/viewtopic.php?p=43059#p43059Forum: Pololu Servo Controllers and ServosHi NathanThanks for the quick reply.Please find below:

Thank you in advance!Adrian]]>
Re: controlling the speed of a servonathanbhttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=137002015-02-05T11:44:51-08:002015-02-05T11:44:51-08:00http://forum.pololu.com/viewtopic.php?p=43058#p43058Forum: Pololu Servo Controllers and ServosHello, Adrian.

Can you post your Maestro settings file (which includes your script)? You can save the settings file in the Maestro Control Center by selecting File->Save settings file. Could you also tell me what channels the jerky servos are connected to?

-Nathan]]>
Re: Maestro 24 GetPosition C++vman_vhttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=154102015-02-05T09:01:07-08:002015-02-05T09:01:07-08:00http://forum.pololu.com/viewtopic.php?p=43057#p43057Forum: Pololu Servo Controllers and ServosThank you so much for your help! it works now!]]>
controlling the speed of a servoAdehhttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=154922015-02-05T05:07:05-08:002015-02-05T05:07:05-08:00http://forum.pololu.com/viewtopic.php?p=43056#p43056Forum: Pololu Servo Controllers and ServosHi thereI am a newbie and have built an animatronic pilot figure for an RC aeroplane and obviously am using a mini maestro to control the head and one arm.

My question is:Everything is programmed and scripted and works fantastically!I cannot figure out for the life of me how to make the servos move from end to end in a slow and smooth action. I have tried playing with acceleration and speed settings and with little result. At the moment they are very jerky and quite fast!

Can one of you awesome people advise me please what to do, because it has me beat!

I was re-inventing your wheel ]]>
Re: Maestro 18 pwm scripteb2gaihttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=154672015-02-04T13:58:54-08:002015-02-04T13:58:54-08:00http://forum.pololu.com/viewtopic.php?p=43048#p43048Forum: Pololu Servo Controllers and ServosThank you so much Amandas.I could understand all well and works perfectly.]]>
Re: Maestro 18 pwm scriptAmandaShttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=131772015-02-03T17:34:30-08:002015-02-03T17:34:30-08:00http://forum.pololu.com/viewtopic.php?p=43041#p43041Forum: Pololu Servo Controllers and ServosI added [ code ] tags to your script to make it easier to read; please use this method to post code in the future.

I am not entirely sure why you used a value of 12 for the PWM period, but it seems like you are intending to use 12 to indicate the channel of the PWM pin, which is unnecessary, since there is only a single PWM pin on each of the Maestros, so you should not need to specify which channel it is on.

I modified your code to use a larger period and tested it with a Mini Maestro using an LED on the PWM channel, and a potentiometer on pin 1, and it worked for me. I used a larger number because the period needs to be larger than the onTime value (or pulse width). Here is the code:

By the way, if you were confused about how to use the PWM command, the "Command Reference" section explains how each command uses values on the stack.

- Amanda]]>
Re: Maestro 24 GetPosition C++AmandaShttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=131772015-02-03T16:59:34-08:002015-02-03T16:59:34-08:00http://forum.pololu.com/viewtopic.php?p=43040#p43040Forum: Pololu Servo Controllers and ServosI tested your code using the MaestroEasyExampleCpp example in the USB SDK. From the errors, it looks like a conversion issue between C# and C++. I modified the line where you declared [c]servos[c] and it compiled successfully. Here is the code I used:

You can trigger an RC switch with relay that is in the default configuration by sending it pulses longer than 1700us with one channel on the Maestro.

You can see an example script showing how to control servos with a button or switch (like the digital output of the RC Switch with digital output) under the "Using a button or switch to control servos" heading in the "Example Scripts" section of the Maestro user's guide.

-Derrill]]>
Re: Maestro 18 pwm scripteb2gaihttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=154672015-02-03T12:54:46-08:002015-02-03T17:35:19-08:00http://forum.pololu.com/viewtopic.php?p=43036#p43036Forum: Pololu Servo Controllers and ServosAmandas thanks for your help.I took the script example for servo, but does not work.Sorry but my knowledge of programming are really very low, maybe if you could elaborate a simple example then I can try changing values.Thank You.

begin 1 get_position 4 times 4000 plus 12 PWMrepeat

]]>
Re: Building a panorama picture taker with a gopro cameraalsoareshttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=154542015-02-03T11:18:08-08:002015-02-03T11:18:08-08:00http://forum.pololu.com/viewtopic.php?p=43035#p43035Forum: Pololu Servo Controllers and ServosHi Derril, you are right, thank you for helping.

So, you said that I can trigger a maestro 6 channel with a RC switch with a digital output, that's ok, and I can also trigger a gopro shutter with the RC switch with a relay. But can I use one maestro output channel to trigger the RC switch with a relay?

I'm not familiar with the maestro controller, but it doesn't seem difficult to program a sequence. The sequence I'm planning to implement also involves sending a command to a RC switch with a relay, which in turns trigger the gopro shutter. Can I do that? As I could see, those maestro channels simply output pwm signals to servos, like a receiver does.

The entire sequence would be the following:1) A switch in my transmitter is activated and a receiver channel sends a command to the RC switch with a digital output, which in turn activate a sequence in the maestro controller.2) Following the sequence steps, servos are controlled in a way that I can rotate the gopro camera to predefined degrees3) One of these sequence steps I mentioned activates the RC switch with a relay, which in turn triggers the gopro shutter.

Is there any example in this forum or faq page that demonstrates how to activate a maestro controller with the RC switch with a digital output?

Thank you. I'm about to order but have to be sure I'll not make any mistake...

Andre Soares]]>
Re: Maestro 24 GetPosition C++vman_vhttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=154102015-02-03T10:18:07-08:002015-02-03T10:18:07-08:00http://forum.pololu.com/viewtopic.php?p=43034#p43034Forum: Pololu Servo Controllers and ServosHello, i have a problem using getVariables function. From the AdvancedExample i saw this function:

and i get errors that 'servos' variable is undefined and that 'void Pololu::Usc::Usc::getVariables(Pololu::Usc::MaestroVariables %)' : cannot convert parameter 1 to 'Pololu::Usc::MaestroVariables %'

how do i define 'servos' variable and use getVariables function using c++?

Thank you in advance for your help]]>
Re: Building a panorama picture taker with a gopro cameraDerrillhttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=103542015-02-02T16:48:23-08:002015-02-02T16:48:23-08:00http://forum.pololu.com/viewtopic.php?p=43025#p43025Forum: Pololu Servo Controllers and ServosIt looks like you want to replace a physical switch that just connects two wires where neither of them are necessarily ground, so the switch with MOSFET is probably not appropriate, but you could use our RC Switch with Relay.

We do not have example code specifically for controlling the PWM output of the Mini Maestros with a potentiometer. However, you could modify the "Using an analog input to control servos" example script, which can be found under the "Example Scripts" section of the Maestro user's guide, to enable and change the parameters of the PWM output channel on your Maestro based on the input from your potentiometer. You can learn more about the PWM command under the "Command Reference" section of the Maestro's user's guide.

If you try making a script and have questions or problems, you can post the code here, and I would be happy to help.

- Amanda]]>
Re: Building a panorama picture taker with a gopro cameraalsoareshttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=154542015-02-02T11:35:36-08:002015-02-02T11:35:36-08:00http://forum.pololu.com/viewtopic.php?p=43015#p43015Forum: Pololu Servo Controllers and ServosHello Derril, thank you for replying.

When the gopro top button is pressed it closes a circuit and a picture is taken or video record starts. A gopro camera can be modified, soldering the PicoSwitch wires to the leads of the trigger switch and when a receiver pulse reaches the PicoSwitch, a picture is taken.

Can I do that with your rc switch?]]>
Maestro 18 pwm scripteb2gaihttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=154672015-02-01T13:50:23-08:002015-02-01T13:50:23-08:00http://forum.pololu.com/viewtopic.php?p=43009#p43009Forum: Pololu Servo Controllers and ServosHello.I have a maestro 18 servo controller, i need to control the pwm (pin 12) using a potentiometer in a input pin, my programing knowledge is very very low and i don´t know how is the script.someone can put some example?????thanks.]]>
Re: Building a panorama picture taker with a gopro cameraDerrillhttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=103542015-01-30T16:52:54-08:002015-01-30T16:52:54-08:00http://forum.pololu.com/viewtopic.php?p=42998#p42998Forum: Pololu Servo Controllers and ServosHello, Andre.

The continuous rotation servo is probably not the best choice for that application as it does not offer position control, only speed control. You might consider using a "sail winch servo" or "multi-turn servo" instead. An Internet search for those terms should direct you to something useful. The Maestro cannot accept the RC hobby signals that the RC receiver will send, but you could use a something like our RC Switch with Digital Output to turn the RC signal into a logical high and low signal, which Maestro channels configured as inputs can read.

I do not know how you are intending to use the RC Switch with Small Low-Side MOSFET to trigger your GoPro. If you can describe in more detail how you intend to use it, I might be able to offer some insight to whether it will work.

-Derrill]]>
Building a panorama picture taker with a gopro cameraalsoareshttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=154542015-01-30T12:39:38-08:002015-01-30T12:39:38-08:00http://forum.pololu.com/viewtopic.php?p=42988#p42988Forum: Pololu Servo Controllers and ServosHi, I've been looking around for a while, trying to find the right components for a device that will carry a gopro camera, hanging from a multicopter, and will be able to take 5 or 6 sequential pictures in a circle, automatically rotating and stopping the camera horizontally at certain degrees. For example, if I program the device to take 5 pictures, the camera will sequentially point to the vertices of a pentagon, stopping at each vertex and taking a picture. After a predetermined amount of time, the device spins again and the camera stops pointing to the next vertex direction, takes another picture, and so on, until it finishes rotation pointing to the starting direction, the uppermost pentagon vertex.

The purpose of all this stuff is to get sequential pictures that I can stitch together using a panorama stitcher picture. I could simply try to rotate the multicopter with a pan command from my transmitter while the camera automatically takes sequential pictures in timelapse mode, but there will always be some vertical and horizontal drift when a yaw command is applied and lots of undesired pictures are taken.

So, I came to this site and it seems like I have found the right products for that, but I need some help to confirm whether they are applicable to my project or not.

My requirements are:1) Trigger the micro maestro 6-channel from a receiver pwm channel, so that it starts the rotation sequence with the continuous rotation servo. I'll program a switch from my transmitter to start the sequence.

2) Program the meaestro controller to send a pulse to the continuos rotation servo to move and stop for a predetermined time at the next pentagon(or hexagon) vertex position3) After stopping at the vertex position, the maestro controller sends a pulse to the Pololu RC Switch, which then triggers a modified gopro camera to take a single picture

The camera will be hanging from a rounded carbon plate, where the continuous rotation servo is fixed.

I hope I've made things clear, and sorry for my English, I'm from Brasil and my native language is Portuguese.

In order for the Maestro Control Center to work the Maestro needs to be connected to a USB port. This can be a problem if you wish to be free of wires. It's still possible to connect to the Maestro with various wireless boards, for programming. However, you won't have access to the Maestro Control Center unless your wireless connection allows the Maestro to enumerate. "Enumerate" is the the word used to describe the connection between the hardware and the drivers/software in the lingo of the USB mafia.

This clever device creates a virtual USB port that will allow hardware to enumerate wirelessly. The solution isn't cheap but it works well.

If you've read this far you'll fall into one of two categories.

1) You can't believe I paid so much for a wireless connection because you could have done it ________!! (insert something here, better, quicker, cheaper, with programming, rolling your own, magic, unicorn toenails, etc.)

Someone else on our forum had a similar question; you can find our response to it here.

- Amanda]]>
Maestro 24 GetPosition C++vman_vhttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=154102015-01-26T10:27:35-08:002015-01-26T10:27:35-08:00http://forum.pololu.com/viewtopic.php?p=42900#p42900Forum: Pololu Servo Controllers and ServosHello, for my school project i am writing a program in C++ to control camera movements which are controlled by the servos. I downloaded MaestroEasyExampleCpp project and i want to build on the top of that my own user interface. I understand how to set the target position, but i would like to also to have a button to click to display the current position of the servo. what command can i use to get current position of the channel?

Thank you in advance for your help.]]>
Re: Polou Maestro - cant use script when usb is not conectedBe0wulffhttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=153842015-01-22T12:08:06-08:002015-01-22T12:08:06-08:00http://forum.pololu.com/viewtopic.php?p=42852#p42852Forum: Pololu Servo Controllers and ServosU 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 :)]]>
Re: Something new for the maestro range.geeknesshttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=153812015-01-21T22:06:27-08:002015-01-21T22:06:27-08:00http://forum.pololu.com/viewtopic.php?p=42846#p42846Forum: Pololu Servo Controllers and ServosThanks again Brandon.

I've ordered my Maestros and will test my script out. If I have issues, I'll get back to you.]]>
Re: Something new for the maestro range.BrandonMhttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=109542015-01-21T17:44:20-08:002015-01-21T17:44:20-08:00http://forum.pololu.com/viewtopic.php?p=42844#p42844Forum: Pololu Servo Controllers and ServosI do not think it would be very practical to try to use the Maestro to output PPM signals since the Maestro does not provide the tools necessary to have precise control over the sequence of pulses sent.

To answer your questions about your 3 position switch, you can configure it so that it gives a different voltage (between 0V and 5V) at each position and read it using an analog input channel (i.e. a Maestro channel between 0-11 configured as an input) and do some processing or use separate channels for each position. Please note that even though channels 0 through 11 are analog inputs, you can use them to read digital signals (such as switches) too. As for the digital pins on the 24-channel Maestro (pins 12-23), they can all be individually configured as servo outputs, digital inputs, or digital outputs. More information on this can be found in the "Channel Settings" section of the Maestro user's guide, under the "Mode" heading. They should not have any noticeable difference in precision over the analog pins.

I only briefly looked over your script, but I noticed that there are several BEGIN/REPEAT blocks that will never be reached because the infinite loop before them never terminates. If you ran your current script, your first BEGIN/REPEAT block would be the only part of the code reached. Also, in your maestro_2 and maestro_3 subroutines, I am not sure what serial commands you are trying to send. It looks like you are trying to send 0xFF along with another integer, but you call serial_send_byte three times with only those two arguments on the stack. I recommend waiting until you have a Maestro to test some scripts on so you can become a little more familiar with it first. If you still have questions about scripting then, and can post simplified code that demonstrates the problem, I would be happy to look over your revised script.

--David]]>
Re: Recognizing Maestro 6-channel with Windows 7BobbyChttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=153702015-01-21T14:49:58-08:002015-01-21T14:49:58-08:00http://forum.pololu.com/viewtopic.php?p=42836#p42836Forum: Pololu Servo Controllers and ServosJohnathan, Thanks for the quick reply. I didnt think it was the cable, as it was new, but it was. I have a new one and the controller was recognized. Thanks again for your help, I'm off to play. Bobby]]>
Re: Recognizing Maestro 6-channel with Windows 7JonathanKoshhttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=92692015-01-21T13:50:36-08:002015-01-21T13:50:36-08:00http://forum.pololu.com/viewtopic.php?p=42835#p42835Forum: Pololu Servo Controllers and ServosHello.

I am sorry you are having trouble getting your computer to recognize your Maestro. I moved your post since your computer is not recognizing the Maestro at all, and the forum member in the other thread you posted in was able to get the computer to recognize the Maestro, so it seems like you have a separate issue.

Can you verify that your USB cable works by connecting it to other devices and seeing if they can be recognized by your computer? Can you try using different USB ports or a friend's computer? Can you also post pictures that show the pins on the inside of the USB connector on the Maestro?

-Jon]]>
Re: Controlling a Digital Giant Servo HD-1235MGtimb12957http://forum.pololu.com/memberlist.php?mode=viewprofile&u=153912015-01-21T05:35:06-08:002015-01-21T05:35:06-08:00http://forum.pololu.com/viewtopic.php?p=42829#p42829Forum: Pololu Servo Controllers and ServosThanks Grant for the input. I will give this a try.]]>
Re: Something new for the maestro range.geeknesshttp://forum.pololu.com/memberlist.php?mode=viewprofile&u=153812015-01-20T21:57:16-08:002015-01-20T21:57:16-08:00http://forum.pololu.com/viewtopic.php?p=42820#p42820Forum: Pololu Servo Controllers and ServosSo I have built some code for my purpose, just starting by having 8 servo outputs.Im using 3 Maestro12sMaestro 1 as the main board, outputting the signals.Maestro 2 is the pots inputs.Maestro 3 is the switch inputs.

Maestro 1 will be connected to the PC by USB. The others will be daisy-chained by serial ports.

Questions:

In the sub routines "sub maestro_2" and "sub maestro_3", Im assuming I change the 0xFF lines to suit the actual addresses of the Maestros?

Are my calculations correct in the calculations notes section of the code?

What format can I save this file in?

Is the code correct? (I don't have my Maestros yet, so I can't test)

Are there any ways I can improve this code?

Would it be better to have the code for the pots on the pot Maestro (2) and the switch code on the switch Maestro, and have them "push" the signal to Maestro 1, rather than have Maestro 1 do all the work by "pulling" the signal from the other maestros?

#Calculation Notes:#Pots range from 0-1023#Scale up to get full range 4000-8092 = 1-2ms#If an exact pulse width is required, calculate as follows, to get the required servo value:#P=Pulse width (ms)# P/(2/8092)# =P/.0002472