Building servo drivers and more into mesa cards

More
23 Aug 2012 02:24 #23563 by TheWylieStCoyote
Hello, all

This is my first post on the LinuxCNC form, so please go easy. I am a Electrical engineering student so i am not a total noob to electronics. I have been working with embedded systems for the passed 5 years or so, same for programming, and I have some experience with FPGA and other programmable logic.

Is it possible, reasonable, useful, or piratical to build things like DC or AC servo drivers or other into the FPGA. There is more then enough room, there is 1.5 million gates on the 5I22 card so there is not shortage of space. On the 5I22 card page they talk "4 or 8 channel micro-controller based servo motor controller (DSP built into FPGA)". Does this work with a servo drive or is this interface with a half-bridge for each phase of the motor? If the later Then would it a possibly to build a VFD for the main motor of lets a mill or a lathe? I am referring to the digital control circuity for a servo drive or VFD, and not the power circuity or analog signal side of things.

Thanks!

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

More
23 Aug 2012 07:37 #23569 by andypugh
Wyliest wrote:

Does this work with a servo drive or is this interface with a half-bridge for each phase of the motor? If the later Then would it a possibly to build a VFD for the main motor of lets a mill or a lathe


It is nearly possible. I have even tried it.
The three-phase PWM module in some bitfiles creates the 6 required signals to drive an 3-phase H bridge.
You can then use the "bldc" HAL component without any feedback to calculate the phase amplitudes.
You will have noticed that not all of this is in the FPGA.

The problem is that such a system is voltage-mode not current-mode, as there is no curent feedback into HAL.

When I tried it, the IRAMS module I was using went "poof" but I don't think that this necessarily means that a more competent electronics chap couldn't make it work.

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

More
23 Aug 2012 17:58 #23585 by TheWylieStCoyote
One could use a current shunt resistor on the ground side of a each phase of the the H-bridge. That would be a voltage that is directly to the current though each phase. This sort of design would only need n-1 shunt resistors and analog inputs for n phases, the n'th phase can be found be conservation of current. This would require some analog filtering i.e. some low pass filters. I think all the current limiting I think could be offloaded to the FPGA on the mesa and some additional circuity probably both analog and digital. Things like ADC's, current limiting, and a current controller not to different from a switch mode power supply.

It is more then possible to do things like PID on only the FPGA ( this or using a 32bit micro-controller is probably how the big guys do this, this would just integrate all into one FPGA controller). How would interface a construct in the FPGA with the CPU software side of things? opencores.org/project,pid_controller,overview is a good example of building PID into a FPGA. To look at walk I am talking about from a block diagram perspective would look like the PID object taking input from an encoder and the CPU or some other object in the FPGA, with the output being fed into a object to handle what phase does what and current limiting and so on, then this would output 2n PWM outputs for n phases.

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

More
24 Aug 2012 07:41 #23608 by andypugh
Wyliest wrote:

It is more then possible to do things like PID on only the FPGA ( this or using a 32bit micro-controller is probably how the big guys do this, this would just integrate all into one FPGA controller).


Indeed, and have a feeling that some of the Mesa firmwares (Soft DMC) do this.

You can download the Mesa firmware VHDL from Mesa, and you can also download the Xilynx webpack, and create your own firmwares if you want.
(I have made small changes to the Hostmot2 firmwares to get specific combinations of functions)

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

More
25 Aug 2012 07:55 #23649 by TheWylieStCoyote
Maybe this is documented some but I have not managed to find, what does the the linuxCNC software and FPGA (VHDL) look like to build a new feature. Are there standardized form or structure or is this totally up to the creator?

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

More
25 Aug 2012 09:22 #23650 by andypugh
Wyliest wrote:

Maybe this is documented some but I have not managed to find

git.linuxcnc.org/gitweb?p=hostmot2-firmw...3eb762883cfdd49951e5

Look at the README file.

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

More
25 Aug 2012 10:08 #23653 by TheWylieStCoyote
Thanks,
I will have to spend some time reading over this.

I see there is a 3 phase PWM object, git.linuxcnc.org/gitweb?p=hostmot2-firmw...3eb762883cfdd49951e5 . I guess all that's needed is to link this to a gray code converter, a PID object, and some way of taking input from the software side of things for the digital side of things.

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

More
25 Aug 2012 10:57 #23656 by andypugh
Wyliest wrote:

I guess all that's needed is to link this to a gray code converter, a PID object, and some way of taking input from the software side of things for the digital side of things.


if you are talking about Hall sensors, then there is C-code for that here:
git.linuxcnc.org/gitweb?p=linuxcnc.git;a...f78ae2aefb43;hb=HEAD
Though that covers the general case of all possible Hall-sensor outputs, which you might not need.

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

More
25 Aug 2012 23:45 #23662 by TheWylieStCoyote
I was thinking about the shaft encoder like a capacitive or optical for the fine position sensing, but yeah a hall effect sensors for the position of the stater in the motor would be also needed if the encoder was not referenced to the output encoder.

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

More
13 Sep 2012 20:01 #24247 by TheWylieStCoyote
There should be some way of measuring what phase or what pole of the motor is where. This probably can be done with the same rotary encoder used for finding position and some setup and configuration so the controller know where every thing is. That is for a servo, a VFD for a motor where motor position is not of much interest i.e. spindle on a router or mill with out rigid taping. For this from what I can read the 3 phase PWM object already written for mesa cards I think would work just fine. I don't own a mesa card yet so I can try this out using LinuxCNC but I do own a spartan 3a I am trying to put a prof of concept together with that and maybe a AC motor and a encoder.

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

Moderators: PCWjmelson
Time to create page: 0.222 seconds
Powered by Kunena Forum