Serial interface for controlling robotic arm.
This program uses a LPC1768 processor for controlling a robotic arm. The basis for the program is the Axis () class which uses a PID controller to actuate a DC motor with quadrature encoder feedback.
Youtube video of robotic arm using the 6-axis controller performing an internally programmed gate, then performing the home function.
https://developer.mbed.org/users/jebradshaw/code/Axis/
The Axis Class has 3 dependencies (MotCon, LS7366LIB, and PID). The class encapsulates the required functionality of controlling a DC motor with encoder feedback through pin assignments, an SPI bus, and a pointer for the limit switch source.
The LS7366 encoder interface IC off-loads the critical time and counting requirements from the processor using an SPI bus interface for the class. The Axis class then uses a state machine to perform trapezoidal movement profiles with a Ticker class. Parameters can be adjusted through the serial interface using a FT232RL USB to serial interface IC for computer communication.
The MotCon class is a basic class that defines a PWM output pin and a single direction signal intended to control an H-Bridge motor driver IC. I used an MC33926 motor driver for each motor which are rated at 5.0-28V and 5.0 amp peak, with an RDSon max resistance of 225 milli-ohms. This part also has 3.0V to 5V TTL/CMOS inputs logic levels and various protection circuitry on board. I also liked this particular motor driver chip because you can use a PWM frequency of up to 20KHz, getting the frequency out of the audio range.
Above is the prototype for the controller. Originally, a PCF8574 I/O expander was used to read the limit switches by the I2C bus. This has now been re-written to use 6 external interrupts directly for the limit/homing switches. Six motor driver breakout boards using the MC33926 motor driver chip were used to drive the motors.
I use the mbed online compiler to generate the .bin file, use bin2hex to convert it and upload the hex file using Flash Magic to the processor with the serial bootloader. I prefer to use the FT232RL usb to serial converter IC for PC comms due to the high level of reliability and USB driver support (typically already built in Windows 7+). I've started putting this on a PCB and hope to finish by the end of the month (Dec 2015).
Well 3 months later, I've completed the first PCB prototype. A few minor errors but it's working!!
Express PCB Artwork
Inner Power Layer Breakup for motor current
First Prototype
Latest documentation (schematic and parts layout) can be found here Download and open with Adobe /media/uploads/jebradshaw/axiscontroller_schematics_v2.0.pdf
Latest PCB File (Express PCB) /media/uploads/jebradshaw/lpc1768_axiscontroller_20161216.pcb
Parts Layout
Python script for converting mbed .bin output to intel hex format (no bin2hex 64K limit) https://pypi.python.org/pypi/IntelHex
Example batch script for speeding up conversion process for FlashMagic (http://www.flashmagictool.com/) programming of board /media/uploads/jebradshaw/axisconvert.bat
https://os.mbed.com/users/jebradshaw/code/axis_ScorbotController_20180706/
Latest firmware: 20190823 - /media/uploads/jebradshaw/axis_scorbotcontroller_20190823_velocity_test.lpc1768.bin
History
20151228 - Removed PCF8574 I/O Expander and used direct external interrupt inputs for limit/homing switches
2015-12-28, by jebradshaw [Mon, 28 Dec 2015 19:59:24 +0000] rev 4
20151228 - Removed PCF8574 I/O Expander and used direct external interrupt inputs for limit/homing switches
6 axis arm controller implemented on LPC1768 micro. .bin is generated using mbed compiler, IC is programmed using bin2hex converted and FlashMagic for programming hex file.
2015-12-17, by jebradshaw [Thu, 17 Dec 2015 19:47:39 +0000] rev 3
6 axis arm controller implemented on LPC1768 micro. .bin is generated using mbed compiler, IC is programmed using bin2hex converted and FlashMagic for programming hex file.
fixed &counts in pitch
2015-09-30, by jebradshaw [Wed, 30 Sep 2015 16:22:51 +0000] rev 2
fixed &counts in pitch
testing with all 6 axes.
2015-09-30, by jebradshaw [Wed, 30 Sep 2015 16:21:14 +0000] rev 1
testing with all 6 axes.
- LPC1768 working with 6 Axis objects declared
2015-09-25, by jebradshaw [Fri, 25 Sep 2015 19:28:01 +0000] rev 0
- LPC1768 working with 6 Axis objects declared