Shop OBEX P1 Docs P2 Docs Learn Events
Specs Servo 900-00005 incomplete, errors in Arduino example — Parallax Forums

Specs Servo 900-00005 incomplete, errors in Arduino example

About 30 years ago I have been working in industrial robotics. A few months ago my daughter asked me if I could be of some help with the part of her project involving two Parallax Standard servos controlled by the Arduino Uno microcontroller. The project has been quite succesfull, and I enjoyed our discussions and little researches.

The little servos at first were completely black boxes to me, very different from the big DC-electromotor controls 30 years ago. The product specification in https://www.parallax.com/product/900-00005 did't help much to reveal how these black boxes work. Fortunately in http://learn.parallax.com/kickstart/900-00005 an explicit example is shown of an Arduino program (= 'sketch').

According to the kickstart example you could use the following sketch to send your myServo after five seconds to an angle of 30 degrees:

#include <Servo.h> // Use Servo library, included with IDE
Servo myServo; // Create Servo object to control the servo

void setup() {
myServo.attach(9); // Servo is connected to digital pin 9
}

void loop() {
delay(5000); // Wait 5 seconds
myServo.write(30);// Rotate servo to shaft angle of 30 degrees
}

When you look at the servo.h and servo.cpp files in the Arduino library, you'll see that in this little sketch above your little myServo will in general make two rotations:
  1. immediately after executing the attach(9) command the servo moves to its 'default position' of 87 degrees.
  2. two seconds later it moves to 12 degrees.

The most important error in the sketch above is the command attach(9), after which the default Arduino pulsewidth values of 0 and 180 degrees are used. Instead of attach(9) one should use attach(9,750,2250), introducing the actual minimal and maximal pulsewidth of the Parallax Servo. The two rotations now will be to 90 and 30 degrees (instead of 87 and 12 degrees).

To avoid the first rotation you may omit the delay(2000) above, then 30 degrees overwrites the default angle before the servo starts moving.

Well, it would have been nice - but perhaps less fun :lol: - if the 900-00005 specs included the information that for this servo a shaft angle of 0 degrees corresponds to a pulswidth of 0.750 ms and a shaft angle of 180 degrees to 2.250 ms. Fortunately the default Arduino values (0.566 and 2.400 ms) didn't destroy our servos!

So far this (easy) part of the Parallax Servo, in another post I want to continue with questions about the subsystems within the black boxes.

PS: I tried to add a new tag (Arduino Uno), but only existing tags show up (Arduino Yun, etc). Maybe you can add it?

Comments

  • PPS: 2 seconds 5 seconds and delay(2000) delay(5000)
  • Duane DegnDuane Degn Posts: 10,588
    edited 2015-08-15 20:51
    The definition of "servo" seems to change depending on the group using the term. I think many people would cringe when hearing the little hobby servos referred to as "servo motors" but it's not uncommon to see them called "servo motors" on hobby robotics sites.

    I think "hobby servo" is probably the term which results in the least confusion.
    Leo51 wrote: »
    Well, it would have been nice - but perhaps less fun :lol: - if the 900-00005 specs included the information that for this servo a shaft angle of 0 degrees corresponds to a pulswidth of 0.750 ms and a shaft angle of 180 degrees to 2.250 ms.

    I think this information is included in the pdf documentation.

    BTW, welcome to the forums. We hope you stick around and share some of your knowledge.

    I don't use the Arduino much and I don't think I've ever used one to control hobby servos so I won't comment on the code (aka "sketch").

    I'm a big fan of the Propeller microcontroller and I've done lots of servo projects with the Propeller. Since you're new here, you may not have seen my 32 servo demo.



    I think all those servos are fun to watch and I post this video whenever there's a topic which justifies mentioning the demo.

    One of the nice things about the Propeller is you can use the separate processors (aka "cogs") to control devices without needing to constantly update the device from the main loop. While other microcontrollers are certainly capable of driving lots of servos and monitoring multiple sensors, I think the Propeller's architecture makes writing programs for these complex task easier than using a single processor microcontroller.

    Here's another video I post whenever I feel I can get away with it:



    My "Halloween Hex" is controlled with a single QuickStart board. The multiple processors make driving the LEDs and controlling the servos relatively easy. Here's a link to the forum thread about the robot.

    I have a "Fun with Spin" playlist on YouTube showing some of my Propeller based projects.



    As you can probably tell by now, I think the Propeller is a lot of fun to program and I think it makes a great controller for robotic projects.

    I have a list of links to Propeller tutorials in my "index". Here's a link to the post with these links. I hope you give the Propeller a try.

    Even if you don't try the Propeller, I hope you stick around to talk about robots and "servos".
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2015-08-16 12:47
    Sorry that you feel Parallax led you astray. It appears you missed something you need to learn about the Arduino IDE. Possibly you selected the wrong Arduino code, not for the Uno.

    Parallax really doesn't have any control of what the Arduino libraries might mistakenly do. And it is nearly impossible to keep up with all the various boards that the Arduino brand comes out with.

    So it seems that trusting Arduino code and documentation sources, 30 was supposed to produce timing that positions the servo at 30 degrees. It could be your Arduino Uno board has a non-standard crystal, or you used an Arduino library intended for another board.

    https://www.arduino.cc/en/Reference/Servo
    https://www.arduino.cc/en/Reference/ServoWrite

    In any event, no harm done. These servos pretty much just shudder when they are turned to the limits of their rotation.

    These servos are standard to the r/c industry. The timing is always the same, but Arduino boards are 8Mhz, 16Mhz, 48Mhz and so on and they are going to demand you verify that any timing example has been adapted to the board you are using.

    It simply seems that you specified a board other than the Arduino Uno and got different timing.
  • It simply seems that you specified a board other than the Arduino Uno and got different timing.

    I don't think that was the issue.

    If using "attach(9,750,2250)" worked as expected, then I don't think the wrong timing was selected in the IDE.

    The board selection issue was in selecting which forum tag to use. I also wasn't able to add my own tag when I wanted to add one with one of my previous posts.

    I think Leo51 identified a problem in Parallax's Learn code not in the Arduino library.
  • These servos are standard to the r/c industry. The timing is always the same

    While the timing of various RC servos are generally similar, there's a lot of variation between brands and models of servos. I think it's safe to assume a servo can use pulse length between 1,000us and 2,000us but the exact endpoints vary a lot and the end points are often not documented.

    Another characteristic which varies among servos is the relationship between pulse length and angle. 1,500 is almost always the center but the position of the servo at 1,000us and 2,000us varies a lot.

    Along with varying pulse width endpoints the angular range of various servos at these endpoints varies a lot. It's not uncommon to have servos with a range of 90° between endpoints. Servos with a range of 180° are relatively rare.

    The servos used in my Halloween Hex have a different pulse to angle factor than the servos used in my mini hexapod.

    So your "timing is always the same" is sort of true. The direction of rotation is usually the same among hobby servos and the center position timing is always (as far as I know) corresponds with a 1,500us pulse but the other characteristics vary a lot among servos.

    BTW, this seems like a great excuse to share yet another Propeller controlled servo project. My QuickStart servo tester makes it relatively easy to find the endpoints of a servo.

    While I think my QuickStart servo tester is useful, anyone doing projects with hobby servos should pickup several inexpensive servo testers from ebay or other source.

    $_35.JPG

    Here are some selling for $1.45 shipped.

    http://www.ebay.com/itm/Multi-Servo-Tester-3CH-ECS-Consistency-Master-Checker-Speed-Controler-CCPM-SS/321463863858?_trksid=p2047675.c100005.m1851&amp;_trkparms=aid=222007&algo=SIC.MBE&ao=1&asc=29979&meid=787d11b8e1b347ba8a3b1dec0919dc5e&pid=100005&rk=3&rkt=6&mehot=pp&sd=191536089516

    Erco recommended these to me (and sent me my first one) and I found he was right about these little devices being very useful.
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2015-08-16 05:43
    The Arduino Learn code is correct. Unless the Arduino's own code is also faulty ... but, er, no. It's not, either.

    The Learn code is merely an extrapolation of the Arduino basic sample:

    https://www.arduino.cc/en/Reference/ServoWrite

    The Learn example explicitly does NOT mention anything about position in degrees. The Arduino sample does, but knowing there are people who expect an analog toy servo motor to be precise, that wording was left off the Learn code to describe the sketch. The 0-180 position only approximates degrees.

    Also, you provided your own mis-description of what you expected your code snippet to do. No where does the Learn code make the claim you say it does. The actual example presented faithfully describes what the servo will do.

    Min/max is optional, as noted in the Arduino documentation and not included in the Kickstart because the examples are made to be brief and to the point. Specific testing with Parallax servos shows that the default values do not push beyond physical stops.
  • I'm glad to get your quick and adequate replies :D

    at Duane Degn: thanks for all exciting examples and useful information.
    at Loopy Byteloose: Duane is right, i simply did not succeed to enter a new tag.
    at GordonMcComb: I.m.o the Arduino Learn code is not correct. It would be correct if
    • attach(9) would be replaced by attach(9,750,2250), or
    • the default values MIN_PULSE_WIDTH = 544 and MAX_PULSE_WIDTH = 2400 in Arduino's servo.h would be replaced by 750 and 2250

    The Arduino code itself is correct: you just have to use the correct command mentioned above, or change their default min/max values into the Parallax min/max values. These min/max values are indeed optional: you don't have to use them when your min/max values coincide with theirs, or when you dont care about accuracy and the risk of servo damage.

    The Learn example uses the Arduino commands write(0), write(90) and write(180). When you use the standard Arduino servo library as you do in the Learn example, these commands are translated in servo.cpp to writeMicroseconds(544+(0/180)*(2400-544))=writeMicroseconds(544), writeMicroseconds(544+(90/180)*(2400-544))=writeMicroseconds(1472) and writeMicroseconds(544+(180/180)*(2400-544))=writeMicroseconds(2400).

    The correct commands should of course be writeMicroseconds(750), writeMicroseconds(1500) and writeMicroseconds(2250).

    The Parallax Standard Servo specs start with
    "The Parallax Standard Servo is ideal for robotics and basic movement projects. It can hold any position over a 180-degree range and is easily interfaced with any Parallax microcontroller.

    Key Features:
    • Holds any position between 0 and 180 degrees
    • ...

    I don't understand why you want to keep it a secret, but 0 --> 180 degrees correspond very good to a pulsewidth of 750 --> 2250 us. This correspondance even applies more or less for pulse widths slightly larger or smaller, so 544 us corresponds to about ((544-750)/(2250-750))*180 = - 25 degrees and 2400 us to about ((2400-750)/(2250-750))*180 = 198 degrees.
    ... the examples are made to be brief and to the point.
    Advise:
    make your example even more to the point by replacing attach(9) by attach(9,750,2250).
    Also: consider mentioning the 0 - 180 degrees (= 750 - 2250 us) range in your specs.

    I don't blame you for making a tricky error in your learn example (I make such errors all the time), but I would when you just ignored and trivialized it.

  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2015-08-16 18:00
    Well. my own point of view is that Arduino creates the expectation that you will get exactly 30 degrees from cut and paste of the code.

    The Arduino has a very different approach to teaching. It buffers the learner from much of what actually needs to be done to get precision.

    Parallax Learn is there to mainly support Parallax product programing -- the Propeller 1 and the BS2, not the Arduino product line.

    I am a bit surprised to hear there is an Arduino Learn effort. It is up to Arduino to support learning their microcontrollers including preventing damage that might occur by what their code libraries try to simplify.

    +++++++++
    You might have noticed that the Parallax examples for Parallax products are more informative. That is really the way Parallax prefers to educate. And safety is a big issue.

    It is next to impossible to provide Arduino code that teaches these pragmatic issues without upsetting the users expectations for it to be easy and simplistic.

    +++++++++
    Parallax can only provide enough code to confirm the Parallax product is in good working order. Parallax can't afford to teach all of Arduino to a new learner.

    I would hope that you will compare the learning experiences and decide in favor of what Parallax has to offer. Selling you a servo that can be used with both allows you compare the Pros and Cons.

    +++++++++
    This is somewhat like going to Macy*s and telling them to do something about the shoes you didn't like from Sears because you bought socks from Macy*s.

    We want to help, but this gets a bit silly. There are lots and lots of attachments that are supposed to be supported by Aruduino libraries, but one ends up discovering that Arduino hasn't been able to keep all the details cleaned up.
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2015-08-16 17:30
    The Learn examples are explicit in their intent: simple demonstrations to verify operation and begin experimenting. As with Arduino's own example, the Learn code is 100% correct. It might not demonstrate exactly what you want to see, but you are free to delve more deeply.

    It does not suggest a specific angular position, as much as you want it to in order to prove your point. Analog servos are not angle-precise, and can even drift during operation as they get warm. There is a reason RC transmitters include trimming controls. These are issues you are free to learn about and experiment with on your own, now that the Learn example has gotten you started.

    If you can demonstrate that the code harms the servo because it causes it to travel beyond its stops, then naturally it needs to be updated. But understand that the Parallax Standard servo, a Futaba re-brand that's been manufactured for several decades, is pretty much the type that the Arduino code was written for. You keep saying the range is 750-2250 us. What makes you believe that's the actual full range? As with the Arduino example that ships with the IDE, the Learn example code as been independently verified by many people, over a period of several years.

    BTW, so we are clear, I am not a Parallax employee. It's up to Parallax if they want to modify any of the examples. I just responded to comment on several misstatements you made, such as "According to the kickstart example you could use the following sketch to send your myServo after five seconds to an angle of 30 degrees:" No, it does not say this, or anything close to it.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2015-08-16 17:55
    Servos get to be a bit of a crazy topic without a knowledge of their history. People often expect them to do too much in terms of accuracy, rotation range, or power. And reversal errors of the polarity of the power inputs will immediate destroy one before you get a chance to explore.

    Parallax provides a re-branded Futuba Servo and one can also go to them to get technical data. But the range of the 'original R/C servos' wasn't a full 180 degrees. And the accuracy of these hobby servos is in no way related to the multi-horsepower industrial servos that the OP mentions having experience with.

    Sooner or later, the OP is going to discover that the 'original R/C servos' were hacked and modified into continuous rotation devices. That just adds a bit more to know.

    As I recall, the 'original R/C servos' didn't provide a full 180 degrees as there was no need to for R/C flight. It only came later as customers demanded the wider range that some manufacturers provided that range.

    There have been other enhancements. Wikipedia might help one get started on understand the diversity of choices -- all with some technical nuance.

    https://en.wikipedia.org/wiki/Servo_(radio_control)

    Above all, don't expect to much from this devices. They are low power toys.

    You may not have realized that Parallax did achieve its documentation goals.
    a. You were able to test and confirm your money was not wasted.
    b. You wired the device correctly and did not damage it on your first attempt.

    Parallax always tried to provide those for every product as it values satisfied customers.

    And these forums have nothing to do with Customer Service. They are just hosted by Parallax. If you really desire action from Parallax, contact a Customer Service
    representative.

    Futaba is recognized as a producer of quality r/c product. Some servos are junk.
  • Thanks for your comments. Right now I think I understand the Parallax servo together with the Arduino board and software. I can't say this about the servo controled by BASIC Stamp HomeWork Board or Propeller QuickStart with their corresponding software.
    ... You keep saying the range is 750-2250 us. What makes you believe that's the actual full range? ...
    I adopted this from http://learn.parallax.com/kickstart/900-00005 . I quote:
    Note: To enable the servo to move a full 180° use pulse durations of approximately 750 to 2250 μs. Excercise care to not exceed these lower and upper limits.
    More people infer from these data that 0-->180 degrees correspond appr. to 750 --> 2250 μs, see e.g. pages 13 and 16 of this project https://courses.engr.illinois.edu/ece445/getfile.asp?id=2289

    I'm running out of time today, hope to continue tomorrow
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2015-08-17 19:01
    Gawk, the Parallax fine print may say 750 to 2250us somewhere (I can't find it), but the whole example is 1000 to 2000us. The outside reference is just that, outside of Parallax.

    I hope you realize Gordon actually wrote the Parallax Learn page you are referring to.

    This is a bit awkward. There appears to be some 'cut and paste' plagarism in that outside article. I can see how you might not know what is true Parallax support.


    From what I learned 1000 to 2000us should be the normal range, with 1500us being the center. But everything on the internet gets muddled as people pass on information.

    You are going to find that different makers of servos have different designs inside their devices (Yes, I have opened up several). Some will do more than 180 degrees, some can be adapted to full rotation, and others will do no more than 150 degrees and others are built so that they never can be modified to full rotation.

    Finding specs can be problematic, especially for products on EBay from those Asian resources. Everyone is on the Arduino bandwagon, but not everyone cares about specs, documentation, or customer goodwill.


    These days we even have tiny Pico and Nano servos that will NOT operate at 6.0VDC, they burn up. You should provide 4.8VDC according to their specs, but everyone is using 5.0VDC regulated power to them.


    Parallax's full rotation servo is special in that it has a set screw to allow you adjust the point at which it stops to match 1500us in code. Other servos require you to go back and forth in code and tweak it to whatever the might stop the servo from rotation.

    +++++++
    The BasicStamp devices just generate a pulse width within the range (1000us to 2000us in width) and 50 times per second (or more) to position the servo. 1500um pulse width should be near to center. The servo expect a new pulse at 50Hz or faster.

    Originally that was all good enough for R/C controlled airplanes, boats, and car. But the microcontroller hobbyist started to desire precision.

    Stepper motors and maybe added quadrature feedback systems are really required to hold a precise position and return to it. Or maybe a regular motor with quadrature feedback and PID. The 3D printer hobbyist have deeply explored all this.

    +++++++++++++
    You are just getting started. These tiny servos are just an introduction.

    Learn as much as you can from Arduino, but keep an open mind about what Parallax has to offer as well. The Propeller 1 is a bargain and will give years of learning.
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2015-08-18 03:07
    Leo51 wrote: »
    Note: To enable the servo to move a full 180° use pulse durations of approximately 750 to 2250 μs. Excercise care to not exceed these lower and upper limits.

    Yes, you're right, it does say this. But it doesn't mean those are the actual extents. Not trying to be tricky, but the unwritten is this: the Arduino code -- as in the Learn example and on the Arduino.cc site -- is not known (by me anyway) to have harmed any Parallax Standard servos. Yes, the posted extents are 750 to 2250 us. That does not mean those are the actual minimums and maximums, or that the Arduino code won't work as presented.

    Why not just change the attach method to include the upper/lower limits? As much as possible, the Learn examples try to build on a familiar framework. If the Arduino sample that came with the IDE used the optional min/max, so would the Learn code. In a heartbeat.

    Loopy, in this case it's not 1000-2000 us, because the Arduino folks discovered that all but the cheapest servos were capable of much wider extents. There haven't been servos limited to 750-2250 us for a long time. That's why their "0" and "180" default to the corresponding microsecond width that they do.

    I will leave this up to Steph Lindsey and Ken Gracey at Parallax to determine if they want to update the code. They would have first-hand knowledge if there's been any complaints or damaged servos. Otherwise, I'd strongly advocate keeping the code in sync with Arduino's own example. Confusion comes from many corners, and I'd prefer the Learn code doesn't add to that confusion.

  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2015-08-18 06:18
    The internet certainly can lead us all on a merry chase. And servos from different sources can be surprising in unpleasant ways.

    The OPs original point is that he felt the Parallax product specifications were either too vague or not to be found.


    These days, there are a lot of EBay products for the Arduino that lack any supporting material. Their vendors actually avoid documentation and specification, and may even be producing clones using someone else's brand name.

    The easiest thing to do may likely be for Parallax just to clear specify the reasonable limits and the MAX limits that its servos will do.

    Version 2.2-1 that was last revised in 2012 might just include a line at the top of it somewhere that states the following:

    Total rotation capacity : 180 degrees max.
    Note -- The servo will last longer if rotation avoids the extremes of its range.

    Absolute Pulse Width Limits : 750us to 2250us (or whatever is realistic).
    Normal Pulse Width use: 1000us to 2000us (or whatever is considered normal)
    Note -- Exceeding pulse width limits may stress the servo, and damage it.

    Note -- Exceeding 6VDC will likely damage the servo.

    ++++++++++++++
    I don't see any reason for the specifications to actually include Arduino code. Providing code for the BasicStamp2 and the Propeller have always been standard.

    Your Learn tutorial might caution that Absolute Pulse Width limits vary from manufacturer to manufacturer. But safe operation between 1000us and 2000us is a reasonable assumption.

    (I know this is a lot of annoying revision that slips into vague language and pointing the reader to take responsibility for running down details elsewhere. One can only do so much.)
  • Leo51Leo51 Posts: 6
    edited 2015-08-18 19:01
    Thanks again very much for your answers and comments.

    at GordonMcComb:
    Today I had a rather long day of routine work during which I had time to think about the arduino software you used in your example, and one of my conclusions matches yours: we make what I consider to be software errors because the basic documentation of Arduino's servo library is not clear about this. Nowhere do you find in their examples a note that they use default min/max pulse width values of 544/2400 us, neither do they mention that 20 ms after the attach(Pin) command the servo starts moving to 87 degrees shaft angle unless you overwrite their DEFAULT_PULSE_WIDTH  (1500 us = 87 degrees using their min/max values). I intend to start a discussion on their forum when I have time and inspiration.

    Our 2 servos each are driving rather long and relatively heavy loaded vertical axes from angle A --> B and from B --> A. In theory B-A is exactly 60 degrees, but in practice a little overshoot turned out to be better. Unfortunately for one of the servos angle A is 6 Arduino degrees (= 606 us = about - 17 Parallax degrees). So a desired overshoot of - 10 degrees was out of the question. An overshoot of -6 degrees, setting A' = 0 Arduino degrees = about - 25 Parallax degrees, resulted in a noisy motion; A' = 3 Arduino degrees turned out to be good enough though. Since then the servos have driven their loaded axes from B' to A' and vv about 800 times a day during about 30 working days without any problem. More students are going to use the system, let's hope it continous this way :-*

    at Duane Degn:
    Arduino's microcontroller is very well documented, you can upload your (compiled C++) program easily using a USB connection. E.g. any pin can be setup to trigger a specific interrupt and you can make the interrupt handler exactly as you wish. Is the propeller as flexible?

    at Loopy Byteloose:
    I am very interested to know more about the components inside the Parallax servo: what is the resistance range of the potentiometer? (specifically min, medium and max). How does the control unit look like? (According to http://www.4qdtec.com/pwpm.html : "if you were trying to work out how to give a signal which depends on the rotation of a pot,
    one way you might chose is by using the pot to control the pulse width of a common mono-stable.
    This is exactly what PW PS does. Every time the receiver gets a pulse from the transmitter, it fires a monostable. The monostable's pulse width is determined by the pot on the output shaft. The receiver compares the received pulse with the monostable's pulse. If the received pulse stops first then the receiver causes the motor to rotate anticlockwise so the monostable's pulse length is reduced. If the local pulse stops first then the motor is rotated clockwise, to increase the local pulse length."
    Which chip(s) + capacitator(s) and resistance(s) do this job? How?


  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2015-08-18 21:28
    Arduino's examples and reference are fairly scant because they rely on separate documentation provided elsewhere, and by the community. These topics are certainly covered in other places in far more depth, including material I've written for other projects. So it's out there for the finding.

    The Arduino folks probably don't feel the need to mention the min/max extents in their reference because it doesn't come up often. If it were an issue with servos, they'd change the code, and/or add more documentation about it. There's no law that says products can't be better than their specs. For someone who needs to correlate pulses to degrees, they're free to delve more deeply. This is the nature of open source projects.

    You can easily handle the startup behavior of the servo when using the attach method by adding a write method immediately above. (Yes, I have long been aware of this. And no, I'm not adding it to the Kickstart! :)) But that only works after a fashion. The servo will home from wherever it last was, to the specified position. If you left it at "90." then there will be no movement at the restart of the sketch, because it will already be there.

    BTW, the Futaba S-148 is well known for having a center position of 1.52ms. Don't ask me why; it's just the way it is. That's why you're not getting 90 degrees. You may like to experiment with using writeMicroseconds(1520), immediately before the attach method, to see if this gets you closer to what you want. For most applications, and most users, the few degrees in variance is of little concern.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2015-08-19 13:32
    Okay...
    I dunno the resistance of the pot inside the Parallax servo. it never crossed my mind to test it.

    My primary purposes for opening servos were three fold.

    A. Hack a conventional servo to rotate 360 degrees, like the ones on the BOEbot.
    B. Attempt to repair damage to the gears from excessive loading.
    C. Remove the PWM electronics entirely due to over-voltage damage and wire the savaged unit to an external H-bridge (but there are vendors that attempted to provide internal h-bridges as well).

    ++++++++++++
    The link below may get you started on a long journey into hacking r/c servos. You may Google "hacking servos" to get even more

    http://www.seattlerobotics.org/guide/servohack.html

    Frankly, they never really have satisfied me -- except when I use them as intended in r/c controller airplanes.

    Ebay has a lot of quality DC motors with encoders that offer more power and precision via PID control and a well engineered h-bridge. But fitting adequate wheels, gears, or drive train can be a challenge and expensive.

    Expectations about spot on positioning and lack of backlash may go wanting.

    ++++++
    The Scribbler2 robot by Parallax includes motors, h-bridges, and encoders. It may be a better way of learning about precise motor control for positioning than buying bits here and there.

    There is a tendency to find yourself buying items that don't quite integrate and end up being set aside or getting bogged down in construction details.
  • I think it's very odd the Arduino uses angles as a servo input parameter. The relationship between pulse length and angle is not consistent between servo models.

    Before building the Halloween Hex I had made a small hexapod. I initially used the same angle to pulse length conversion values with the larger hexapod which produced dramatically different behaviour than the small hexapod. Here's a link to my "bucking bronco" initial hexapod test.

    The bucking motion is very pronounced at 1:45 into the video.

    Once I adjusted the angle to pulse length conversion factor, the robot behaved much better as seen in the earlier video I posted.
    Leo51 wrote: »
    Arduino's microcontroller is very well documented, you can upload your (compiled C++) program easily using a USB connection. E.g. any pin can be setup to trigger a specific interrupt and you can make the interrupt handler exactly as you wish. Is the propeller as flexible?

    The Propeller can also be easily programmed over a USB connection.

    I don't use C or C++ on the Propeller much, but a lot of other people do and I believe it's pretty easy to load C programs on the Prop.

    I'm not sure it's really fair to the single core 8-bit Arduino to compare its performance and flexibility to the Propeller. The Propeller's eight 32-bit processors makes all sorts of things possible for the Propeller which are impossible for an Arduino. I think it's pretty safe to say anything an Arduino can do the Propeller could do better.

    I still think Arduino clones are really useful. You can get clones for a few dollars on ebay and often a cheap Arduino clone will get the job done. Problems arise when one attempts to combine multiple Arduino libraries in a project. The various libraries often end up conflicting with each other which can make developing complex programs with the Arduino problematic. With the Propeller, the various sections of code are being executed in independent cogs which makes conflicts between pieces of code much less common and generally when they occur they're easy to solve.
    Leo51 wrote: »
    I am very interested to know more about the components inside the Parallax servo: what is the resistance range of the potentiometer?

    I don't know how universal it is but all the pots I've measured were 5k ohm. The actual value of the pots isn't very important. The pot acts as a voltage divider and I know some people have replaced 5k servo pots with 10k pots since they had them on hand and the different pot didn't cause any issue.

    There are some photos of the insides of servos attached to this post.

    forums.parallax.com/discussion/comment/1301409/#Comment_1301409

    There are generally two compartments inside a servo. One compartment is for the gears and the other is for the electronics. You could tape the gear compartment together to prevent it from opening and remove the four screw holding the servo case together. The tape would hopefully prevent the gears from coming out and you could take a look at the electronics. The electronics section of the servo is easy to put back together after it has been opened but the gears can be difficult to get back in place if you haven't done this sort of thing before.

    The wires to the servo enter into the electronics section. You could take a look at the electronics yourself without too much concern about damaging the servo (provided you don't open the gear section).
  • C++ confounds me completely, and the Arduino is somewhat dependent upon it.

    I have the vague impression that C was more than adequate for the computer industry, but several proprietary influences chose to 'enhance' C in order to protect their intellectual property while migrating users away of the more universal C.

    The Arduino ambitiously buffers the user from the underlying realities of programing a microcontroller rather than educate the learner about a need to understand these details. The hazard is simply an over-simplification considered to be sophisticated knowledge. While it is fun, it won't lead to full-time employment in the computer industry. You eventually have to learn what you have been protected from learning.
Sign In or Register to comment.