epiception/Virtual-Telepresence

Servo of gimbal not moving

Closed this issue · 3 comments

I executed Python code in raspberry pi 3.
I am getting values for angles in degrees on pi screen.
But my gimbal servo used for pan tilt are not moving connected at gpio 4 and gpio 17 of pi according to angles.
Plz Help!!!

I currently do not have a Raspberry Pi (v2) in my possession (will have one back in a few days). Meanwhile, possible troubleshooting tips I could provide:

  1. https://github.com/richardghirst/PiBits/tree/master/ServoBlaster
    Based on the description please ensure that support is available for Pi v3 as well from Servoblaster. If it is available, this following pins should work:
    Servo number GPIO number Pin in P1 header
    0 4 P1-7
    1 17 P1-11
    2 18 P1-12
    3 21/27 P1-13
    4 22 P1-15
    5 23 P1-16
    6 24 P1-18
    7 25 P1-22

  2. As a suggestion, also check the angle values for upper and lower limit and check if they fall in the correct range.

  3. Also, the whole reason for using Servoblaster was the speed of response I received with it. You could try rotating the servo using a basic pwm signal. No reason why that shouldn't work. However, you might lose out on the real-time response.

Hi, finally I did what describes maxjp in #62
richardghirst/PiBits#62
this solution is for Raspberry Pi 3

PROBLEM WITH degrees2
Now the thing in servo for pan i.e. degrees(line 65) angle rotating perfectly because they are showing correct values on screen but for tilt i.e. degress2(line 66) values is not proper. They are not showing values from upper to lower limits as we move gyro device. They stuck on value 250 or sometimes 50.

any solution?

Thanks for referencing this to solve upcoming issues on Pi 3. 👍

Regarding the problem, if I remember correctly, value_map maps to 50 minimum and 250 maximum based again on servo_blaster:

Number of servos: 8
Servo cycle time: 20000us
Pulse increment step size: 10us
Minimum width value: 50 (500us)
Maximum width value: 250 (2500us)
Output levels: Normal

If this is not to be changed, and is correct, my guess is that the val at line 38 is greater or lesser than the required range, which in turn depends on the in_max and in_min inputs to value_map function. Do check those and see if they fit in the range mentioned. If not you may have to change the range based on the values you receive for your smartphone device.

I have received such doubts in the past and they mainly seem to arise from the values from different imu sensors in devices.