Programmable Logic Devices:

This project is taking a holiday while I get EMC up and running!

Using PLD's or Complex PLD's it should be possible to produce some hobby electronics simply (i.e. I don't have to string a whole pile of logic together and then face fault finding and debugging). I intend using the Lattice ISP part as I am already familiar with this device. The main feature of the device that I want to take advantage of is the In Service Programming, what particularly appeals to me is producing the prototype PCB before the code is finished, and if I make a mistake with my logic it is simply a matter of correcting the fault in software and re-downloading the code to the chip.

Still on the concept stage, but I am looking to make a Servo Controller.
Probably out of a Lattice isp1016 part, with external analog PID and H-Bridge driver. It may sound like reinventing the wheel, but its all good fun. This is to drive a DC motor with a quadrature encoder on the back. Control using step and direction from PC parallel port. Three servo motors are to replace the steppers on the prototype Mill.

A thought on the servo controller.
The idea is to have a dual power amp in a bridge configuation with one input fed by a counter-DAC combination from the Quadrature Decoder, and the other input fed from the counter-DAC combination from the step and direction inputs.
The difference in count gives a error voltage which through the Bridge arrangement drives the motor.

An interesting device to keep an eye on is a new Lattice part that is a Programmable Analog Device.

 

Surplus quadrature encoder on DC motor

I hope to have some sample code, and diagrams here in the future.

LCD Read Out for the Mill.


The 1st stage is to build a LCD Read Out for the Mill . "Synario Project manager" shows work in progress. The Schematics are all done just got to tidy some of the able code.

Top level Schematic of 4 Input Quadrature Decoder to Serial Out

The idea is to put the 4 quadrature decoders, 4 counters, a 4 to1 Mux, and a serial shift register in one chip that can be queried by a microcontroller(PIC, ATMEL-AVR, or your favorite) using synchronous serial coms to access each counter value by selecting the appropriate select lines on the mux.
The Quadrature decoders use the level to decode the direction, another method is to use the edge and theoretically not need the clock. When I learnt PLDs at CIT we did a project using level sense, this apears to be the modern way to decode quadrature decoders. there are several papers on the web if you do a search on this subject recomending the same, although the disadvantage is that there is a possible error state.

The home switches reset the counters.

The counter size can be anything I am starting with 8 bit, but could just as easily be 16 or 32, I will need to calculate what size I will need for my mill to cover the total movment, I don't expect more than 32 bit.

The reason for using dedicated logic rather than a microcontroller is simple, There is no interrupt latency with logic i.e. if the microcontroller is busy doing something else it does not miss counting it simply reads the value from the counter.
And it gives a good reason to have a play with PLDs.

 

End view (remove the encoder and fit one to each mill axis)

 


What a shocking image! (cut and paste, I think some of the lines got left in the glue!).