Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => A64 => Topic started by: NickSterg on November 27, 2017, 09:49:56 PM

Title: Servo Motor on A64 board using python
Post by: NickSterg on November 27, 2017, 09:49:56 PM
Hello !

I'm currently working on a project and I'm trying the A64 board. I need to use a servo motor and move it in exact degrees.
I tried the AngularServo from the Gpiozero library but it seems it searches for an RPi to work, which is kinda impossible!
Does anyone have any idea about how can I do that? Any library or smthing to work things out?

Thank you in advance !
Title: Re: Servo Motor on A64 board using python
Post by: LubOlimex on November 28, 2017, 08:52:27 AM
Haven't seen something exactly like this, but for general GPIO control you can use the recently published Python library for the A64 board. It is available here: https://pypi.python.org/pypi/pyA64/0.1.0
Title: Re: Servo Motor on A64 board using python
Post by: NickSterg on November 28, 2017, 03:27:29 PM
We already figured out how to use the GPIOs. The thing is i can't make a servo motor move into a specific angle. I can only move it 0 and 180 degrees.
The thing is we had a program using to move motors in a RPi and we are changing the board to olimex. The library we used to move the servo motor is not working properly. I get an error where it can't determine the RPi revision. Also got some errors "cannot detect the GPIO".
IF anybody has an any idea about how to move a servo motor using python in olimex, cause we have problems.

Title: Re: Servo Motor on A64 board using python
Post by: JohnS on November 28, 2017, 04:48:25 PM
The hardware is different so someone needs to change the software (which apparently was only written for RPi) - if it is allowed (check the licence for the lib you refer to).

Maybe you change it or get someone else to do it.  Standard for all things really.

John
Title: Re: Servo Motor on A64 board using python
Post by: LubOlimex on November 29, 2017, 09:16:11 AM
<<< We already figured out how to use the GPIOs. The thing is i can't make a servo motor move into a specific angle. I can only move it 0 and 180 degrees.

I see a number of servo libraries and examples that can be adapted once you know how to use GPIOs. Probably these can be adapted.

Once specific thing to consider is that you need to use code that uses software PWM (opposed to hardware PWM). This should be relatively easy since you already know how to use the GPIOs. I believe hardware PWM is very limited option since A64 has only one PWM.

Title: Re: Servo Motor on A64 board using python
Post by: NickSterg on November 29, 2017, 02:01:39 PM
Do you have any library that uses software PWM),  in mind that may work properly in a64 ??
Title: Re: Servo Motor on A64 board using python
Post by: Brian on December 07, 2017, 08:55:15 PM
Has anyone tried this? https://github.com/d3v1c3nv11/a64servo
I tryed to build but no succes  :(
Title: Re: Servo Motor on A64 board using python
Post by: JohnS on December 07, 2017, 10:24:08 PM
If you use the Olimex Linux it says it's already installed so no need to build.

Is it not there or what?

John
Title: Re: Servo Motor on A64 board using python
Post by: Brian on December 07, 2017, 10:46:50 PM
Not. Is not included yet, but i downloaded the latest image and everything builds just fine. Looking at the oscilloscope seems to be ok. Will test tomorrow with servos. 
Title: Re: Servo Motor on A64 board using python
Post by: JohnS on December 09, 2017, 12:44:55 PM
Ye gods!  It's stupid and irresponsible for the author to say it is there if it isn't!  (Are you sure it's not?)

John