sollodobo
Posts: 1
Joined: Mon Jun 29, 2020 2:21 am

servo memory

Mon Jun 29, 2020 2:25 am

so i find that the arduino world has many tutorials on how to record servo movements. they use a potentiometer to move the servo and while you are doing that the micro controler records it and plays it back. How can this be achieved with a raspberry pi? any help or advice is appreciated thank you.

blimpyway
Posts: 338
Joined: Mon Mar 19, 2018 1:18 pm

Re: servo memory

Tue Jun 30, 2020 7:30 am

You start with an AD converter since Pi cannot read analog voltage from potentiometer.

User avatar
B.Goode
Posts: 10170
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: servo memory

Tue Jun 30, 2020 7:42 am

sollodobo wrote:
Mon Jun 29, 2020 2:25 am
so i find that the arduino world has many tutorials on how to record servo movements. they use a potentiometer to move the servo and while you are doing that the micro controler records it and plays it back. How can this be achieved with a raspberry pi? any help or advice is appreciated thank you.

One possible approach is to read and understand the code in the corresponding Arduino sketch and then re-implement the same solution on Raspberry Pi hardware using your chosen combination of Operating System and Programming Language.

Using the supported RasPiOS Operating System and the gpiozero Python library would give you a straightforward way of handling both the servo and the potentiometer.

PiGraham
Posts: 3929
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: servo memory

Tue Jun 30, 2020 8:13 am

Potentiometers are a nice way to input rotation positions so you can make a model of the robot arm with potentiometers where there are servos on the actual arm. The pose of the model can be read.
Reading potentiometers does require analogue to digital conversion which needs an add-on for RPi.
But you can do record / playback without that. You can use the keyboard to input positions and record a list of positions for each joint and replay that.
For example you could use the number keys to select a joint and + - keys to alter the position of the selected joint and Enter to record the current pose.

The memory can be an array of numbers for position of each servo

Return to “Automation, sensing and robotics”