Motors shield for the Panda

I am currently in the process of writing the drivers for this board (because I will use it) and I have a question. :think:

The DC motors driver and the Servo driver are almost identical to those provided by GHI. In fact, it’s nearly a copy/paste of their drivers. Roughly, only pinout has changed and cannot be changed/chosen by the user.
Two reasons for doing this : maximize compatibility with existing programs that use the shields sold here and not reinvent the wheel.

My question here is : how can I give credits to GHI in “my” drivers ? I’m not very familiar with licenses terms and don’t want to steal someone else work :hand:

For example, here’s the servo driver :

using Microsoft.SPOT.Hardware;
using GHIElectronics.NETMF.Hardware;
using GHIElectronics.NETMF.FEZ;

namespace PandaMotorsDriver
{
    public class PandaServo
    {
        OutputCompare _servo1,_servo2,_servo3,_servo4;
        uint[] timings = new uint[5];
            
        public PandaServo()
        {
            _servo1 = new OutputCompare((Cpu.Pin)FEZ_Pin.Digital.IO68, true, 5);
            _servo2 = new OutputCompare((Cpu.Pin)FEZ_Pin.Digital.IO61, true, 5);
            _servo3 = new OutputCompare((Cpu.Pin)FEZ_Pin.Digital.IO62, true, 5);
            _servo4 = new OutputCompare((Cpu.Pin)FEZ_Pin.Digital.IO63, true, 5);
        }
            
        public void SetPosition(byte angle_degree)
        {
            SetPosition(1, angle_degree);
        }

        public void SetPosition(byte servo, byte angle_degree)
        {
            uint pos = (uint)(((float)((2500-400) / 180) * (angle_degree)) + 400);
            timings[0] = pos;
            timings[1] = 50000;
            switch (servo)
            {
                case 1: _servo1.Set(true, timings, 0, 2, true);
                    break;
                case 2: _servo2.Set(true, timings, 0, 2, true);
                    break;
                case 3: _servo3.Set(true, timings, 0, 2, true);
                    break;
                case 4: _servo4.Set(true, timings, 0, 2, true);
                    break;
            }
            
        }

    }
}

As you can see, there’s not much difference in code.

If the driver is copy paste then you must keep the GHI header and then at the bottom add your own credits.

/*
Copyright 2010 GHI Electronics LLC
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 
*/

Ok, Gus. I will do it this way.

I’ve managed to validate the board (2 layers) to BatchPCB so I will have lower prices for my prototypes. I only have a concern about the 48-HTSSOP traces :think:

Has anyone some information or did someone else try such small traces at BatchPCB ?

PCB received today. :dance:

So far, I’ve seen at least 2 errors in my design :wall:

The power jack footprint is not the one I was thinking of and it lacks “cream” for the thermal pad of the steppers IC.

For the first one, I was visually abused by the pads shape because the holes are clearly round. I will have to think at a method to correct this.
The second one is a mistake I’ve made when trying different things on my Eagle component for the DRV8821. In my first attempts, the thermal pad did had a cream surface. I don’t know why I’ve removed it :snooty: I will try to scratch the soldermask to reveal the copper.

These two errors don’t seem that dramatic to me, though.

About the quality of the PCB, I would give a 8/10. Not very very good, but I get what I’ve paid for.

See the different pictures here :

http://www.lsp-fr.com/FEZ/PandaMotors/DSCN1227.jpg
http://www.lsp-fr.com/FEZ/PandaMotors/DSCN1228.jpg
http://www.lsp-fr.com/FEZ/PandaMotors/DSCN1229.jpg

Next step : soldering… On the way to new adventures! :wink:

Very good. This is your first hardware and looks great

Thank you !

I hope it will do more than only “look good” ???

Well well well… What could I say ? :-[

[title]I’m HAPPY[/title] :dance:

Here are some pictures :

http://www.lsp-fr.com/FEZ/PandaMotors/carte_soudee.jpg
http://www.lsp-fr.com/FEZ/PandaMotors/carte_branchee.jpg
http://www.lsp-fr.com/FEZ/PandaMotors/carte_branchee2.jpg

And maybe what was the most expected :

EEprom is working fine (you have to trust me, here :wink: ) but I have a problem with the DC motors :frowning:
I don’t know yet what/where is the problem, so I won’t discuss that much about it.

Soldering the DRV8821 was not that easy :wall: Not because of the IC by itself, ut rather because of the PCB quality. “Cream” pads were sometimes like mountains and had plenty of solder (?) on some of them.

Anyway, it’s done and I don’t fear saying that I’m proud of myself.

I want to thank everybody here, for their help and supporting me in this challenge.

The only name I will specifically mention is Gus, though. For personnal reason, he deserves special thanks.

This is not the end, at least because of the DC motors problem. I will now put the driver(s) online and maybe create a Wiki page. But it won’t be done immediately, because of personnal free time that is not extensible :frowning:

Again, thank to all of you ! :dance:

Congratulations Bec a Fuel :clap:
Your shield looks great and it must be a great feeling when you mad it running on the first try.

If you’r planning to make a rev 2.0 you might also consider using a bigger width on the power trace to the H-bridge and out to the motors as they seem a bit thin. I also noticed some odd routing near the DRV8821, more of a cosmetic thing than anything else.

Again, fantastic job Bec !!

A software engineer making hardware…this is just fantastic :slight_smile: nice work

Thank you :slight_smile:

Routing was not the easiest part, even though it’s mainly done by software. Power traces are indeed “bigger” than the others, but not that much : 10mil against 8mil for normal traces.
I had many problems with routing bigger traces, hence this dimension. In fact, this board is not meant to drive 10A motors :wink:

I don’t know if there will be a rev 2, yet. I have ideas for a rev 2, but I don’t know if it’s worth a new board. It will depend on different things.
Also, the rev 2 would fix the two PCB problems I’ve noticed a few posts before.

@ Gus : it’s another way of working :wink: I had the software almost ready but no “single” hardware for it. So…

But it’s in fact part of a “bigger” project, related to astronomy, in which I’m also deeply involved at the moment.

And now for the good news : there’s no problem with DC motors :dance:
It was a software bug in my program :-[

Here’s the original demonstration code :


MyDC.Move(100,-50);
MyDC.Move(0,0);
// Other tests follow

What do you think happened ? I tell the motors to rotate and the (milli)second after I tell them to stop :wall:
A simple Thread.Sleep() in between has resolved the “problem”. If you want a video, then just ask.

I still have some tests before announcing that the board is fully functionnal, but now I don’t what could happen apart from software glitches, which are easy to resolve :hand:
Hardware seems good, so far.

Awesome bec, you have a nice product there! Bravo! :clap:

Very cool! Someday I may get to this point. Capacitors will be popping!