Welcome, Guest

Author Topic: Servo Motor on A64 board using python  (Read 1045 times)

NickSterg

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
Servo Motor on A64 board using python
« 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 !

LubOlimex

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1752
  • Karma: +45/-2
Re: Servo Motor on A64 board using python
« Reply #1 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
Technical support and documentation manager at Olimex

NickSterg

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
Re: Servo Motor on A64 board using python
« Reply #2 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.


JohnS

  • Hero Member
  • *****
  • Posts: 1674
  • Karma: +33/-45
Re: Servo Motor on A64 board using python
« Reply #3 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

LubOlimex

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1752
  • Karma: +45/-2
Re: Servo Motor on A64 board using python
« Reply #4 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.

Technical support and documentation manager at Olimex

NickSterg

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
Re: Servo Motor on A64 board using python
« Reply #5 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 ??

Brian

  • Newbie
  • *
  • Posts: 12
  • Karma: +3/-0
Re: Servo Motor on A64 board using python
« Reply #6 on: December 07, 2017, 08:55:15 PM »
Has anyone tried this? https://github.com/d3v1c3nv11/a64servo
I tryed to build but no succes  :(

JohnS

  • Hero Member
  • *****
  • Posts: 1674
  • Karma: +33/-45
Re: Servo Motor on A64 board using python
« Reply #7 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

Brian

  • Newbie
  • *
  • Posts: 12
  • Karma: +3/-0
Re: Servo Motor on A64 board using python
« Reply #8 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. 

JohnS

  • Hero Member
  • *****
  • Posts: 1674
  • Karma: +33/-45
Re: Servo Motor on A64 board using python
« Reply #9 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