Author Archive

0.6.1 alpha released. Now with Functions that work!!

Video here
Just writing the Biofeeedback stuff and rewriting the USB control and then I’ll add a boot loader and then I just neet the PC software and thats all the code done.

As for hardware, This is a mock up of how the box might look (the LCD will go above the knob) Box

Interface teaser

For those who don’t believe that there is anything going on I bring you a teaser of the interface. You can see the main modes of operation you can expect. So far only the menu has been written and when an item is selected it simply displays the number of the item chosen and returns to the menu after a delay. code for almost all these functions has been written and just needs to be interfaced to the display.

so without further ado, click here

Still too warm for a feature freeze.

I have finally got round to changing my LCD control software to 4bit operation so as to use fewer port pins and in doing so it occured red to me that it would me very daft to have an LCD display and not use it for the main function menu (I was planning on having a bunch of LEDs give out a binary number and a control knob to select the mode but on reflection that’s just stupid!!). So once again is back to the coding/drawing board. Mind you had I thought about it before maybe I wouldn’t keep having theses little drawbacks….

When words fail you, make some up…

For those who are interested in the wonders of CNC (probably none of you) I thought I would write a quick post to describe wht i have done so far.

AS mentioned here the control board has been replaced and I am controling everything with VB Express 2008. Here is a little more detail

The protocol for the machine

The reason the people who built this machine originally used both parallel and serial comms was because of the amount of data to be transmitted. so to do the same over a single serial link will require some packing. Unfortunately there is no standard way to do this, so therefore there is a requirement for me start by writing a protocol to handle all this info. The basic idea is to use the serial port like an 8 bit wide parallel port. Each byte is then an instruction. The prelim spec for the control protocol is here in OO format. if anyone actually wants to read this in MS Word .DOC format let me know and i will convert it.

After being able to communicate with the machine i needed to write some code to send commands to the machine and, more importantly, create lines and arcs from which everything else can be created. So i wrote some code to implement Bresenham’s line and arc algorithms and then wrote an XML based machine control language (since i am not a G-code fan, i think it is a bit out of date). Once i work out how i am going to do Post the code without it being mistaken for HTML i will post a sample programme in this post but until then you can see the programme that made this drawing here (simply open with notepad)

any more data wanted or people wanting to help develop this software, let me know

What the whoby whaty?

I just noticed that there have been a spike of hits on my site. After a little snooping through the stats i see that slashdong gave me reference. It looks like someone has been reading what i write. Apologies for anyone else who was waiting for the next instalment. I will try and post some more stuff about the progress as things get done. Comments welcome (they let me know that people are in fact reading this stuff since most of my stats say that the visiting browsers are just search engine robots).

coming together!!

Sorry for the lack of posts but my adventure into the world of CNC machines took me of at a slant so here is progress on the two projects. (Also no one is commenting so i don’t know if anyone is actually reading this or whether i am just wittering into the cyber darkness.)

Almost all written and just waiting for a PCB to be made and the last little bit (the electromyography bit) to get working. I’m attempting to build an EKG to start with since that’s easy for me to test and then i will just change the probes and the software for the final version (and possibly the gain of the input amp) The PCB will hopefully be made on my nice shiny new PCB router once i can get it working. It does a very good job of ploughing all the way through the board or just compliant at me at the moment. The breadboard prototype is now looking like this and there’s more to add (also just noticed that the serial port 9pin D-sub has fallen off in that pic but it shuould be hanging off the MAX232 there) . Most of the parts for the beta model have been bought including thisrather swanky box (the red one) which requires holes to be made in it for controls which will hopefully be done with my Boxford Duet now that i have finished the first attempt at the software.

CNC controllerScreenshot 1
cnc-file-maker.JPGScreenshot 2

Its all still moving along. It will be finished one day….

We have functionality. (but my god it is annoying)

So porting is finished and serial control works. The python script reads an RSS feed and sends the characters to the serial port. The serial port is a USB to serial converter based on a Prolific chip so if I integrate that onto the same board as everything g else I have USB support. All is going to plan….this only means it got down hill from here.

The 18F4550 breadboard model is shown below

18F4550 model

Progress progressively progressing

Finally getting somewhere…

The list is shrinking, not growing now.

we have a functional Menu system, new PWM control and I am just about to start porting the code to an 18F4550 and install the USB/Serial support to read data from the twitterdildonics thing I wrote in python.

I have also just got a shiny (well as shiny as matt black anodized aluminium can be) new case for the beta model.

all in all, things are going ahead.

now my Boxford project is getting left behind though.

You can’t win!!

The more I do the more there ends up needing to be done

Progress. Hmmm. Either too much or not enough. It really depends on how you look at it.

Phase1: Randomness
aka: the toy you can’t ignore

Random numbers: V1.0 Done (and V2.0 is a direct hardware swap so that’s not a problem)

Function “menu”: V0.2 Done

PWM output: V0.1.0 Was done. Since working on the boxford I have figured out what I was doing wrong when trying to use the built in PWM module so all that has to be changed to the new, slicker, more sensible code structure, V1.0.0.

At this point I would say that I had completed the first design with no bio-feedback. Beta unit still needs to be built though. The reason it needs to be built is that I was going to use a 16F690 to control everything until I started coming across the bits i needed to do all the stuff bellow. With the added pins and on-board peripherals needed and the fact that I have successfully used the 18F4550, which has everything I need for the expanded project, in my boxford I am going to have to change to this new chip. This means porting everything written so far and building a whole new prototype, retesting all the code and writing all the bit you will read about next.

USB connectivity: Not even started. (However I have been playing with RS232 for my CNC project so that may creep in)

USB boot loader: Less advanced than connecting through USB

LCD functions: V0.8ish working

GPS functions: V0.3.1 works but V0.4.0 with indirect addressing and pointers is being silly

WiFi: Got the board and the data sheets but not written a scrap of code yet.

Accelerometer interface: Same stage as the WiFi but should be easier.

To allow all this to work together I need to write some interface stuff that will use buttons and the LCD to allow the parameters of the, yet to be written, sensory fusion algorithm to be adjusted.

Phase 2: Bio-feedback
aka: Evil delayed pleasure generation

Not a sausage has been done on this. No part sourcing, no algorithm creation, no code writing and no signal processing electronics building.

This also brings me onto another reason why the beta model has not yet been constructed; user upgradability. This unit will most probably be tested by someone not within walking distance and to prevent every new hardware change to require the unit being sent back there must be facilities in the hardware to allow both hardware and software to be upgraded by the user, either by reflashing the PIC or by simply pluggin in a new module to the expansion port.

And that’s not all!!!!

Phase 3: T’internet
aka: computer controlled fun!!

Having recently been writing lots of software (and I must say, having to relearn all the languages used since it was ssssssssssssoooooooo ling since I did any coding I had forgotten it all) I have gotten it into my wee head to learn write a twitterdildonics (and an explanation here) application that sends an rss feed to your serial port and with a bit of luck I can modify the spindle speed control function from my boxford project to control a vibe. I also want to do some statistical analysis of the incoming text so it responds more variedly to character and also to words. Another thing I have been learning about is web protocols and I want to build a teledildonics app or two to controll all this stuff.

So the further I go the bigger the project gets and the farther from the end I get…

Oh well

Onwards and Sideways.

Madness.

Some time ago I bought an old Boxford duet which had a somewhat old interface, requiring a serial port for general communication and a parallel port to send commands to the stepper motors. The software ran in DOS and was somewhat out dated. I have therefore started designing new hardware that only uses the serial port and should eventually only use USB, new firmware and new control software. This has proven to be of interest to people so i will document my endeavours here.

The original controller was replaced with a new one

Until i have a diagram drawn up the circuit works like this:

20 pin connector going to the stepper board is in fact used as a 10pin connector with 0V,5V,12V coming in and the direction and clock bits for the 3 axis going out. The logic therefore gets its power from the 5V pin of this connector. The 25pin D connector supplies connections for the spindle motor relays (enable, clockwise, anticlockwise) input to the PWM board for spindle speed and, access the rx and tx pins of the serial port plug on the back of the control box and a line indicating the condition of the emergency stop button.

The heart of the new design is a PIC18F4550 with the serial port pins (PortC 6 and 7) connected to a MAX232 for level conversion which is then connected to the appropriate pins from the 25pin D-sub. This provides a link from the computer to the machine. A serial to USB adaptor is then connected to the port on the back of the control box by a null modem cable and this plugs into my Windows Vista laptop and is controlled by a programme written in VB express 2008. Back at the PIC, PortD 0,1,2,3,4,5 are connected to the 20pin header pins Xclk, Xdir, Yclk, Ydir, Zclk, Zdir respectively. PortD 6 and 7 control the direction of the spindle motor and have a 1k resistor connected to them and then that goes to the base of a BC547 to switch each of the direction relays by pulling low the appropriate pin of the 25pin d-sub. A similar setup is used on PortA0 to control the spindle enable relay. the PWM input comes from the PWM output of CCP1 and at the moment simply goes staight into the input of the PWM board in teh control unit by way of the appropriate pin of the 25pin d-sub (i know a PWM running off a ref voltage generated from a PWM is a bit silly but it will be modified at a later date.) PortB 6 and 7 and PortE 3 are used for the ICSP port. There is a 20MHz local osc there too but it’s not being used at the moment as I am using the internal osc, PortB 0 is connected to the emergency stop line but this has not been implemented in software yet, neither have the opto encoders on the spindle but they will connect to PortE 0 and 1 eventually. The rest is just LEDs for debugging, flyback diodes for the realys and caps for the Max232 charge pumps.

more to follow