Driving SEW Motors

More
05 Nov 2012 22:35 #26281 by saskrick
Driving SEW Motors was created by saskrick
I am a faculty advisor helping some students convert an old camera gantry into a large-scale (10' x 10' x 6') foam cutter for making molds. The motors are SEW MDS60 servomotors with a sophisticated controller that is operated through RS 485 commands from a host computer (running EMC2) for movement. All of the resolver feedback and dynamics are handled within the actual motor driver.

Can the HAL be customized to provide RS 485 commands?
Rick Retzlaff, University of Saskatchewan

Please Log in or Create an account to join the conversation.

More
05 Nov 2012 23:08 #26285 by andypugh
Replied by andypugh on topic Driving SEW Motors

Can the HAL be customized to provide RS 485 commands?


Yes.

Whether it will work properly or not is a slightly different question, and might have to be settled by experiment.

Do you know the communications protocol? How would the drives feel about 1kHz update rates?

Does the existing PC have RS485 ouputs?

Please Log in or Create an account to join the conversation.

More
05 Nov 2012 23:36 #26286 by saskrick
Replied by saskrick on topic Driving SEW Motors
I am currently working with the engineers at SEW to clarify the communications protocol. I've done quite a bit of work with serial communication in similar applications, but not quite like this. It works in a call response system -- the command is given for positional setpoint, and the motor controller sends a command back when it achieves this setpoint. I would be surprised if it was happy with the one kHz update rate. These are industrial automation motors that are not used to this kind of thing.

I have a national instruments are RS485 PCI card that I intend to use

A backup plan would be to stick an Arduino Mega in the middle to interpret the step/direction signals from the parallel port output and then generate RS85 commands directly to the motor controller. My concern with this is jerky motion.

This will not be a precision machine no matter what we do. To some extent, it's a learning exercise for the students.

Please Log in or Create an account to join the conversation.

More
06 Nov 2012 00:33 #26290 by andypugh
Replied by andypugh on topic Driving SEW Motors

I would be surprised if it was happy with the one kHz update rate. These are industrial automation motors that are not used to this kind of thing.

Maybe it would help to describe a typical LinuxCNC control loop.
Every 1mS (typically) the servo-thread runs. It first reads all input (such as encoder positions), Then it calculates the next positions in the "motion" module, and then it updates all the outputs.
In the case of a parallel-port software-stepping setup some of the inputs and outputs are actually the commands and current positions of the software stepgens (and possibly encoder counters) which are running in the completely separate base-thread.
So, to run your drives in this structure, youwould be reading back a position from the drive and sending a new position at 1kHz.

I have a national instruments are RS485 PCI card that I intend to use

You would probably have to write a HAL driver for that card. (which might not be especially difficult).
I don't know of any currently-supported RS-485 hardware, though there is some RS-422 stuff.
The fact that I don't know about it is only a vague indication that it might not exist.
There is a userspace Modbus module. I don't know if that would be part of the solution. (taking the signals through HAL into Userspace might reduce the timing problems, even if the command position is updating at 1kHz the usersace component is free to ignore the fact).

A backup plan would be to stick an Arduino Mega in the middle to interpret the step/direction signals from the parallel port output and then generate RS85 commanda

Eeeew!

Please Log in or Create an account to join the conversation.

More
06 Nov 2012 00:52 #26293 by saskrick
Replied by saskrick on topic Driving SEW Motors
Thanks, This is a very useful conversation to me.

I am not convinced the 1 ms cyclic loop is relevant to these SEW controllers. From what I understand, when EMC2 is running in a closed loop system -- it is directly reading encoders and providing control signals to the motors themselves. Hence the PID Controller built into the system.

In the case of these SEW controllers, this is all occurring internal to the controller itself. You just tell it to go there, and it gets there with all of the ramps and feedback internal to the controller itself. Is this anything like any other interface that EMC2 works with? I don't think it's even possible to get direct encoder information back from the controller.

I understand your sentiment with regards to sticking an arduino in the middle. However, in particular what is the nasty bits of this that you could see?

Re userspace Modbus module - could you point me towards some documentation?

Rick

Please Log in or Create an account to join the conversation.

More
06 Nov 2012 02:30 #26295 by andypugh
Replied by andypugh on topic Driving SEW Motors

You just tell it to go there, and it gets there with all of the ramps and feedback internal to the controller itself. Is this anything like any other interface that EMC2 works with?

To a certain extent the Mesa and Pico stepper boards work this way, but in 1mS time slices.
The problem with sending endpoints and speeds to two motors is, how do you do a curved path which requires coordinated motion between two motors?
This problem gets more interesting when you consider acceleration limitation too.
The buffered systems such as the Smoothstepper often used with Mach3 presumably do the curve generation in the Smoothstepper, not in the controller.

I don't think it's even possible to get direct encoder information back from the controller.

That might not matter, you can either trust the motors to go to where they are told, or use any position feedback that comes back down the RS422 link.

I understand your sentiment with regards to sticking an arduino in the middle. However, in particular what is the nasty bits of this that you could see?

Partly that it adds more hardware in the middle of a problem caused by too much hardware. And partly going from position to step to serial to position.

Re userspace Modbus module - could you point me towards some documentation?

The code is here (including an annotated INI file)
git.linuxcnc.org/gitweb?p=linuxcnc.git;a...hb=refs/heads/master
I am not doing very well at tracking down any docs. It was based on this one:
wiki.linuxcnc.org/cgi-bin/wiki.pl?Contri...ts_Les_Newell_flavor
Which might have docs in the ZIP file.

Please Log in or Create an account to join the conversation.

More
07 Nov 2012 04:32 #26318 by saskrick
Replied by saskrick on topic Driving SEW Motors
I am still waiting to hear back from SEW with some of my questions. However, some thoughts.

Through RS 485 I can command a motor speed and retrieve position (not encoder counts, but actual position -- 32-bit integer. The motors actually have resolvers). If I had a driver that could talk through the RS485 card, HAL would look after PID control ???. What would be involved in terms of custom programming to make this happen?

It doesn't necessarily have to run at 1 kHz. This is a big ugly slow machine, I could run it more slowly. I read about a parameter in one of the configuration files that could slow this down.

thanks in advance.

Please Log in or Create an account to join the conversation.

More
07 Nov 2012 04:43 #26319 by PCW
Replied by PCW on topic Driving SEW Motors
If you can command motor velocity and read current motor position,
that should make a closed loop velocity mode PID control possible.

Since I would expect the velocity commands to be quite accurate
a lower update rate is feasible as long as you don't have very high
acceleration so the steps in velocity during acceleration do not get too big

As long as your driver can get the position in and velocity out to HAL pins the rest is doable
entirely in HAL or at the worst with a custom component or two

Please Log in or Create an account to join the conversation.

More
07 Nov 2012 04:59 #26320 by andypugh
Replied by andypugh on topic Driving SEW Motors

Through RS 485 I can command a motor speed and retrieve position (not encoder counts, but actual position -- 32-bit integer. The motors actually have resolvers).

That would be rotor angle, presumably? You can probably promote that to a multi-turn value fairly readily, code in the Mesa resolver card driver currently does exactly that.

If I had a driver that could talk through the RS485 card, HAL would look after PID control ???. What would be involved in terms of custom programming to make this happen?

If you had a driver, the rest becomes almost trivial.
Do you have links to the docs for the drives and the RS485 card?

Please Log in or Create an account to join the conversation.

More
07 Nov 2012 05:27 #26321 by saskrick
Replied by saskrick on topic Driving SEW Motors
I will have to check the hardware at the university - I'll get back to you as soon as I can. Thank you for the help.

Please Log in or Create an account to join the conversation.

Time to create page: 0.325 seconds
Powered by Kunena Forum