New components are always hitting the market. My first PID program was developed on a Microchip PIC16F877 microcontroller with a quadrature encoder interface performed in software. When I started porting the software on a PIC18F2431, the hardware QEI interface looked like the perfect solution. The math capability of the dsPIC30F series arose as a useful option for trigonometric calculi needed for odometry. There are dualin-line versions of this DSC and they are faster. When the board and the programs were almost completed, Microchip brought out a new, powerful 28-pin SPDIP in the dsPIC33F series for both motor controller (MC) and general-purpose (GP) versions. They are significantly faster than the dsPIC30F, they have a lot more available program memory and RAM (useful for field mapping), they require less power (good for a battery-operated robot), and their DMA capabilities simplify many I/O operations. Most importantly, these are the first Microchip motor controllers with two QEIs on the same chip. Let’s start a new port again! The logical block diagram is similar to the one for the previous board, but the hardware and software are much simpler. There is no need for high-speed communication between the supervisor and motor controllers to exchange navigation parameters. Every process is simple to synchronize because it’s on the same chip. The peripheral pin select capability of the dsPIC33F series further simplifies the PCB, enabling an internal connection of peripherals and greater flexibility .
For example, the IC capture modules are internally connected to QEI pins, saving two precious pins. Moreover, the COMM-1 port used for XBee connection can be software switched from UART to I2C or SPI communication with no hardware modifications. Note that every one of the 28 pins is used on this board. The number of components and connections is dramatically reduced. On a board that is the same size as the previous one, there is enough room for a second GP series DSC that could manage all of the robot’s sensors. To the side the first version.
A first version of the development board used for porting, where a GP series DSC was scheduled.
At the end of the software porting process, I confirmed my first impression: one dsPIC33FJ64MC802 is powerful enough to manage all of the navigation tasks. I had to take care just for the high rate of the input capture interrupts. But with the timing chosen for the different PIDs, the program spends more than 80% of its time idling in the main loop.