This site will be migrated to another Webfaction server soon, so there may be some disruptions during the next week. Please be patient.
June 6, 2013 1 Comment
One complaint I have about most proprietary motion control field buses is that the I/O choices available are very limited. Standard field buses such as CANOpen, Ethernet PowerLink, and EtherCAT have a much better selection of I/O modules as well as a wide selection of drives, but there’s one device that’s hard to find on most motion networks, proprietary as well as standard: an interface to analog servo drives.
Analog servo amps are still important because specialized equipment such as piezo motors can require you to use a custom servo amplifier, which typically has a +/- 10V analog input. So if you want to use these devices on a network, you’re out of luck — unless you can get a network to analog drive.
The Logosol LDCN is the only proprietary motion network I know of that has drives with an analog output (they are the LS-160, LS-170F, and LS-180).
I’ve only found one company making analog output drives for a standard motion network: the ACS Motion EtherCAT intefaces. ACS has various models. The SPiiPlusUDI modules can control 2 or 4 analog servo amps. The SPiiPlusPDM modules can control 2 or 4 step/dir input drives, including step/dir servo drives, stepper drives, or laser generators.
I think the UDI modules are more useful, but I’m sure the PDM modules can be handy. For example, if you want to use a proprietary Asian servo motor that has to be used with a proprietary drive that takes step/dir input.
May 30, 2013 No Comments
I went to the three day TI Industrial Control Workshop in Santa Clara. Instead of repeating stuff (such as class outline) that you can read on the wiki link (above), I am going to give my impressions.
The bottom line: yes, the workshop is well worth attending if you like to (or just have to) control motors. 5/23/2013: I also want to add that I think this workshop is good for automation developers like myself. OK, I’m not sure it’s worth flying to another city to attend, but if there’s one close (next one is 17-19 September 2013 at Brookfield, WI) then it’s good to attend — you’ll learn a lot more about what goes on underneath the covers of your VFD or servo drive. I know I have a better understanding and appreciation of my drives. Also, you can just about do the course on your own by downloading the materials, but it’s not the same experience.
Disclaimer: I paid for this class myself (OK, at $79 it wasn’t a big deal – and the price includes snacks, lunch, and a F28069 controlStick); it was a very nice break from my typical workdays.
Considering TI must be subsidizing the workshop, it had amazingly little marketing content – less than a typical trade mag article. There was no mention of TI products at all on the first day (control theory) and very little on the second day (mostly pride in TI’s new instaSpin solutions). The third day was all about TI products (F28x DSP), but it was all about the product (architecture, peripherals, Code Composer Studio, etc), not marketing.
Overall, there were many good discussions, and lots of questions. I enjoyed learning about what other people are doing.
I think all three instructors did a good job; the biggest issue was time – each class easily could’ve been at least a week, so they had a real challenge trying to fit in as much material as possible, explaining it in an understandable manner, while still answering questions (and all three did a good job of answering the many questions).
Day 1 – Control Theory (Richard Poley)
On day 1 I felt like I was back in college; it was like a month (or more!) of college stuffed into one day — and the soft-spoken instructor, Richard Poley, reminded me of a college professor.
You do need to have a good math background to follow the theory. Fortunately I had a lot of math in college, and I did some reviewing via wikipedia before the workshop. I won’t claim I understood everything perfectly, but I felt I remembered enough to follow the basic concepts.
The theory got a little practical at the end of the day with sections on Digital Controller Design, Implementation Considerations, and a Suggested Design Checklist.
I’m pretty sure the vast majority of attendees don’t use control theory day to day. I know I don’t; for example, we rarely have problems tuning motion controller PID loops. So for me, the theory isn’t very useful for my day today tasks; in fact, trying to use it when it’s not necessary is a waste of time.
But it’s still good to know the theory for when the normal experienced-based approach doesn’t work. (The same applies to programming, say sorting: if you have a small set of data, all sorting methods will be reasonably quick. But if you have large data sets, knowing the theory of different sorting methods is critical).
I’m now interested in learning about state variable control theory, which is covered in the two day version of the Control Theory seminar, but it will be a while before I’ll be able to find time for project.
Day 2 – Motor Control Theory (Dave Wilson)
Dave Wilson is a motor geek and a primary contributor to TI’s Motor Control blog, which is a treasure trove of motor control information (even if you don’t use TI chips, since most of info isn’t TI-specific).
Dave Wilson emphasized AC induction motors and servo motors, because none of us were interested in stepper motors. He covered motor control theory and all the common algorithms (such as field oriented control). He discussed advantages and disadvantages of the different motor types and motor control algorithms. He did a good job of answering the many questions. And, yes, he is very excited by TI’s instaSPIN solutions (especially instaSPIN-FOC).
I really like Dave Wilson’s Power Point and VisSim animations that graphically showed what was going on to make the motors spin.
Day 3 – Intro to F28x (Ken Schachter)
This day was a rapid fire introduction to the F28x DSP series. The instructor, Ken Schachter, gave an overview of the peripherals, an overview of the available software such as controlSuite, and then we spent a lot of time doing labs that showed off some of the Code Composer Studio (CCS) goodness (like graphing memory).
I’d call the class an orientation – I wouldn’t even say I become comfortable, but I do feel like I got my feet wet with the tools, and have a better idea of how to start. CCS is pretty intimidating at first, and TI does provide a lot of libraries and examples.
May 21, 2013 No Comments
I have a substantial amount of Python code that needs to talk to the Microsoft world using COM (both as a client and as a server). Parts of the Python COM server are pretty slick, such as dynamic dispatch (I use dynamic dispatch to automatically make Python methods whose name match a specific pattern available via COM).
However, it’s much harder to debug a Python COM server. In VB6, I can start an out of process COM server from the IDE, wait for clients to connect, and easily use all the VB debugging goodness….
But I can’t do that in Python. Most of the time I’ve managed OK by either testing the code via a different non-COM interface or using logging. However, I did find a better solution for when I just have to see what’s going on: Winpdb.
Winpdb is a cross-platform (Windows, Linux, and possibly more – not just Windows) remote debugger with a graphical interface. I installed it without problems (basically, installed wxPython then Winpdb), and used the embedded debugging feature. Just remember to remove the debugging code when you’re done.
May 15, 2013 No Comments
The BeagleBone Black is out, and many are comparing it to the Raspberry Pi (RPi) and Arduino. Compared to the previous BeagleBone, the major changes are the price ($45, down from $90), a HMDI output, more speed (1Ghz vs 720MHz), more memory (512MB DDR3L instead of 256MB DDR2) and 2G on-board eMMC flash memory. The BeagleBone Black also has a 100BaseT Ethernet port, a USB 2.0 HS host port, a USB 2.0 client (device) port, and a microSD slot.
If you just want a little Linux box for learning and compact computing tasks, the BB-B is just a little more than the RPi: a little more expensive ($45 vs $25/$35), a little faster (1GHz vs 700MHz), a little more flash (2G eMMC vs nothing) — and a lot less popular (by volume, the RPi has outsold by BeagleBoard + BeagleBone by at least 10:1, although that probably will change now with the Black’s lower price).
But the BeagleBone’s great potential is as a controller, not a RPi clone, since it has excellent digital peripherals (better than many microcontrollers) available on its 2 46-pin connectors.
This Bone isn’t perfect. I really wish the new Bone had 1G Ethernet (since it has 1G MACs) instead of 100M Ethernet. Since the BeagleBone’s pins are heavily multiplexed, you can’t use all the peripherals at the same time. Some expansion pins are also used by the system (e.g. one of the I2C channesl must be shared with the cape ID memory). So what’s available on the expansion connectors?
- 1 McASP buffered serial port (e.g. for audio devices)
- 2 SPI ports
- 2 I2C ports
- 4 UART ports
- 2 CAN ports
Memory and Parallel Bus
- 2 MMC channels (the BB-Black uses one of these for its eMMC memory).
- GPMC (General Purpose Memory Controller, a 100 MHz 16-bit external bus)
Timers and DIO
- 4 Timers
- 2 eCAP (enhanced capture) units
- Up to 66 GPIO (general purpose I/O)
- 7 Multiplexed 1.8V analog inputs going to a 100KHz 12-bit ADC (the eighth channel is used by the system).
Motion Control Peripherals
- 3 HRPWM (high resolution PWM) systems with 6 outputs.
- 3 eQEPs (enhanced quadrature encoder inputs, used with incremental encoders).
At a glance, I’d say TI has “borrowed” theF28xHRPWM, eQEP, and eCAP peripherals for various other chips, including the Sitara chip used in the BeagleBone. The F28x DSPs have a good selection of motion control software available from TI, such as the various InstaSPIN libraries and controlSuite. TI has ported some of their motion control software to the Stellaris and Hercules lines, but not to the Sitara. It’d be great if they did, but not even TI has infinite resources, and the payback probably isn’t there; after all, the volume motor control market is in stuff like cars and clothes washers, and those guys aren’t going to replace a $3 DSP with a $15+ Sitara module (MPU, DRAM, flash, etc).
PRUSS (Programmable Realtime Unit Sub-System)
I’ve always been intrigued by programmable co-processors, going back to the days of the Freescale (Motorola) MC68332, which has a TPU (Timing Processing Unit). I’m pretty sure the TPU was mainly used in high volume applications (not by many hobbyists), although Circuit Cellar Ink did run a series on programming it. The MC68332 was used for motion control in several Galil controllers.
TPUs and improved TPUs were also used in a variety of ColdFire and PowerPC microcontrollers. Freescale also developed a communications co-processor, the QUICC Engine, which was used in a variety of PowerPC MCUs such as the MPC8360. Recently, I think Freescale has moved away from co-processors, possibly due to the increased speed of MCUs. For example, none of the QorIQ PowerPC chips have the QUICC Engine.
TI has used similar co-processors before, such as the HET (High End Timer), NHET, and N2HET on many Hercules safety MCUs, the CLA (Control Law Accelerator) on some C28x DSPs, and the original PRUSS on earlier Sitara MCUs.
The BeagleBone’s unit is officially called the PRU-ICSS (Programmable Realtime Unit – Industrial Communications SubSystem); it’s easy to see why, since peripherals include 1 12Mbps UART (perfect for Profibus), 2 Ethernet MII’s, 1 MDIO, and 1 eCAP. TI provides drivers using the PRU-ICSS for real time industrial networks such as Profibus, EtherCAT, and Ethernet PowerLink.
The PRU-ICSS has two 32-bit processors inside that run at 200 MHz, with each instruction taking one cycle, so it’s great for deterministic tasks, especially if the BeagleBone is running a non-real time OS. TI has released PRU development tools, and a Linux driver.
I think the PRU-ICSS can be used for a lot of things that it wasn’t designed for, and open source is already making a difference. For example, there’s the PyPRUSS software. The PRU is already being used for stepper control by BeBoPr and Replicape capes. Another possible PRU use is producing precise, high speed digital waveforms for test.
5/23/2013: some additional PRU notes: according to a g+ discussion by Charles Steinkuehler, the GPIO logic can only be updated every 40nS, which limits its maximum GPIO frequency. Also, there’s a good BBB PRU overview and getting started guide here.
5/28/2013: here’s another creative use of the PRU: interface to a serial mode LCD.
BeagleBone capes are similar to Arduino shields: they’re boards that stack onto the BeagleBone’s expansion bus. Theoretically, you can use up to 4 capes at one time, but the practical limit is typically much less, since the expansion pins have many different uses, and if the capes fight over the pins, the result won’t be pretty.
Capes currently available or available soon include RS232, RS485, Profibus, 1-wire, CAN (with driver and connector), prototyping area, stepper motor drivers, camera, WiFi, LCD touchscreens, and FPGAs. The variety of capes make it that much easier to create a one-off BeagleBone system to perform a specific task. Most capes cost more than the BeagleBone Black.
Operating system support includes several Linux variants (including the Xenomai real time framework for Linux), Android, Minix3 (port in progress), several commercial RTOS’s (at least QNX, Integrity, Nucleus+), SYS/BIOS, and the no-OS StarterWare.
Linux adds a lot of power, but it also adds a lot of complexity, especially when all you want to do is simple I/O. To make the BeagleBone easier to use, the BeagleBoard folks have produce Bonescript, a node.js based language featuring Arduino-style functions. Bonescript can run in a brower or in the Cloud9 IDE.
TI has realized that not everyone wants or needs a OS, so TI created StarterWare. StarterWare components include peripheral drivers, the IwIP TCP/IP stack, MMC/SD drivers, and simple graphics borrowed from StellarisWare.
StarterWare can also be combined with an OS; TI’s SYS/BIOS combines StarterWare with a RTOS, and is used by the real time Ethernet drivers for the Sitara AM3359-based ICE (Industrial Communications Engine). Since the BeagleBone uses a similar CPU (AM3358 or AM3359), it should be easy to get the Sitara SYS/BIOS working (although the EtherCAT client won’t work on a AM3358).
The BeagleBone’s Place In The Linux World
There are other ultra low cost (<$50) Linux boards, including the aforementioned Raspberry Pi, the OLinuXino ($30-$80), the Aria G25 SOM, and possibly others. If you just want to run Linux, and maybe use some I2C, SPI, or UART ports, all will do the job.
The i.MX233 and Allwinner A13-based OLinuXino’s have two big advantages: they’re easier to use in your own design because they do not use any BGA chips (which are unaffordable to assemble in small quantities), and the schematics are in Eagle PCB (which is much more affordable than Allegro which is used by the BeagleBone).
The BeagleBone’s big advantages are its peripherals (especially the PRUSS, GPMC, HRPWM, and eQEPs, which give it a big edge in control applications) and its expanding cape ecosystem, which make it easier to get something built without doing a lot of custom design. It really is a kind of Raspberry-Duino.
The BeagleBone’s Place In The Embedded World
All of the ultra low cost Linux boards provide a lot of bang for the buck. For example, the BeagleBone Black versus the Arduino Due (~$50) looks like no contest: 1GHz vs 84MHz, 512M DRAM vs 96K SRAM, 2G flash vs 512K flash. The Due has better analog I/O, but the ‘Bone has better digital I/O, Ethernet, high speed USB, and more.
Arduinos are still going to be around because of its extensive ecosystem and ease of use. Heck, BASIC Stamps are still around.
Custom PCBs with microcontrollers aren’t going anywhere, either. Think about the challenges in fitting a RPi or BeagleBone into a case that fits your product, but still provide access to all of the connectors… And, if you don’t need the extra compute power, these little Linux boards still add cost, complexity, size, and power compared to a single chip microcontroller.
I think BeagleBone could use an easy to hack, close to the metal solution such as a straight port of eLua, or a “eLua-JIT” port consisting of the LuaJIT Just-in-Time Lua compiler, libraries similar to eLua’s, resting on the base of StarterWare or maybe SYS/BIOS + StarterWare.
I think the BeagleBone is similar to the PC: frequently used in embedded applications because they provide great price/performance, and rapid development because there’s lots of hardware, software, and documentation available. Similarly, the BeagleBone might cost more than a full custom solution, but for one-off or small volume projects can provide a much quicker solution with its software (Linux, Android, etc) and available capes. (To be fair, the Arduino already provides a similar environment for rapid prototyping).
My verdict: next time I order from Mouser/Digikey/Newark, I’ll be adding a BeagleBone Black; my next challenge will be finding time to play with it…
P.S. – After I wrote all of this, I realized that most of my post also applies to the original BeagleBone — except the Black’s price is 50% lower, and that makes all the difference in the world. Last year, if I had needed a little Linux controller board, I would have seriously considered the RPi over the BeagleBone; now, using the Black is the obvious choice for me.
May 7, 2013 2 Comments
My final look is at NEMA17 motors. Today’s contestants are:
- In yellow, the IMS (now Schneider) MDI1PRL17C4x triple stack NEMA stepper motor with integrated driver and controller. I’ve used these cute little motors before; they are a great fit for the right application. As normal, the programming language sucks, but a CANOpen version is available.
- In red and blue, a Panasonic MUMS011A1 NEMA 17 servo motor. These motors have unfortunately been out of production for years; I loved their performance, encoder (10000 cpr), good looks, and price (about $250).
- In green, a Quicksilver Controls QCI-A17H3 stepper motor with encoder that’s driven like a servo. I’m including it to show how much improvement you can get from closed loop stepper control.
- The MDI1PRL17C4 shows typical stepper characteristics, with torque rapidly dropping off; it can’t even reach 2500 RPM.
- The MUMS011A1 shows typical servo performance, with a pretty flat torque curve, 3:1 peak to continuous torque, and compared to the steppers: higher speeds, less continuous torque at low speeds, more continuous torque at high speeds, and much higher maximum torque.
- The QCI-A17H3 doesn’t turn the stepper into a servo, but compared to an open loop stepper, it has substantially higher maximum speed (4000 RPM – the highest of any stepper I’ve looked at), and offers significantly higher torque at higher speeds — in exchange for a higher price, of course.
Some General Stepper & Servo Notes
- Steppers are much simpler to drive: you can easily build a low cost drive using an integrated chip (e.g. from Allegro Microsystems, ST, or TI) or buy a commercial driver for $100-$150 (from Automation Direct, Gecko Drive, etc). Many low cost PLC’s such as Panasonic’s FP0/FPG have built-in step/direction outputs.
- But open loop steppers are very annoying, because you have to figure out your needs before start: you have to specify fixed currents for holding and running torque. If your current is too low, the motor will miss steps. If your current and duty cycle are too high, the motor will get hot – and if a bit of extra torque is needed to overcome something unexpected, you’re out of luck.
- Closed loop steppers still aren’t servo motors. However, I’m looking forward to affordable sensorless closed loop control (available or coming from Trinamic, TI, and probably others), which will improve stepper performance and minimize stepper heat generation.
- I think servo motors’ torque curve fits well with many applications: a lot of time you just need maximum torque for a short time period. Servo motor system prices are also coming down (OK, not the basic motor, but there are affordable encoder, drive, and controller choices).
April 26, 2013 No Comments
In this post, I’m going to look at some fun NEMA23 single stack servo motors and a single stack stepper motor. The entrants are:
- In brown, the PacSci M21 with Sigmax technology. The M21 has a lot more torque than many (most?) NEMA23 single stack steppers.
- In blue and red, one of my favorite motors: the BH02300 servo motor. I’ve spun one of mine at 20,000 RPM. Like the Emoteq QB series, the BH series has great peak torque.
- In yellow and green, the MCG (now Ametek) I2351014NC servo motor. After all the high end motors, I decided it was time to feature a non-exotic and affordable (if you can get it) motor.
- The difference between the I2351014NC and the BH02300 is the peak torque (the BH02300 has much more) and maximum speed (20,000 RPM vs 12,000) and, of course, price; continuous torque is about the same.
- Both servos are can go much, much faster than the M21 stepper (although at 3000RPM, it’s pretty fast for a stepper motor).
- The M21′s continuous torque looks pretty good; it always has more continuous torque than either servo, and below about 2000 RPM has more continuous torque than the I2351014NC has peak torque.
- OK, it’s not really far to compare these motors — they obviously have their own areas (low end torque and low cost for the M21, high speed and moderate cost for the I2351014NC, and high speed, high peak torque, and high cost for the BH02300) but it’s fun to see big differences between motors that are all about the same size.
April 25, 2013 No Comments
NEMA34 Torque Curves
Today I am examining some interesting NEMA34 motors’ torque curves. The graph is a bit complex because I want to show a variety of motors on one graph; to make it a bit simpler, I am using dashed lines for servo continuous torque, and solid lines for servo motor peak torque.
I chose motors that are all roughly the same size.
The motors and their colors are:
- Burgandy Red – PacSci N32 PowerPac double stack NEMA34 stepper motor at 75V. I choose this motor because it’s a high end stepper, and I own a couple.
- Red – PacSci K32 PowerPac double stack NEMA34 stepper motor with Sigmax technology, also at 75V.
- Yellow – Emoteq QB03402 double stack NEMA34 servo motor. I own a similar motor (QB03403), plus the peak torque is very high.
- Green – Parker Compumotor BE342H double stack NEMA34 servo motor at 170V. Parker makes some really nice servo motors; the BE series has a lot of torque, and I want to look at the effects of voltage on torque curves. The BE342H and BE342K have different windings.
- Brown – Parker BE342H at 340V.
- Dark Blue – Parker BE342K at 170V
- Light Blue – Parker BE324K at 340V.
- The NEMA34 stepper curves are similar to the NEMA23 stepper curves; torque still drops off rapidly with increasing speed. One quirk: maximum torque is around 120 RPM, not 0 RPM.
- PacSci’s Sigmax technology does provide significantly higher torque at all speeds, but does not change the shape of the torque curve.
- Overall stepper vs servo comparison is similar: the steppers have much more continuous torque at low speeds, less continuous torque at moderate speeds, less peak torque at all speeds, can’t handle high speeds, and cost significantly less than servos.
- The Emoteq BH03402 has exceptional peak torque, but you’ll have to provide a lot of current (e.g. 50A for the 130V C windings).
- The Parker BE342 shows the impact of voltage and winding. When the servo motor does not get enough voltage, its torque can decrease like a stepper, but for a different reason: back EMF.
- The BE342K might seem better than the BE342H, since it has the “best” torque curve, but that comes at price: the same torque requires double the current of the BE342H.
- Stepper currents are much lower; the maximum current of any N32/K32 model is 10A.
- As always, it comes down to knowing your requirements: torque, speed, size, current, budget, etc.
April 24, 2013 No Comments
While I was working on my upcoming project, I got sidetracked by the issue of servo motors versus stepper motors. Since I’ve never seen direct stepper and servo torque curve comparisons, I created four comparison charts using a variety of interesting motors.
Disclaimer: I graphed all the torque curves myself, and their shapes should be pretty accurate; however, I didn’t have very good data for some motors (e.g. Emoteq peak torque). Motor pricing can very quite a bit, depending on the exact model and quantity ordered, so any pricing is a rough guide.
If you click on the images, you will get a much bigger version. To avoid a megapost, I’ve split this topic into multiple posts.
Now that the preliminaries are out of the way, let’s start with the first contestants.
First up is a pair of motors: the Kollmorgen AKM21G single stack NEMA23 servo motor with 75V winding and the Pacific Scientific P22 double stack NEMA23 stepper motor.
I picked these motors because 1) they are both from the same company (Danaher), 2) I’ve used both, 3) they’re about the same size, 4) are designed for similar voltages, and 5) both are high end motors, so they should show off the best of their technologies.
The colors are as follows:
- Red – AKM21G peak torque
- Blue – AKM21G continuous torque
- Green – P22 at 72V
- Yellow – P22 at 24V
- Notice how quickly the P22′s torque falls off at 24v – at slow speeds, torque is about 150 oz-in, but it’s <50 oz-in by 1000 RPM (substantially less than the AKM21′s continuous torque).
- The P22 is considerably better at 72V – the torque curve is much flatter, and it has more continuous torque than the AKM21G up to about 2100 RPM. The higher drive voltages reduces the effects of the stepper motor’s inductance.
- Servo drives are the only option for higher speeds. The AKM21G is rated at 7800 RPM max, while the P22 torque curve only goes to 3000 RPM.
- The AKM21G has a much flatter torque curve, especially continuous torque.
- The servo’s peak torque is a big advantage: the peak torque available from the single stack AKM21G is ~50% greater than the maximum P22 stepper torque. The peak torque advantages gets much bigger as the speed increases.
- On the other hand, the servo is much more expensive: an AKM21G will run $400 or more, while the P22 is around $100.
March 30, 2013 No Comments
I can remember back in the 1990′s when ergonomics was a big deal. Companies were pushing ergonomic chairs, ergonomic monitors (adjustable, etc), ergonomic keyboards, ergonomic mice, ergonomic mice alternatives (such as trackballs) and so on.
You can still find ergonomic equipment, but it’s definitely not “hot”, and a lot of it (like Kensington and Logitech trackballs) looks like it hasn’t been updated from the 1990′s…
I think it’s the smart phone and tablet revolution: they’re what’s hot, and, just like in the dot-bomb bubble, everything was “on the web”, now everything is supposed to be mobile or in “the cloud”, whether it makes sense or not.
Yes, tablets and phones have their place, and I own both, but they’re not very ergonomic for any kind of extended use if you’re creating content. Normal, cheap keyboards are crappy enough, but they’re great compared to typing on glass.
I value my long term comfort and health, and I like to create, so ergonomics still matter to me. I’ve started a major C# programming project; I find having two 24″ monitors really boosts my productivity. I can’t imagine trying to do this project on a tablet (ugh!) or phone (yuck!!!!).
My Unicomp keyboard is much better than average, but I’ve ordered a mechanical keyboard. After I’ve used it for a while, I’ll post a review.
February 25, 2013 No Comments