PIC18 Motor Controller project

Thread Starter

nsaspook

Joined Aug 27, 2009
13,086
This was a work related project for a XYZ assembly tester and controller for some old equipment. The original controller in the machines uses a set of relays and resistors for motion control so this controller had to use the same type of system to match the operational characteristics on the bench as when installed.

The system interface uses a 4x20 LCD module for the text display with menu selection and manual motor positioning controlled from two quadrature optical encoders and 4 push-buttons. A PIC18F8722 controller board handles all functions including RS-232 remote control and diagnostics. Motor position feedback is from either a 10 turn or linear pot geared to the motor drive or quadrature position encoders mounted on the motor shaft (500 counts per rotation). The relays select CW or CCW rotation with a slowing resistor and voltage changes (24VDC or 5VDC) for fine motion control. Dynamic braking is used by shorting the motor power leads together when disconnected from drive power.

The actual hardware design while simple can't be released but the software is GPL'd so I have posted it (the prototype version) here. The MPLABX 1.41 IDE was used for software development on a Linux workstation.
https://github.com/nsaspook/mandm.git

Some pictures and videos of the prototype units are here. Most of it was while fine-tuning the error feedback system to match the mechanical response of the relays to the faster motor encoder position data. The dead battery on top was to match the weight of the unit that normally sits on the carriage.
http://www.flickr.com//photos/nsaspook/sets/72157630632759744/show/

 

Thread Starter

nsaspook

Joined Aug 27, 2009
13,086
Congrats ona nice project. :)

Any particular reason you used an 80pin PIC? Details of the PIC board?
I standardized on the PIC18F8722 as the common in-house 8 bit board for our group projects that don't need USB or ETHERNET. (Used in about 10 different projects so far) It's got plenty of pins and modules to handle almost any task, runs at 3.3 and 5 volts with lots of memory for quick and dirty programming. ;)

The board is from here: http://www.futurlec.com/PIC18F8722_Controller.shtml
They ship from Thailand.

I also use their LED and input switch boards.
http://www.futurlec.com/Input_DIP.shtml
http://www.futurlec.com/Output_LED.shtml
 

Attachments

Last edited:

THE_RB

Joined Feb 11, 2008
5,438
Thanks for the info NSAspook, that board is not bad value for $35. :)

I too like the 18F8722 and have used them ina number of projects, normally I use the MikroE "SmartGLCD" board which has a display, touchpanel and 18F8722 with serial USB port and uSD card socket ($99);
http://www.mikroe.com/smartglcd/
The board also contains a 32k static RAM chip of which much of the RAM is available, nice and handy.
 
Top