Controlling a servo with lopy (library or manually)
-
@robert-hh no worries mate, but yes - i did pull OE low. Connected it directly to GND on the lopy. Maybe a stupid question, but what is "SW" ?
-
@soren Software
-
@soren I just looked into the 74HCT125 data sheet. The minimum level for high is 3.15 V, close to the output level of the lopy. In that case I would check with an oscilloscope or logic analyzer whether the output of the gate really switches.
-
@robert-hh I can see with my multimeter that it's switching, but maybe that isn't accurate enough?
-
@soren Switching while you toggle manually? or between duty cycle 0 and 1?
Edit: I see 74HCT125 has a high input level of 2V, like the 74LS125. It's the 74HC125 with the 3.15 V level. So theer should be no problem with the levels. -
@soren said in Controlling a servo with lopy (library or manually):
For me setup 1 not worked when i tested it in the past with MG996R.
It does not react properly on 3v3 range pwm.
Setup 2 should work but i do not use convertes in chip
i trust simple design as converter on simple transistor eg. 2N7000.and to test if it work - try first run commands from terminal
pwm_c.duty_cycle(0.127 )
look at result but do not putsleepcommand
and decrese value
pwm_c.duty_cycle(0.117 )
pwm_c.duty_cycle(0.107 )
pwm_c.duty_cycle(0.097 )
...any results?
P.S.pwm_c.duty_cycle(1)is not good at all ;-)
i have done same mistake previously - as you can see in my post from the past -
@livius sleep() does not turn off the PWM.
-
@robert-hh
yes, but it is not needed from terminal - this was my intention -
@livius I took everything apart, put it together and double cross checked several times the connections and then tried the pwm_c.duty_cycle() command from console - and it WORKED! @robert-hh I think time.sleep actually does affect pwm. At least it works now for me from console where I'm not using sleep - in contrast to what I did in the code.
-
@soren Good that it works. But omitting the sleep() commands are hardly the reason. I checked with an oscilloscope that PWM output stays when sleep() is performed. It's more something else you did. I worked with these servos decades ago, and remember that the pulse width range they expect is pretty small, from 1 ms to 2ms, at a 20ms period, resulting at a PWM duty cycle range between 5% and 10%
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login