View Full Version : problem with running servo from servopod
subot.robot
08-13-05, 08:02 AM
I am trying to interface servo motor to servopod. But i have not been able to run the servo motor from the pwm pins
I connected the servo motor connector to PWMA0 in J9. I also have given 5v to J17.
As mentioned in one of ur posts, I set the the pwm freqency to 100Hz. i.e 10 ms period
I am posting the code that i typed through the terminal
DECIMAL
25000 PWMA0 PWM-PERIOD
3000 PWMA0 PWM-OUT
4000 PWMA0 PWM-OUT
3750 PWMA0 PWM-OUT
But nothing happened. Servo motor did not even turn a bit. I don't know what went wrong.
Can u please guide me in this regard?
Thank you in advance
Subot.robot
RMDumse
08-13-05, 01:03 PM
Unfortunately, there is quite a bit of ambiguity in the language about servo motors.
If you are talking about an RC Servo Motor, you are on the right track. If you are talking about an a bare DC or AC motor, or one with optical or mechanical feedback... that takes more power to drive. So if you aren't talking RC Servo Motor, let me know.
Okay, RC Servo Motors take a ~1mS high-going pulse to go to one end, and a ~2mS pulse to go to the other end, then a quite period (low) of around 20mS (less the the pulse).
So if you are pulsing them 100Hz, you are sending pulses twice as fast as they normally take. We've tested many servos at higher update rates, and know almost all work at 76Hz. We haven't tested many at 100Hz, but just guessing, they will probably work, but may over heat with time, as the chips in them drive harder if the rate increases.
So we might suggest as big a 15-bit number as possible to generate the total period, or where you use 25000 PWMA0 PWM-PERIOD, we might suggest 32767 PWMA0 PWM-PERIOD. But there isn't a huge difference between the two approaches.
However, the pulse length you list there seems short. 5000 PWMA0 PWM-OUT would give you a 1mS pulse and 10000 would give you a 2mS pulse.
So I assume what you are getting out is shorter than an RC Servo can respond to, so it is sitting at the low pulse end of positions. Try a range of 5000 - 10000 with 7500 being the mid point on your PWM out and let me know if that doesn't get some movement.
subot.robot
08-15-05, 05:21 AM
Thank you for the guidance.
I am using hitec rc servo motor. I also tried pulsing at 76Hz and the duty cycle between value 5000 and 10000, but still nothing has happened. I don't know if i am doing anything wrong with program. Is there anything i should do like center aligned pwm or setup anything on servopod like changing jumper setting or adding any additional instructions, apart from the one mentioned in the above post.
I am running the program from the terminal, i.e. from the RAM. Is this the reason for my problem?
Thank you in advance.
regards
subot_robot
RMDumse
08-15-05, 09:57 AM
I have hooked up RC Servos and output to them by just interactively sending those commands. The time widths for the pulses themselves at both 76Hz and 100Hz would still be the same width, so 5000 to 10000 is still the range.
So here are some thoughts:
Do you have power to the servo? The rails on the IsoPod(TM) and ServoPod(TM) do not have power without jumpers.
Do you have ground hooked up? If you aren't using the rails, and are powering the servo separately with a different source suppy, and bringing the PWM signal over to the servo connector, you will still need a common ground between the other source supply. There always has to be a loop to move electrons in low voltage applications, just sending them out the signal wire won't work with out a return path.
Are you sure you are on the right signal pin? I've turned on all the PWM outputs before to be sure I had the one I was hooked to going.
Have you looked at the signal itself to see if it is making it to the servo? Do you have an oscillascope, logic probe?
Are you sure the Servo works?
subot.robot
08-15-05, 11:35 AM
I connected the servo motor connector to PWMA0 in J9. I also have given 5v to J17.
And I am sure that servo works.
Can u please post the code that makes the servo run. or is my code given in previous posts, with corrected pwm timing, is correct. then what could be wrong?
I am using this servopod in the robotics lab. it already has a program in its flash prog memory. that program can only be communicated with c++ API program communicating over usb. when command, to turn servo, is given from this API servo motor works. I am planning to control the robot only with servopod instead of controlling from computer using servopod as IO interface. But i have stumbled at running servo motor and dc motor connected through ESC (electronic speed control) unit, which also needs rc servo motor like signal.
once again thanks for ur guidance.
regards
subot.robot
RMDumse
08-15-05, 01:25 PM
So the existing application is already installed in Flash? Is this program running under IsoMax(TM)? See, I'm thinking maybe you are changing the PWM interactively, but the other program running in the background changes it immediately to the old value.
Generally you can move the servo horn by hand if it isn't powered or receiving pulses. (This can damage some servos, so if you have a delicate servo, don't try it.) You can tell if the servo is powered and receiving pulses if it resists gentle pressure to move the horn.
If the servo resist before you send the program segment I suggested above (yes, it should be correct) then some program is already driving the servo.
Connection to J9 could be reversed, the signal wire goes to the interior row, and the gnd wire goes toward the closer board edge. If the other program moves the servo, then you know the reversal is not the case. Sounds like power to J17 is correct, if there is sufficient current for the particular servo.
So consider if the other program might still be running and advise.
subot.robot
08-16-05, 12:49 AM
The existing program in flash is not running as i have disabled it with jumper connection shorting 2 and 4 of J3. the servo horn of the servos in the lab cannot be rotated by hand when applying moderate force. they are high torque servos with around 8kg/cm stall torque.
i have double checked the connection to J9. Current supply to servo from j17 is adequate as the servo runs when controlled from pc + servopod. I am simply not able to figure out why i am bogged down by simple problem. is there some thing very simple that i could have overlooked. Thanks a lot for ur sincere support. No wonder products from New Micros are so popular.
regards
Subot.robot
subot.robot
08-16-05, 03:41 AM
Thanks, it is now working. The problem was PWMA0 is not working. When I tried with other PWM ports it worked.
regards
subot.robot
vBulletin v3.0.7, Copyright ©2000-2012, Jelsoft Enterprises Ltd.