polszimanski
Posts: 4
Joined: Thu Feb 16, 2017 10:31 am

Servo Control

Thu Feb 16, 2017 10:46 am

Hey there,
I need to create a code on Python that control the number of pulses that one of the GPIO´S are going to send to a driver (Yaskawa SGDM-A5ADA), so i can control a servo motor (SGMAH).

My problem is : I don´t know how to create a code that makes a pre-defined number of pulses (On PWM of course), and i really need to make it run as soon as i can.

Does anyone know somthing that could help on that ??

Regards

User avatar
joan
Posts: 14652
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Servo Control

Thu Feb 16, 2017 12:18 pm

Servos are normally controlled with 1-2ms pulses at 50Hz or so. If that's what you need look at (my) pigpio, servoblaster, or RPIO.GPIO to transmit the pulses.

If your driver doesn't work that way you will need to explain the pulses required in more detail.

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

Re: Servo Control

Thu Feb 16, 2017 12:36 pm

This would appear to be an industrial AC kW power servomotor and drive.

https://www.yaskawa.com/downloads/searc ... PS80000015

You will have to explain in detail hat you need to control that. It's not a radio-control servo.

What are Pulse waveforms and voltage levels (not 3.3V, I bet)?

BMS Doug
Posts: 3824
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: Servo Control

Thu Feb 16, 2017 2:21 pm

section 8.6.1, page 8-49 (page 430 of PDF) details the reference pulse forms for position control.
Terminals CN1-7 and CN1-11 seem to be required (or inverse signals on CN1-8 and CN1-12)

Pulse input timings are detailed in section 8.6.3, page 8-53 (page 435 of PDF), the next page deals with connection examples (either 12V or 24V).
Doug.
Building Management Systems Engineer.

polszimanski
Posts: 4
Joined: Thu Feb 16, 2017 10:31 am

Re: Servo Control

Thu Feb 16, 2017 3:32 pm

Well, i´m using a 3,3v to 5v converter, and Yaskawa have this IO´s connector (CN1), that use 5v as a input signal.


The point is, i would like to know what you guys thing about it.
Do you think it is possible to control the servo with the Raspberry ??


This is a new application that we are trying to build, and we want to use it as a new product (Use Python and Raspberry to control industrial motors and a lot of ther things)

User avatar
joan
Posts: 14652
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Servo Control

Thu Feb 16, 2017 3:34 pm

What pulses do you want to send?

polszimanski
Posts: 4
Joined: Thu Feb 16, 2017 10:31 am

Re: Servo Control

Thu Feb 16, 2017 3:39 pm

I´v seen this manual already (I´m using it right now), but the problem here it´s really about the pulses.
I need to create a code that output a defined number of pulses.

I´m really in a hurry right now, i´ll be out for 2 or 3 hours, when i come back i´ll give you more details about it.

Thank you guys !!!

polszimanski
Posts: 4
Joined: Thu Feb 16, 2017 10:31 am

Re: Servo Control

Thu Feb 16, 2017 3:42 pm

I´m not sure about the details right now, i really come here to ask you guys if it is possible to create a code on Python that would do what i need.
Anyway, i come back with more details as soon as i can

henryhanselscott
Posts: 107
Joined: Sun Jan 18, 2015 1:31 pm

Re: Servo Control

Thu Feb 16, 2017 5:05 pm

I work with this type of servo often in industrial controls. Generally speaking, they require a pulse step and a direction input. The motion control profile is generally part of the pulse step train. Operating like this, they are like driving a stepper motor only with closed loop feedback. When figuring for acceleration, max velocity, move distance and then deceleration all this is controlled by a variable pulse frequency and an absolute total number of counts. I have never tried to do this with Python, generally I off-load this task to a PIC which is much more deterministic in nature. I use the pi as a master device and send the move data to a PIC with serial data for each axis of motion. However, there is at least one type of servo that you can send a simple burst of pulses to and it works out the motion parameters.

https://www.teknic.com/model-info/CPM-MCPV-3441D-RLN/

I am using some of these in a current project and they are very high quality motors.

User avatar
mikronauts
Posts: 2739
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: Servo Control

Thu Feb 16, 2017 6:36 pm

That's a nice motor!

I totally agree with you about using a microcontroller to generate deterministic jitter free timing (one of the reasons I designed RoboPi)
henryhanselscott wrote:I work with this type of servo often in industrial controls. Generally speaking, they require a pulse step and a direction input. The motion control profile is generally part of the pulse step train. Operating like this, they are like driving a stepper motor only with closed loop feedback. When figuring for acceleration, max velocity, move distance and then deceleration all this is controlled by a variable pulse frequency and an absolute total number of counts. I have never tried to do this with Python, generally I off-load this task to a PIC which is much more deterministic in nature. I use the pi as a master device and send the move data to a PIC with serial data for each axis of motion. However, there is at least one type of servo that you can send a simple burst of pulses to and it works out the motion parameters.

https://www.teknic.com/model-info/CPM-MCPV-3441D-RLN/

I am using some of these in a current project and they are very high quality motors.
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

User avatar
mikronauts
Posts: 2739
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: Servo Control

Thu Feb 16, 2017 6:41 pm

You need to provide way more information if you would like more specific help.

If the device does not take standard servo pulses, you may be able to:

1) use joan's pigio and generate wave tables for it

2) add a microcontroller to generate the deterministic pulse trains

I'd say that the Pi (potentially with an add-on microcontroller) can control any motor.

FYI:

As a rule of thumb, people here are more than happy to point you in the right direction to do the work yourself, but don't expect people to read data sheets for hours and implement solutions at no cost.
polszimanski wrote:Hey there,
I need to create a code on Python that control the number of pulses that one of the GPIO´S are going to send to a driver (Yaskawa SGDM-A5ADA), so i can control a servo motor (SGMAH).

My problem is : I don´t know how to create a code that makes a pre-defined number of pulses (On PWM of course), and i really need to make it run as soon as i can.

Does anyone know somthing that could help on that ??

Regards
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

Return to “General discussion”