Xmos Control and Robotics Development Board

XCore Project reviews, ideas, videos and proposals.
User avatar
Folknology
XCore Legend
Posts: 1274
Joined: Thu Dec 10, 2009 10:20 pm

Xmos Control and Robotics Development Board

Post by Folknology »

Hi Folks

As part of a electromechanical project I am working on, I have to design a control board. Given that I hate having to do the same thing twice I figured I would make the control board flexible so I could use it for other projects in both motor control and even simple robotics type applications. Here are some of the features that I need to include and will be standard:

1) Xmos L1 for the low level control system PWM, Motors, encoders etc..
2) At least a single and perhaps even dual 12 bit ADCs
3) At least a single and perhaps even dual 12 Bit DACs
4) Virtual serial port via usb
5) At least 1Mbit Flash
6) RTC/Timers for monitoring
7) UART/SPI for comms/

I will also make plugin boards for the project itself and later for more general usage in robotics etc..

So my question is what features would you like to see or consider important for general robotics and control purposes, if they are modest I could include them.

Thoughts?


kster59
XCore Addict
Posts: 162
Joined: Thu Dec 31, 2009 8:51 am

Post by kster59 »

You can cover most of your requirements with an onboard MCU like the Silabs 8051F342

I planned a project where I used it with the XMOS.

8x ADC (only 10bit)
USB with real drivers (easy USB)
fast SPI for comm uses only 1 pin off the XMOS device

The silabs chip requires no external parts except a few caps. Internal oscillator.

I put the silabs chip in slave mode and interrupt on an SPI receive.

Commands from the XMOS can request the ADC and USB data.
kster59
XCore Addict
Posts: 162
Joined: Thu Dec 31, 2009 8:51 am

Post by kster59 »

Also the Silabs C8051F342 has onboard 3.3v reg @ 100ma. The silabs chip can eliminate several of the chips off the XMOS design by programming it to output a high on reset into the 1v regulator.

Also power good can be sampled by the adc to eliminate the reset monitor.

The precision oscillator isn't great but maybe it's good enough to eliminate the crystal too.

If you were really clever you could eliminate the flash chip by eliminating the SPI bootup sequence of the flash RAM.

So really it could be as simple as 1x C8051F342 and 1x L1-64 chip + a few caps.

I'd like to work together with someone on this design but my time is limited. I have my own modules prototyped and ready for production but this would be a better design.
User avatar
lilltroll
XCore Expert
Posts: 956
Joined: Fri Dec 11, 2009 3:53 am
Location: Sweden, Eskilstuna

Post by lilltroll »

Look @ 4:50
lelJbs5VyMc

F.O.C == Overkill ?? :mrgreen:

The electrodynamic actuator (as in a loudspeaker) is very similar to the electrical engine. One produces force along the z-coordinate while the other does in angular coordinate (cylindrical coordinates).

Using positive current feedback, e.g. negative output impedance, you can transfers the electrodynamic actuator to become a velocity generator, (thus the velocity is independent of any force applied to the actuator). Let's see what do you want with a motor - constant speed independent of any external torque applied on the rotating axis? e.g. the angular velocity is independent on any force applied in the angular dimension.
(The magnetic flux density is approx. constant through the coil in the actuator independent on the position, in the DC-motor the flux through the coil varies with the absolute angle)
Probably not the most confused programmer anymore on the XCORE forum.
JohnR
Experienced Member
Posts: 93
Joined: Fri Dec 11, 2009 1:39 pm

Post by JohnR »

Hi,

Re the Silabs chips - a few years ago we used the C8051F060 chip as the front end in a fast data acquisition system. We found that trying to do any processing on-chip for the 16 bit data being taken at (from memory) 1Mhz rate was impossible - the chip is too slow. We ended up using the F060 as the front end but feeding the data over a pair of 8-bit ports to a second faster Silabs chip, C8051F120, which did some data averaging, etc. The ADC on the F120 was used for gathering housekeeping data and its DAQs were used to control a laser diode driver.

I have wanted to redesign this system (still in production!) to use separate ADC and DAC chips feeding directly a 32 bit processor, eg XMOS, but there is some corporate inertia to overcome.

A general purpose board could use separate ADC/DAC chips. Companies like Linear, TI etc offer devices with different speeds in the same package outline so one could choose the device according to the particular requirements. Linear have a range of fast SPI-based ADC/DACs.

I would be interested in cooperating on this project.

John.
kster59
XCore Addict
Posts: 162
Joined: Thu Dec 31, 2009 8:51 am

Post by kster59 »

My suggestion is to use the Silab MCU to provide analog ADC or DAC as well as USB.

The Silabs with less memory are cheaper than the F342 and can take on many roles. I wouldn't do any advanced math but reading an ADC or USB value then putting it in the SPI buffer takes 1 operation which at 48mips is fast enough.

This save significant board space and makes a lot of programmable features available at low cost.

I would read all the data into the XMOS for the bulk processing. An exception is averaging analog data which can be done in a queue on the Silabs chip.

I wanted to combine the Silabs chip for a while because the USB drivers are almost as good as FTDI and only take 1 pin when you multiplex off the SPI flash on the XMOS.

I can get full speed on the Silabs to about 1megabyte a sec.

Also 1 pin can be used for all the input/output for USB and DAC, ADC with a programmable averaging.

You can get parallel 8 bit or 12 bit databus chips but that sacrifices a lot of pins on a low pin L1-64. It also increases costs both parts and assembly.
JohnR
Experienced Member
Posts: 93
Joined: Fri Dec 11, 2009 1:39 pm

Post by JohnR »

Hi,
My suggestion is to use the Silab MCU to provide analog ADC or DAC as well as USB
I don't think any of the Silabs chips have both DAC and USB. The F342 has USB but no DAC.
I wanted to combine the Silabs chip for a while because the USB drivers are almost as good as FTDI and only take 1 pin when you multiplex off the SPI flash on the XMOS.
The Silabs USB drivers are good and their support is much better than FTDI, IMHO.
What would you be doing with the USB interface?
You can get parallel 8 bit or 12 bit databus chips but that sacrifices a lot of pins on a low pin L1-64. It also increases costs both parts and assembly.This save significant board space and makes a lot of programmable features available at low cost.
I would still recommend the SPI based (not parallel) ADCs and DACs from Linear. They are featured in a number of Xilinx FPGA demo boards and seem to be very easy to use.

I have always been worried about noise problems using ADCs built in microprocessor chips. In our applications we were looking at modulation depths in the 10e-4 - 10e-6 range and I think we would have had an easier time with a separate ADC chip using really careful analog layout etc.

John
kster59
XCore Addict
Posts: 162
Joined: Thu Dec 31, 2009 8:51 am

Post by kster59 »

Silab USBXpress drivers are good only for Windows and WinCE 6. No support for linux or mac while FTDI has some support (I never tested anything but Windows).

Silabs also had a big bug that I brought to their attention recently but they were great and sent me a fix within a few weeks.

FTDI drivers have always been stable but they don't make an all in one oscillator chip.

SPI adcs / dacs are easy to use/implement by yourself. The point of the Silabs F321 or F342 is to provide high speed usb AND eliminate a lot of other chips (Adc/power management/etc).

The silabs have two comparators which can be output to CPAn which can monitor 1v and output reset to TRSTn and RSTn.

Also, they have onboard voltage regulator to eliminate 3.3v linear regulator and can output enable to 1v switching regulator.

Thus there only needs to be a single 1v switching reg on the XMOS power sequence.

I have a design floating around but I don't really need adc right now. When I do I would definitely use an F321 (F342 is pretty expensive).
User avatar
Folknology
XCore Legend
Posts: 1274
Joined: Thu Dec 10, 2009 10:20 pm

Post by Folknology »

Ok, sorry for the delay been busy working on the main project driving this along with further research.

Thanks for the feedback so far folks excellent stuff, here are some responses:
My suggestion is to use the Silab MCU to provide analogue ADC or DAC as well as USB.
This is definitely a cool idea and I have been researching this for a couple of projects using the same concept on BOM reduction! I was also unfamiliar with the Silab MCU's so thank you for the pointers that's another useful MCU range to have in the toolbox. Looking through the range John is right about there not being and all encompassing part with USB/ADC and DAC. However in this case the ADC requirements also mean that the Silab MCUs (even without Dacs) are just not fast enough for what I envisage, let me expand on my dream features for this board :

Given the generality of the board I would like to be able to control DC motors, steppers, servos and also BLDC motors (small and miniature). That means a more generic hardware model, it also means fast ADCs for torque control. The hardest here is the BLDC control which I would like to perform using either course 6 step control for multiple miniature BDLCs which would open up the project application to areas such as Quadrocopters and bot propulsion. I also wish to be able to perform sensorless and regular FOC/Vector control on small BLDC motors for more robotic and industrial applications.

One of the differences here is that although most MCU manufacturers are showing BLDC control with their MCUs, I believe this board will be able to deal with multiple BLDC motors which opens new areas at relatively low cost.

I am already part way through the basic hardware design and believe I have solved most of the major issues. If this comes of we could build a good opensource control library on top of the project so that anyone using the board for development would have a head start, and not have to reinvent the wheel.

Here are some more things I need help with in order to close down the design phase:

Couple of issues you can maybe help me with. when using BLDC motors they often include hall effect sensors usually providing 3 sensing outputs, can anyone point me to some good examples of using these signals to provide accurate radial feedback. How accurate can it be? do I need to combine this with sensorless back EMF techniques to improve accuracy, I need to get to 8 bit or even 10 bit accuracy if possible, any ideas?

In order to do the math for FOC I need to perform Clark and Park transforms (and their inverse) this will require sin/cosine lookup tables for speed. Thus radial position is likely kept below 10Bits or even 8 bits compared to the current sensing feedback which is likely to be 12bits. Is this likely to be an issue, can anyone see flaws with such a scheme?

I remember reading about a sensorless BLDC control that used BEMF zero crossing detection and majority digital filtering to provide lower overhead for MCUs, has anyone had experience with this scheme or can you point me towards an examples or resources etc..
F.O.C == Overkill ?? :mrgreen:
Lilltroll I'm very interested in your idea and your math is way better than mine!!! in the meantime can you translate your ideas into the features I need to incorporate from a hardware point of view, that way I can get the design closed down and we can start the mad experiments ;-)

P.S. The main design is centred around 12 current sensed half bridges and so could theoretically cope with 12 DC motors , 3 bipolar stepper motors, 4 BDLC motors or combinations there of.

Please keep the feedback coming, what else am I missing here, ideas?, Thoughts?

regards
Al
kster59
XCore Addict
Posts: 162
Joined: Thu Dec 31, 2009 8:51 am

Post by kster59 »

I'm quite familiar with motor control applications.

The Silabs chips come in 25MIPs and 48MIPS. If that isn't fast enough for you to read a 200k sample/sec ADC you are doing something wrong as it only takes 1 instruction to move the ADC register into memory and 1 more to copy it into the SPI bus register.

I've found there are only 2 USB controllers with decent drivers: FTDI (d2xx) and Silabs (usbxpress).

You can use WinUSB on things like PICs and ARMs but it's not that easy. It would be ok if it were a one time pain but instead every time a new OS comes along or incompatible computer then you need to at least recompile the driver and probably make some modifications. That's ok if your product life is 3 months but 2 years or 5 years later it is not viable. With FTDI and Silabs the user can just update their own drivers so that Win 2000-> XP -> Windows 7 32 bit -> Windows 7 64 bit required no work on my part.

Brushless DC motors require 3 H-bridges (1 per coil) so control is not cheap. Hall effect sensors are usually needed for variable torque as you can't deduce the EMF.

If you want any kind of resolution you /need/ an optical encoder (preferably with 8000 or more lines per rev).

It would be interesting in developing a controller that used just an encoder and no hall effect sensors.
You would need some way of figuring out how the encoder is lined up with the coils but could probably measure the back EMF (probably take you a few weeks of research however to get it right).

The reason for hall effect is that there's a simple 1-1 look up table that you can program with discrete logic.

With something like an XMOS you can do all of it in software.

There is also the issue that the XMOS really isn't that fast when compared to a hardware solution. 60k rpm motors are pretty standard and with 8000 line encoders (x4 for quadrature) you need be processing data between 8mhz to 32mhz which you will have a hard time doing without hardware decoders.

I have one these Stellaris BLDC motor controllers: http://www.luminarymicro.com/products/rdk_bldc.html

The reference design is 100% open including the BOM from Digikey and PCB footprints/etc.

It would be interesting to make a similar design with an XMOS but again you need
I'd like to pair up the Stellaris chip with an XMOS also someday when I feel the need. I also have one of these:
http://www.luminarymicro.com/products/rdk-idm-sbc.html

The onboard adc takes care of the touchscreen interface. The stellaris has built in 10/100 ethernet and USB (not as good as FTDI/Silabs) as well as hardware encoder decoders.

The big winner for the Stellaris chips is that they have all the drivers such as SDRAM and LCD drivers out of the box. You can call their SDRAM library with init_Sdram and assign a big array that writes like regular memory. To draw a box you can call their graphics API with a function like drawBox(x,y) and that's it.

I am interested in non-traditional motor solutions with an XMOS design. Brushless DC motors and optical encoders are pretty expensive when compared to stepper motors even if control is easy. I'd be interested if anyone knew of cheap sources of optical encoders. Lowest price I can find is around $20-25. Nema23 Steppers with 166oz torque can easily be bought for $5 in higher volumes.

Commercial servo motors (brushed dc + encoder) run over $100.