Argon and servo

argon
Tags: #<Tag:0x00007fe2289fc448>

#1

I’ve just started with a particle Argon kit and Photon kit and like some others here, I wanted to automate some mechanism by using a servo and tinker.

I bought the following, ignorantly, not realizing there was a difference between range/positional and continuous rotation servos: JX Servo PDI-6225MG-300

My eyes were fixated on this one because a post actually listed how many teeth it had, since I wanted to use a straight, 180 deg metal horn. Why don’t servos seem to list the teeth in the specifications??

My project would have benefited with the continuous, but, since I have this thing I wanted to experiment. As I understand it I can just send it the range between 0-180 and it should interpret that in its ratio. Regardless, this thing should move…which is all I’ve been after.
All initialization/noob questions aside, my LED D7 (or resistor + LED D0) “Hello World!”, blinks just fine.

I’ve read many posts trying to solve this problem but now I’m reaching out since I see a combination of issues.

Initial power configuration was: 1 USB wart 5v 2A variety
Servo direct connected to GND, 3.3v and D0. I also tried A0, just for giggles and instead of 3.3v to vUSB.

Compiled some code.

Power Test 1:
Servo moved quick in one direction to some fixed point. Some humming movement happening afterwards but never anything significant.

Power Test 1a.x:
Changed some deg values expecting something different (insanity: 0, 10, 20, 90, 180). Changed and added delay or removed delay entirely, added/removed D7 flashing indicator as some “point in code” reference. Some quick movement in one direction to some fixed point but then basically same behavior as #1.

Many other trials happened with not much results and everything I read in the community suggested splitting out the power, ie, Cap 47uf + 100nf. There’s some difficulty splitting out the USB in with jumpers to the servo on a breadboard so I tried a 5v - 10A battery I have for some LED strip lights.

Battery power configuration: + and - to breadboard power trace, jumpers from + to vUSB and - to GND, without any of the servo caps and the servo removed.

Power Test 2: The Argon just flash x 3 yellow, x 1 white repeatedly
After seeing posts, I attempted the weird antenna disconnect without luck

Power Test 3: Direct connect battery + to vUSB and - to GND, Argon powered up fine

Power Test 4: Is it the breadboard or jumpers?? Tried different jumpers.nope!

Power Test 5: Jammed my vUSB jumper and GND jumper into the same holes as the +/- traces coming from the battery. Obviously it powered up because it’s like a continuous wire…
So why was the breadboard adding some problems? Skip it, go to the servo test with the noise reducing caps.

Power Test 6: test #5 configuration to Argon, with caps installed across +/-, servo installed to A0 for pulse and +/-.
Result was exactly the same as 1.a.x.

I’m at a loss, since what I thought was my issue might not be mine, and it also seems to invalidate all the other posts I read about the do’s/don’ts about hooking this thing up to power. I don’t believe noise or power are my issues at all.

Perhaps it’s the servo, is there a recommendation for a metal gear with metal horn, out there which has better voltage compatibility? Understand I’m skeptical this as the root cause, since there have been many assumptions and speculations in the different posts of what problems these have been having between power, noise, servo voltage, servo one direction issues, etc. and I’ve tried many of the solutions. I also don’t have an oscilloscope lying around, so that’s off the table.

Please help! This doesn’t seem that difficult and this must be a simple problem with a simple solution.


#2

This is definetly not a good idea.
Before hooking things up it’s always good to first consult the datasheet
This was the first google hit that came up for me

Note the “Voltage range: 4.8V-6.6V”, so 3.3V is out of question.
Unfortunately that souce doesn’t seem to state the max. current but given the high torque rating my guess would be that it may exceed the rating for the VUSB protection fuse.

Also showing your code might be a start.
e.g. have you considered the max. pulse width rating?

Finally when you look at the Argon pinout you’ll notice D0 is not PWM enabled, but the control pin for Servo must be


#3

@ScruffR I was hoping you’d reply because I saw you provide a lot of help to others. Thanks in advance!

I understand what you’re saying, look before leaping (I certainly don’t want to blue smoke things up), but how do you explain that it initializes at full speed, when it needs to? Just so I better understand it. Guess I should have tried harder to find that datasheet.

During one of my iteration in Power Test #1 I noticed the PWM not on D0 so it’s been in A0 since. Would it need to be “D”? I’m very confident I tried D8. I don’t know how the PWM groupings matter. Some of the information I’ve been looking for needs to be translated between the Argon and Photon platform, like vUSB vs Vin.

The latest power config was similar to this post but Argon: Bricked Photon after driving a servo, need help to avoid a repeat

Here’s some code, but understand this was just garbage as I was changing all sorts of values between servo inputs and code delay. This was just a final test.

How would the pulse width matter for a non-continuous servo? Are some just not compatible with write()? Just to confirm change to use writeMicroseconds()?


#4

Seeing the code but not having full acces at the moment, I recall one iteration having setup, “0”. Loop had write “1” or “25” and “180”. Delay was 10000. I also had another delay in there of 1000 to differentiate between the LED high/low.


#5

Due to the lack of a comprehensive datasheet for this servo I’d give writeMicroseconds() a try.

Additionally I’d separate the power supplies for the Argon and the servo.
For that I’d put the battery on your servo, power the Argon via USB and only connect GND and control signal between servo and Argon.
At least for the tests - once the code is doing what it should, you can revisit the power setup.


#6

Thanks!

I’ll give that a try and post my findings.


#7

writeMicroseconds() is working

Servo myservo;
void setup() {
    myservo.attach(D8);
    myservo.writeMicroseconds(1400);
    pinMode(D7, OUTPUT);
}

void loop() {
    digitalWrite(D7, HIGH);
    myservo.writeMicroseconds(1800);
    delay(5000);
    digitalWrite(D7, LOW);
    myservo.writeMicroseconds(1400);
    delay(5000);
}

I believe this breadboard from the kit might have an issue.

Two images, essentially the same hook-up. #1 I tie the grounds together on a middle section. #2 I use the negative labelled bus. On #1 the servo responds smooth. On #2 it jitters, moves a little, and repeats the jitter motion.

I’m picking up a little bit of a frequency though when its idle.



#8

Any suggestions about circuits and wiring to get this all plugged in without the dual power source? Again there’s plenty of example for photon but Argon is not a 1:1 comparison.

Thanks in advance!


#9

I guess most of them do use less beefy servos.
With the servos you picked I’d use split power supply for the Photon too.

However, if a single rail setup is crucial you would power the controler via Vin/VUSB with some proper filtering (including over voltage protection and 0V clipping on GND).