PIC18 Motor Controller project

Discussion in 'Embedded Systems and Microcontrollers' started by nsaspook, Oct 11, 2012.

  1. nsaspook

    nsaspook Thread Starter Senior Member

    Joined:
    Aug 27, 2009
    Messages:
    1,113
    Location:
    Fairview, Oregon
    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/

    [​IMG]
    spark8217 and W4GNS like this.
  2. THE_RB

    THE_RB AAC Fanatic!

    Joined:
    Feb 11, 2008
    Messages:
    5,435
    Congrats ona nice project. :)

    Any particular reason you used an 80pin PIC? Details of the PIC board?
  3. nsaspook

    nsaspook Thread Starter Senior Member

    Joined:
    Aug 27, 2009
    Messages:
    1,113
    Location:
    Fairview, Oregon
    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

    Attached Files:

    Last edited: Oct 20, 2012
  4. strantor

    strantor Well-Known Member

    Joined:
    Oct 3, 2010
    Messages:
    3,588
    Location:
    Houston tx
    pretty sexy. What kind of enclosure is that?
  5. THE_RB

    THE_RB AAC Fanatic!

    Joined:
    Feb 11, 2008
    Messages:
    5,435
    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.
  6. nsaspook

    nsaspook Thread Starter Senior Member

    Joined:
    Aug 27, 2009
    Messages:
    1,113
    Location:
    Fairview, Oregon
    strantor likes this.
Similar Threads: PIC18 Motor
Forum Title Date
Embedded Systems and Microcontrollers Help with C+ program to drive Bipolar Stepper motor using PIC18F1320 Microcontroller Nov 20, 2013
Embedded Systems and Microcontrollers interfacing capacitance touch key with pic18f44k22 Aug 19, 2014
Embedded Systems and Microcontrollers Pic18f452 Aug 15, 2014
Embedded Systems and Microcontrollers External crystal for PIC18F13k50 Jul 20, 2014
Embedded Systems and Microcontrollers Help with PIC18F45505 and GLCD Jul 13, 2014

Share This Page