Orders away!

Well, tonight I sent of my orders to Digikey and pcbway.com. I really hope that I can:

    a) assemble this board without stuffing anything up, and
    b) that I haven’t screwed up the layout and the board works!

I guess only time will tell now. Oh well, if nothing else it’s already been a massive learning exercise which has been great.

Here’s the 3D render of the finished board design from Kicad:

Looking forward to getting those boards back now. I’ll post some photos once they arrive.

More PCB layout fun

I’ve been slowly chipping away at redoing the lay out of my PSU control board prototype. I managed to get it complete tonight, and it looks a lot more roomy – hopefully this board has enough spacing for me to be able to comfortably hand assemble it. I’ve got a few more checks to go through before I send the files of to pcbway.com.

PCB Layout lessons

One of the projects I’m currently working on is an adaption of a programmable power supply partially developed by Gerry Sweeney. I say partially developed because although Gerry did an amazing job documenting his fantastic project and creating some great youtube videos, it looks like life got in the way and he never quite finished it. I’m hoping that my attempt at a slightly updated and revised version will result in a completed project.

I’ve decided to start by trying to replicate the digital logic portion of the design as that is the area I am most comfortable with. I would describe myself as an analog novice, so I need to spend some more time digesting that aspect of the design before I attempt that. I’ve also decided to replace the PIC micro-controller with an STM32F070CBT6 as, although I played with PICs many years ago, the ARM architecture really seems like the way forward at the moment, or at least until RISC-V becomes mainstream 😉

I’ve drawn up the schematic in Kicad, another first for me as my limited PCB design experience in the past has all been with Eagle. I’ve found Kicad pretty easy to use once I worked my way through the tutorial and have found the answers to any roadblocks easily enough with a quick google. The real challenge though has been the layout phase. This is by far the most complicated design I’ve ever laid out from scratch. After spending more evenings than I’d like to admit on getting it laid out, I realised my component spacing is way too tight and there is no way I am going to be able to hand solder this board. So, back to the drawing board and I’m pretty much going to have to lay it out all over again. Lessons learned the hard way often stick with you though, so hopefully this will be the first and last time I make that mistake.

Here is the current schematic. As it’s my first Kicad schematic I haven’t bothered figuring out how to split it across multiple pages yet – hence the A3 size.  psu_schematic

Hello world! Blog Mk III

I’ve decided to start blogging again, mostly this will be just a way of documenting my projects and reminding myself how I solved problems in the past, but I guess it’s always possible other people might be interested in my projects as well.

This will be about the third (or possibly fourth) iteration of this blog. It went on a long hiatus for a while there, and then got a reboot on wordpress hosting. Hopefully this AWS version will have stick around for a while. I’ve migrated all my old content onto this blog, most of it is horribly out of date now, but there are probably some nuggets of usefulness in there somewhere, and if nothing else it’s interesting reminiscing for me!

I’m planning on blogging about my three main projects I currently have underway:

  • an inverted pendulum robot that I am modelling on DPA’s excellent nBot
  • a programmable power supply – based heavily on Gerry Sweeney’s amazing work
  • my adventures in risc-v using PicoRV32 and a Spartan 6 FPGA dev board from aliexpress

More posts on each of these projects to follow.

 

Cryptic BizTalk error – Object […] of type StoredProcedure does not exist

Just had an annoying BizTalk error that I’ll probably run into again so jotting this down for posterity.

I was getting a warning in the event log like so: (names of objects changed to protect the innocent).
The adapter failed to transmit message going to send port "FooBar" with URL "mssql://sql/dev/Mydb?". It will be retransmitted after the retry interval specified for this Send Port. Details:"Microsoft.ServiceModel.Channels.Common.MetadataException: Object [dbo].[My_stored_procedure] of type StoredProcedure does not exist

Turns out that that “?” character at the end of the wcf-custom adapter url was the cause of all the fuss. That’s automatically appended in the bindings generated by using the Add Generated Items-> Consumer Adapter Service wizard.

Remove the question mark and all is well!

Also, don’t forget to update your port operation names as detailed in this blog post

Mapping NHibernate collections one way

I encountered an issue with an NHibernate mapping today that took me a short while to solve so I thought I’d post here to remind myself in future.

I wanted to map a parent child relationship but only manage the persistence from the parent end. Here’s an example:

Blog -< Post

  public class Blog
  {
        public Blog()
        {
        }

        public virtual int BlogId { get; set; }

        public virtual IList<Post> Posts { get; set; }
   }

Which might have the following mappings:


The problem I was having was that saving the blog entity was causing a SQL exception complaining that BlogId wasn’t a nullable field on the Post table. In the end the fix was easy – remove the not null constraint!

The reason being that nhibernate likes to save the Post records first, then go back and update the foreign key values once it has saved the Blog entity.

ASP.NET MVC3 Razor view engine – some initial observations

Over the last couple of days I’ve started playing around with the razor view engine that comes with ASP.NET MVC 3. The first thing you notice is how much cleaner your markup pages look. It’s a real pleasure to code your markup without having to pollute it with masses of special code nuggets to demarcate your C# code. If you haven’t seen any examples yet check out Scottgu’s intro to Razor.

The error reporting still looks like it could do with a little work though. For example yesterday I put code very similar to this in my view:

@for(int i = 0; i < 5; i++) {
    <p>@i.ToString()</p>
@}

And I got an error message like this:

razor_error

Humm… “No overload for method ‘Write’ takes 0 arguments” – what does that mean? Well the answer is that the @ symbol before the closing curly brace isn’t needed. So the fix was simply to make the following change:

@for(int i = 0; i < 5; i++) {
    <p>@i.ToString()</p>
}

I guess once you’ve used razor for even a short while things like this will become second nature, but it had me stumped for a short time and it’d be nice if the error messages due to view engine parser failures were slightly more helpful in identifiying the exact problem.

GDB, BDM and the 68332

I’ve just been through the process of reviving my 68332 board that I got quite a few years ago from robominds. I wanted step debugging support and faster download speeds than are possible with the serial port connection so I downloaded the latest file package (m68k-bdm-1.4-pre4) from the bdm sourceforge project. I used the m683xx branch in the latest release as that is the culmination of Pavel Pisa’s work to support the 68332. The kernel driver needed a few minor modifications to support the modern 2.6.32 kernel that my Ubuntu distro is using.

The most modern gdb patch supplied to work with the kernel driver was targeting gdb 5.3 which is pretty old now given that the current release of gdb is 7.2. The challenge came when gdb 5.3 wouldn’t compile with a modern gcc due to gcc using stricter casting rules these days. Patching obstack.h using the same file from gdb 6.1 as an example solved this problem.

So now I have BDM support in GDB and step debug on my 68332 target board – happy days.

My patches needed in addition to those in the m68k-bdm-1.4-pre4 release.

obstack.h
bdm.c

Back in action

A new server, a new look and a return to regular service after a bit of a hiatus from blogging.

I’ve returned to my computer vision project with a vengeance and am close to having the first part working. This includes feature location and tracking between frames, 3D reconstruction and ego motion estimation. The final piece of the puzzle is my old nemesis – Non-linear Least Squares Minimisation. For this I am using the levmar library implementation of the Levenberg-Marquardt algorithm. So far I have a partial solution in that it works well for translations, but not so well for rotations so I need to do a bit more work on that yet. Once that’s sorted the last piece of the puzzle will be implementing a kalman filter to merge the odometry data from the wheel encoders with the ego motion estimation from the vision system.

I’m simultaneously resurrecting AMI (my robotics research platform) and am working on a few upgrades for that. Getting the environment up and running was easy this time only a few hours to get the cross tool chain built and various other tools sorted and I was loading s19 records into the 68332 and seeing “Hello world!”.

I’m off to TechEd next week so that should be interesting!

Time for a change

Well, I am now in the closing hours of my last day of work at my current job. It’s been a challenging role and I have learnt a huge amount about the finance industry.

Looking forward to the future fills me with a huge amount of excitement mixed with a little bit of nervousness. It’s not every day you give up a well paying job, pack up your life and move country. I have no doubt that the next year will be full of challenges, but I am really looking forward to it all. I can’t wait to build my business into New Zealands best shopping comparison site.

But first, before anything else, I think it’s time for a holiday!