![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| LinuxCNC (formerly EMC2) Discuss LinuxCNC (formerly EMC2) Controlers here! |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
I am planning to use BLDC servo motors with EMC2. The BLDC controllet itself has some microcontroller doing the controll task. Easiest way may be just do stepper step/dir emulation and connect it to printer port but then we are loosing most of servo advantages. Other way is just emulate DC-servo amplifier and connect it with analog interface to some proprietary DC-servo interface board and then connect encoder to same board and use existing DC-servo HAL drivers. This looks just too much extra complexity just unecessary converting the motor command to analog and back to digital and all other side efects come with it and of cource extra price of DC-servo board. I had in my mind idea that the inner servo loop can be moved to the microcontroller so that the microcontroller runs this 20Khz PID loop and reads the encoder. It just gets the 1Khz positioning commands from PC and returns encoder position. For this speed USB isochronous or Ethernet can be used. There is still possibility to also run the inner 20Khz loop in ENC2 and then use 100Mbit/s ethernet to send 20K command packets to controller. Then there is third, more complex and expensive solution that is still better than analog conversion. Make FPGA based PCI board using www.opencores.org PCI core, implement encoder input and SPI output for motor command. So, replacing DA->AD just simple SPI. There is also possibility still interface encoder to microcontroller and then use same SPI to read encoder position back. Ethernet, USB and SPI all needs to have new HAL driver. I have experience of linux kernel and driver writting but not yet any HAL experience. Katti |
|
#2
| ||||
| ||||
| Monolithic control for drives is a tempting idea, I would want one too. Some time ago I was planning to make drives that could share single RS-232 line for position controlling and feedback. It would be very cheap and might perform well. PC serial ports have FIFO buffers that could produce very steady command timing even on non-RT system. However, the real bottlenecks of machine accuracy or performance typically lie in some other place than PC<->drive communication. |
|
#3
| |||
| |||
That is too little even inner controll loop is implemented by microcontroller. Isochoronous transferin USB or 100Mbit Ethernet can offer 100..1000times performance and still price tag in 5..10Euro ( Some AT91SAM7 series chip). If you are not using SAM7 for actual BLDC, you can as example use SAM7 to communicate with PC and send commands via SPI to motorcontroller chips. I agree that The PC-Drive communication is not the bottleneck but at the moment it looks alike to be last link in chain missing because there is not yet any kind of communication method expect step/dir etc out from EMC2/HAL. It is not even so hard to write i am familiar Linux driver coding and RTOS but not yet HAL internals. Katti |
|
#4
| |||
| |||
There's an FPGA card sold by mesa electronics (www.mesanet.com) called "5I20 FPGA based PCI Anything I/O card " which sells for $199. It has a 200kgate FPGA and 72 general purpose I/O pins It will probably be hard to come to this price range for a DIY design - or it would require production of 100s of boards. There's an FPGA configuration for the 5i20 that has an EMC2 driver. it's called HOSTMOT-4. It provides 4 "analog" outputs and up to 8 encoder counters + about 24+16 bit general purpose I/O. the "analog" output for controlling a motor consists of a direction pin and a PWM output pin. The FPGA code in VHDL format is opensource and can be found in the EMC2 CVS. I emailed the guy who works at Mesa electronics who wrote the fpga configuration and he confirmed that they had also tried direct control of BLDC or 3-phase AC motors with the FPGA. One problem is that direct control requires lots and lots of pins. For 3-phase H-bridge driver you need 6 outputs. Then something for detecting the phase currents etc. Still, I think it would be a nice way to do motor control. Have all the "smart" bits of the control in FPGA/VHDL meaning they can be reconfigured anytime someone finds a way to improve the code. The power electronics would be "dumb" powerstages + current sensing amplifiers (IR2175 provides current sensing with PWM output, suitable for a digital-input-only solution). If I would be competent in VHDL I would probably pursue this option further right away but unfortunately I think I don't have time to learn VHDL right now... I understand the Xilinx compiler needed to compile the VHDL for the FPGA is available freely from Xilinx. AW PS. At work we have national instruments FPGA cards which can be programmed with LabView - soo much easier than VHDL. Well they cost about 3-5k /card + software .... |
|
#5
| ||||||
| ||||||
For just hobby you can order 2-layer 100x160 board based on Eagle CAD files from www.olimex.com in single quantities $33 Of cource in hobby you don't count price for assembling and design. One thing that i don't like in Mesa board is that it uses Paralax PLX9030 for PCI and i prefer using open cores PCI implementation directly for PCI. I have used the opencores PCI with Xilinx Spartan 2 PCI evaluation board andit is good and versatile block. For hobby board the 208 Pin QFP Spartan-IIE XC2S200E in dual layes board will be good choice.
with SPI to microcontroller instead of doing PWM.
macrosels if you try to make it switching phases using encoder or back-ENF sensing ( sensorles). The HAL sensor based can be done much easier.
alotofmacrocells or then using expensive FPGA that has internal CPU core like some Xiling ones has PPC core. These high end FPGA's are also PGA that requires expensive multilayer board and special assembly equipments. So,at the moment i think that cheaper FPGA in QFP and chep microcontroller is cost optimumin hobby quantities. The xilinx low end tools are freely downloadable. I have used them directly compile Opencores PCI. Katti |
| Sponsored Links |
|
#6
| ||||
| ||||
Andy, you really don't want to do everything on PC. It could even be bit dangerous since failure would mean uncontrolled power stage. |
|
#8
| |||
| |||
resync pause between frames. Also, still you will get more laency than USB or Ethernet. Still, it looks a like that there is needed some command-channel HAL driver for EMC that sends out velosity or position command via some command interface ( Ethernet, USB or even Serial ). It looks a like that there is none yet in EMC2. Having this kind of command channel block in EMC allows then expanding system with multiple diferent ways. May be i should look inside some "stepgen" module, take all stepgen code out and istead send packet out by Linux network interface. Network just because it is easiest way to implement and test. Then may be put same driver in other PC, just receiving packets and driving them to stepgen. When it works, then the other end can be implemented by microcontroller and other transport layers ( USB, Serial can be implemented ) Katti |
|
#9
| |||
| |||
can be implemented with 10Euro components and with 100 lines of C, i know, i have done it many times. At the moment my AD-converter sensor box for Nokia 770 uses Atmel AT91SAM7S USB and Uart emulation. Uart emulation allows to use normal Uart api in user programs but is not limited by any uart speed limits. I think that this Uart emulation is enough for 1Khw command channel but if someone likes to get 20Khz channel, then isochronous mode is needed. Some other places i have used some other microcontroller like MPC555 with ethernet chip. If i would do it again, i would use SAM7X chip. Katti |
|
#10
| |||
| |||
| unfortunately, usb isn't suitable for feedback control because the spec has massive latency built into it. If the feedback control loop is just being fed commands over USB, it will work. Ethernet is probably better. People also use firewire, because it doesn't have the latency. Anyone that has written kernel drivers should be able to write hal drivers with no problems. |
| Sponsored Links |
|
#11
| ||||
| ||||
| There are cheap serial port cards as well. I guess couple of these would do the job: http://www.usbgear.com/1x-Serial-PCI.html The default trajectory planner and PID period in EMC is 0.001 seconds (1 kHz) so I guess it is sufficient update rate for motion control. 20 kHz is used only in motor torque regulation loop, not position loop. There is no point of running 20 kHz position loop when mechanical bandwidth of machine may be under 100 Hz. |
|
#12
| |||
| |||
what kind of hardware is needed in the servodrive end to be able to receive and transmit on ethernet (I'm guessing UDP packets?) would it requre one network card per motion axis, or could many axes share one network port ? (100/1000 MBit hub in-between ?) |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |