Using Lynxmotion Pan and Tilt Kit with Raspberry Pi

Hell All,
I am new with Robot and very interested in this item.
Can someone guide me how to use the Lynxmotion Pan and Tilt Kit / Aluminium with raspberry Pi 4. I am using Python.
Thanks a lot

1 Like

@nodochau Welcome to the RobotShop Community. You need an RC servo controller between the RC servos used in the pan/tilt and the Pi. This can be in the form of a “hat” which fits directly onto the pins of the Raspberry Pi, a controller which can be connected to specific pins of the Pi (needs a bit of understanding regarding communication wiring etc.), or via USB if the controller allows. Most RC servo controllers have a specific communication protocol which you’ll need to understand, and then send via your Python program to wherever the controller is connected. Some Pi Hats provide sample code in Python, so do some research.

For example an RC servo controller which plugs directly into the Pi:

Note that this needs a separate power source like a wall adapter or battery pack. Most normal RC servos require 6V, and the servos used in the pan/tilt are not “power hungry” so a 6V, 1A source should be fine, like:

This is more than you’ll need but is great value for the price.

To connect it, you’d need a barrel adapter to pins, which RobotShop currently doesn’t carry, so the closest might be:

You’d need to unfortunately remove the connector(carefully) or simply cut it off. Before connecting the wires to the screw terminals, ensure you have the right polarity, otherwise bad stuff happens.

Alternatively use this and two short wires, again ensuring polarity is correct:

2 Likes

Thanks for you info.
I start the project now and another question is coming up.
I would like to record the length (of my part) data using raspberry pi and a motor with encoder built in. Can you recommend me which motor should I use and what else (such as board drive or…) do I need so that I can use the raspberry pi to count the pulses. The length is a critical dimension :slight_smile:

After I can move to the exact length then will use the Pan and Tilt Kit to move my camera to the position to take a picture.

Thanks

Not sure what you mean by “measure length”… of what? Are you making a camera slider?


This sounds like a different issue.

No, I am not.
The idea is that I am going to make a program to move my point (laser) to a position (X, Y) and store that position for future used. It will be four to ten positions and I need to use encoder with motor (my thought) to give me a feedback of the distances of X and Y by counting the pulse as I have read in this website.
Let say I will have two motors. one moves X axis and another for Y. The first position (X1, Y1) will be recorded and the laser which is mounted on the Pan and tilt kit will be activated to do its task. The program keeps doing that for position 2, 3…

Understood. As such, you might want to use a servo with position feedback (rather than something external). Consider the LSS which use a built-in absolute position magnetic encoder:



To make this into a pan/tilt, you’d need one single-wide bracket and a C-bracket:


More here:

These can be operated from a Raspberry Pi using the LSS-2IO and a power supply:

https://www.robotshop.com/en/power-supply-output-12vdc-6a-input-100-240vac-switch-molded-xt60.htmll

Thank you. It sounds good. The research is almost done!
Do you have any documentation or tutorial of Lynxmotion Smart Servo (LSS) - Standard (ST1) of how to get the feedback?
Thanks

Voila: https://wiki.lynxmotion.com/info/wiki/lynxmotion/view/lynxmotion-smart-servo/

Protocol itself: https://wiki.lynxmotion.com/info/wiki/lynxmotion/view/lynxmotion-smart-servo/lss-communication-protocol/

Simple serial command:

Querying servo ID (example you assign the servo ID as 5) for its position in (tenths of) degrees would be:

#5QD

The servo might respond:

*5D230

which is 23.0 degrees.

2 Likes

In Python you’d use this (line 32).

1 Like

@cbenson

Good morning,
I have a question regarding the LSS motor. Does it have a home position? I mean if I lose power then will it go back to its home position as soon as the power is back? Or we have to teach it…

Thanks

The position sensor is absolute (as opposed to relative), so you can just query the position upon startup and it will know the angle it’s at (including if you’ve configured an original offset). HOWEVER, if it has done multiple turns, it cannot know how many turns have been done after a power cycle so it will only give you its position between 0 and 360 degrees.