dspic servo

Posted on Feb 5, 2014

This project was developed as an inexpensive way to drive small dc brushed motors as positioning servos for use on a desktop sized CNC machine. The board is interfaced to the PC through 2 pins of a parallel port. The drive signal on these pins is known as quadrature drive. The power stage consists of a power op amp driven in constant current mode.

dspic servo
Click here to download the full size of the above Circuit.

The internal PIC processor ( a 30f4012 from Microchip ) is programmed in C through the C30 compiler and the Microchip IDE. The servo loop parameters are programmed through a serial port connection and are saved in the dspic eeprom. Once set for a particular drive, they should not need to be changed. The serial programming interface is used to tune the PID and other servo loop parameters to optimize the performance in a particular application. The serial port runs at a fixed baud rate of 9600N81. Any terminal program such as minicom, gtkterm, or hyperterminal may be used to talk to the dspic-servo. On powerup you will see the following: Powerup. i/o. uart. timer. pwm. pid. encoder. capture. done dspic-servo by L. Glaister (c)25-Sept-2006 by VE7IT using setup from eeprom. for help Current Settings: servo enabled = 1 (p) = 0. 020000 (i) = 0. 000000 (d) = 0. 000050 FF(0) = 0. 000000 FF(1) = 0. 000000 dead(b)and = 1. 000000 (m)ax output = 2. 500000 (f)ault error = 1024. 000000 (x)pc cmd multiplier = 3 (t)icks per servo cycle= 10 The current values will be redisplayed with the new value set. The p, i, d, ff0 and ff1 values are standard loop gain parameters. You can reference the source code for a better explanation. The deadband parameter is the number of encoder counts the servo can be out of position without the servo loop taking any corrective action. The max output is the maximum current output allowed in amps and should be...

Leave Comment

characters left:

Related Circuits

  • New Circuits



    Popular Circuits

    Melody Doorbell circuit
    mobile incoming call indicator
    Simplest and low cost USB AVR
    Automatic Mains Disconnect
    A poormans oscilloscope
    Speech Board for SPO256
    555 Monostable Multivibrator
    MFOS Micro-Sample & Hold circuit
    100Hz-1MHz a circuit diagram of the phase meter