Custom Motor Board

XCore Project reviews, ideas, videos and proposals.
User avatar
bsmithyman
Experienced Member
Posts: 126
Joined: Fri Feb 12, 2010 10:31 pm

Custom Motor Board

Post by bsmithyman »

Hi All,

I'm using a Pololu motor driver board (Dual MC33926 Motor Driver Carrier) for a robotics project, and I'm designing a board that will directly mate with it for use with XMOS development boards. This includes the PWM and H-bridge control directly, as well as a 4-bit port set up to get input from two quadrature encoders. I'm including an I2C ADC for the current sense inputs and to detect the battery voltage, and an I2C 4-bit I/O expander to allow reading of the error outputs and setting some of the configuration pins.

Initial design layers and BOM

Anyway, since this board will be directly connected to the battery input, I would also like to include some switching power regulators for 5V and 3.3V to power other devices in the system. Here's the question: If using one of the 16-pin expansion layouts from the XMOS dev boards, how safe is it to connect the 3.3V and 5V lines to the regulators on the motor board? Would it be better just to connect the common ground, and leave the 3.3V and/or 5V lines unconnected?


User avatar
RogerH
Active Member
Posts: 55
Joined: Fri Oct 15, 2010 12:14 am

Post by RogerH »

Hi Brendan,

Sorry I dont have an answer for you on the supplies.

I do like the project and will follow this thread with interest.

Roger...
User avatar
Berni
Respected Member
Posts: 363
Joined: Thu Dec 10, 2009 10:17 pm

Post by Berni »

For the XC-2 board i know that the regulators run off the 5V rail and provide the other rails. So to power the board you should only supply the 5V. Do watch out what you are doing as a mistake here could quickly let out the magic smoke.

To be sure go check the schematics for your particular kit and check what the external supply connects to (barrel jack or usb power)
User avatar
Folknology
XCore Legend
Posts: 1274
Joined: Thu Dec 10, 2009 10:20 pm

Post by Folknology »

Hi Brendan

Its a good idea to keep the motor supply and digital/analog supplies separate where possible to prevent heavy switching noise getting backinto the logic etc..

But be careful if you use the Xmos supply lines as they may not be able to deliver much current depending on which board you are connecting to.

I could see the PCB layouts on your site but a circuit diagram would be easier if you want use to take a closer look.

The board would certainly be useful addition.

regards
Al
User avatar
bsmithyman
Experienced Member
Posts: 126
Joined: Fri Feb 12, 2010 10:31 pm

Post by bsmithyman »

RogerH wrote:...
Sorry I dont have an answer for you on the supplies.
I do like the project and will follow this thread with interest.
Thanks Roger, I appreciate the feedback. I'm not sure if this will be useful to many, but when/if I finish it I'll be happy to post all of the design documents.
Berni wrote:For the XC-2 board i know that the regulators run off the 5V rail and provide the other rails. So to power the board you should only supply the 5V. Do watch out what you are doing as a mistake here could quickly let out the magic smoke.

To be sure go check the schematics for your particular kit and check what the external supply connects to (barrel jack or usb power)
Thanks, I see what you mean. I don't think it's entirely consistent, unfortunately. While connecting the 5V supply in principle should be safe, it's not necessarily well defined what this will do behaviourally. For example, I believe that the XK-1 board can be powered off of the 5V line, but of course it isn't 5V tolerant on the I/O end of things (hence using the 3V3 I2C bus on the board I'm designing). It seems like the safest course would be to only connect the grounds, and include heavy power conditioning on the motor-driver board.

I'm not totally clear what the consequences would be of including multiple 3V3 regulators feeding the same supply. It seems like the most likely thing would be that one tries for a slightly higher voltage than the other, and takes the entire load.
Folknology wrote:Hi Brendan

Its a good idea to keep the motor supply and digital/analog supplies separate where possible to prevent heavy switching noise getting backinto the logic etc..

But be careful if you use the Xmos supply lines as they may not be able to deliver much current depending on which board you are connecting to.

I could see the PCB layouts on your site but a circuit diagram would be easier if you want use to take a closer look.

The board would certainly be useful addition.

regards
Al
Thanks Al,

I see what you mean about the supply issue. I've been debating the best way to deal with this, and I'm considering including a supercapacitor and some low-ESR conditioning capacitors on the 5V line coming out of this board. The idea would be to take some of the load off of the switcher during high-drain times. However, I would still likely want a 5V rail that can run servos and the like, which re-introduces the same switching noise issues.

I'll admit, I actually didn't build a full schematic first, and I don't think the schematic software I'm using (DesignSpark in a Windows VM) can go backwards from the board. However, I'll try to put together a block diagram at minimum. Essentially it comes down to the following though:

One 4-bit port to set the two H-bridge inputs for each motor
Two 1-bit ports to handle the PWM on the motors
One 4-bit port to get quadrature encoder inputs from the motors (2 I/O lines each; these probably need resistors that I haven't added yet to be usable with the L-series chips)
Two 1-bit ports for I2C, which connects to an I/O expander and ADC. The I/O expander gets error flags from the motor drivers and sets the enable and slew-rate bits. The ADC reads the current feedback from each motor and reads the battery voltage (divided by 7.5 nominally).

I tentatively have the following extra parts laid out:
Enable LED (lit when the drivers are not in power save mode)
1A, 5V switching regulator
1A, 3.3V switching regulator

Of course, there are some issues, not least of which is that the 2-layer board is very messy (e.g. the 3V3 section to the right of the design files, where the autorouter went a bit nuts).

Thanks again for all the feedback (and thanks Jason for the publicity on the front page)!
MuellerNick
Member++
Posts: 31
Joined: Fri Dec 11, 2009 9:33 am

Post by MuellerNick »

However, I would still likely want a 5V rail that can run servos and the like, which re-introduces the same switching noise issues.
You should use two different regulators. One for the digital and one for the motors.
Ideally you have two completely different power supplies that are not connected at all. Signals would be transmitted by optocouplers. This is the most robust way.
The second most robust way is to connect both grounds at a single point.
Place an LC in front of the digital regulator. You will be shocked when you scope the 5V line, spikes make their way through them. Suppressor-diodes will also help to cut them off.

Nick
User avatar
RogerH
Active Member
Posts: 55
Joined: Fri Oct 15, 2010 12:14 am

Post by RogerH »

Hi,

I agree with Nick in the use of opto couplers. Nothing like a little OOOPS with a 24 volt rail to
fry an expensive CPU board.

Roger...
User avatar
bsmithyman
Experienced Member
Posts: 126
Joined: Fri Feb 12, 2010 10:31 pm

Post by bsmithyman »

Thanks Guys,

I appreciate the guidance. I'll have a look at some documentation and see if there's a good part that would allow me to keep things isolated without making too many changes to the design. May need to rethink some things.
User avatar
RogerH
Active Member
Posts: 55
Joined: Fri Oct 15, 2010 12:14 am

Post by RogerH »

Not very relevant to your board, but for hacking about in the lab I use these boards from Futurlec in Thailand.

http://www.futurlec.com/Mini_Opto_Isolator.shtml

I usually add one to each order I place as they are very useful.

Cheers, Roger...
User avatar
bsmithyman
Experienced Member
Posts: 126
Joined: Fri Feb 12, 2010 10:31 pm

Post by bsmithyman »

RogerH wrote:Not very relevant to your board, but for hacking about in the lab I use these boards from Futurlec in Thailand.

http://www.futurlec.com/Mini_Opto_Isolator.shtml

I usually add one to each order I place as they are very useful.

Cheers, Roger...
Thanks Roger,

I appreciate it, it's a place to start at least :) I'll have to think on whether I want to run such a wide bus between the boards with isolation (16 I/O lines) and how to do it with I2C, which is bidirectional. I'm sure a bit of reading will point me in the right direction.

Edit: Correction, 12 I/O lines, of course.
Last edited by bsmithyman on Fri Nov 12, 2010 11:07 pm, edited 1 time in total.