Comments on: Using the Dagu Pan/Tilt Kit with the Raspberry Pi http://blog.dawnrobotics.co.uk/2013/10/using-the-dagu-pantilt-kit-with-the-raspberry-pi/ Tutorials and updates from Dawn Robotics Mon, 09 Nov 2015 16:39:02 +0000 hourly 1 http://wordpress.org/?v=3.7.11 By: Roddy http://blog.dawnrobotics.co.uk/2013/10/using-the-dagu-pantilt-kit-with-the-raspberry-pi/#comment-1005 Sat, 26 Sep 2015 20:48:45 +0000 http://blog.dawnrobotics.co.uk/?p=238#comment-1005 I have a Pi2 Model B and I’m going round in circles trying to get this to work (I have previously had it working on a model B Pi, which has sadly expired).
The error message I’m getting is :

Traceback (most recent call last):
File "pi_pan_tilt_control.py", line 4, in
import RPIO
File "/usr/local/lib/python2.7/dist-packages/RPIO/__init__.py", line 115, in
import RPIO._GPIO as _GPIO
SystemError: This module can only be run on a Raspberry Pi!

I’ve tried advice which uses apt-get to purge “python{,3}-rpi.gpio” and then to install it again, but to no avail. Can anyone advise if the script works on a Pi2 and if not how might I use the pan and tilt module on my Pi2

(base install is 2015-05-05-raspbian-wheezy)

Thanks
Roddy

]]>
By: Fred http://blog.dawnrobotics.co.uk/2013/10/using-the-dagu-pantilt-kit-with-the-raspberry-pi/#comment-985 Thu, 27 Aug 2015 14:27:29 +0000 http://blog.dawnrobotics.co.uk/?p=238#comment-985 Hi Alan,

Thanks for the reply.

I understand a little better the relationship between angles and pulse.

Regards.

]]>
By: Alan http://blog.dawnrobotics.co.uk/2013/10/using-the-dagu-pantilt-kit-with-the-raspberry-pi/#comment-983 Wed, 26 Aug 2015 16:07:14 +0000 http://blog.dawnrobotics.co.uk/?p=238#comment-983 Hi Fred,

Sorry for the delayed reply. The exact relationship between angle and pulse width will vary a bit depending upon which brand of servo you’re using. In general the correspondence will usually be 1000us = 0 degrees, 1500us = 90 degrees, and 2000us = 180 degrees, although you’ll need to experiment to find the exact relationship for your servos, and also you may find that some servos don’t go all the way left or right. This article on the Society of Robots website gives a good explanation of servos and PWM signals. Although they quote times in millisections (ms) where 1 ms = 1000us.

Hope that helps.

Regards

Alan

]]>
By: Fred http://blog.dawnrobotics.co.uk/2013/10/using-the-dagu-pantilt-kit-with-the-raspberry-pi/#comment-979 Mon, 24 Aug 2015 18:15:59 +0000 http://blog.dawnrobotics.co.uk/?p=238#comment-979 Hi,

I found your exemple very helpful but i have a problem. I don’t understand how to get angle and pulse width.

Regards

]]>
By: Chris http://blog.dawnrobotics.co.uk/2013/10/using-the-dagu-pantilt-kit-with-the-raspberry-pi/#comment-798 Thu, 19 Mar 2015 16:43:12 +0000 http://blog.dawnrobotics.co.uk/?p=238#comment-798 Thanks for the reply.

I think I’ll have to wait until the ADC is available since I’d like to avoid using an Arduino on top. I’m planning on deploying the system where there is no mains power and so it would need to run on a (big) battery. The smaller the power consumption will be the better.

Chris

]]>
By: Alan http://blog.dawnrobotics.co.uk/2013/10/using-the-dagu-pantilt-kit-with-the-raspberry-pi/#comment-795 Thu, 19 Mar 2015 15:05:25 +0000 http://blog.dawnrobotics.co.uk/?p=238#comment-795 Hi Chris,

Yes, this sounds like it would be a very cool addition to the project.

You’re right that you’d need an ADC, which the Raspberry Pi currently lacks. We are hoping to stock an ADC for the Pi soon, but in the meantime a good alternative might be an Arduino compatible such as the Mini Driver board we sell. I think that adding an Arduino to a Raspberry Pi project can be a really good option as it can be much easier to hook up sensors (analog and 5V) to an Arduino, and you have a little bit of onboard processing power that can be used to monitor sensors and control motors in realtime whilst the Pi gets on with more computationally intensive tasks.

Regards

Alan

]]>
By: Chris http://blog.dawnrobotics.co.uk/2013/10/using-the-dagu-pantilt-kit-with-the-raspberry-pi/#comment-792 Wed, 18 Mar 2015 17:07:21 +0000 http://blog.dawnrobotics.co.uk/?p=238#comment-792 Hi Alan,

I really like the setup for the pan/tilt camera here. Would it be possible to extend this setup to use a 2-axis joystick for input (controlling the camera, eg http://www.adafruit.com/products/512) with the necessary parts and code?

I’m guessing a ADC would need to be used to convert the analog signal to digital.

The end result would be that the user did not have to type any commands but could use the joystick to control the servos.

Thanks,

Chris

]]>
By: Alan http://blog.dawnrobotics.co.uk/2013/10/using-the-dagu-pantilt-kit-with-the-raspberry-pi/#comment-763 Mon, 02 Mar 2015 07:16:38 +0000 http://blog.dawnrobotics.co.uk/?p=238#comment-763 Hi Bill,

Sorry for the delayed reply.

The Mini Driver is Arduino compatible, so can be used with the Arduino IDE, which should be installed by default on your Pi, or can be downloaded for Windows etc. We have a blog post for getting started programming the Mini Driver here. Also, the Arduino IDE comes with lots of demo programs, including a Servo example which can be found by selecting File > Examples > Servo > Sweep.

So to answer your question, you’d need to write a sketch for the Mini Driver to control the servos, and then if needed, use serial communication to send commands from the Pi.

Hope that helps.

Regards

Alan

]]>
By: Bill http://blog.dawnrobotics.co.uk/2013/10/using-the-dagu-pantilt-kit-with-the-raspberry-pi/#comment-755 Mon, 23 Feb 2015 15:55:23 +0000 http://blog.dawnrobotics.co.uk/?p=238#comment-755 Hi Alan,
How would I go about getting this script to work using the Dagu mini driver instead of a breadboard?

]]>
By: Dennis http://blog.dawnrobotics.co.uk/2013/10/using-the-dagu-pantilt-kit-with-the-raspberry-pi/#comment-743 Fri, 13 Feb 2015 12:32:30 +0000 http://blog.dawnrobotics.co.uk/?p=238#comment-743 thanks for that Alan. Since I want to try and keep the voltage supply coming from the pi, it’s either not to do it or risk it :-)

]]>