-
Palm Power controlling InspectorBot.
08/25/2018 at 21:41 • 0 commentsAfter some Python coding and pairing Palm Power’s Bluetooth to InspectorBot’s Raspberry PI Bluetooth, here is a short video of Palm Power controlling InspectorBot.
-
A step through of Palm Power’s program.
08/25/2018 at 19:24 • 0 commentsPalm Power’s program was written in “C” with MPLAB X IDE v3.05. The compiler was XC16. I love Micro-chip’s stuff. It’s a nice development environment. Below is the beginning of the program. A typical start with the necessary libraries, registers being defined and functions.
Next, the chip is set up, then “MAIN” sets up the ports and calls the subroutines for UART setup and the analog to digital setup. After the setups are complete, the program settles into a loop that continuously pauses 100ms, calls the analog to digital converter and checks to see if any new data has been received from the UART receive interrupt.
Leaving the “MAIN”, we see the subroutines. Below is the UART receiving decoder that is looking for the magic word “send”. When it detects “send”, the sub “send_string” is called. Send_string sends the present potentiometer values detected by the A to D converter and the present value of the three switches through the Bluetooth to the robot.
The next few pictures are the UART and analog to digital sections covered in earlier updates.
The complete program is available in the repository.
-
UART (Universal Asynchronous Receiver Transmitter) Port Code
08/22/2018 at 00:11 • 0 commentsThe UART is used to send and receive data to and from the robot via a Bluetooth module. Below is the UART setup subroutine. Calling the subroutine sets the UART for 9600 baud. The subroutine also enables the receive interrupt and also enables the UART.
Next is the transmit subroutine. Pretty straight forward, call the sub with the data and the subroutine sends the data and waits for it to send.
Last is the receive subroutine. The receive subroutine is part of an interrupt handler. The subroutine has ten registers to receive data. Each time the UART receives data, the data in the registers are shifted up by one register. As data is being received, the receive subroutine mirrors back the data to confirm that the data has been received. Another routine checks the registers for the magic word “send”. Once the word “send” has been received, the PIC will transmit the potentiometer and switch data to the robot.
-
Analog to Digital Converter to read the potentiometers
08/21/2018 at 01:06 • 0 commentsBelow is the setup code for the A to D converter. The subroutine sets up port A’s inputs RA0 and RA1 for analog and leaves the rest as digital pins. The subroutine also sets the A to D module to allow each input to be individually sampled.
Below is the subroutine to sample and store the analog values for the two potentiometers. The subroutine consists of two sections, one for each potentiometer. The subroutine first sets the address of the input, starts sampling, waits 100ms and starts the conversion. After the conversion is done, all 10 bits of the value is saved in a register which will be used to build a string to send to the robot being controlled.
-
Palm Power’s circuit.
08/20/2018 at 02:32 • 0 commentsA PIC24F16AK101 is Palm Power’s controller. The Potentiometers with the off-set weights on their shafts are connected to the PIC’s analog-to-digital converter through RAO and RA1. Three switches are connected to the PIC through RB0, RB2 and RB4. The PIC24F16AK101 reads the values of the potentiometers and the switches, builds the data into a string and sends the string to the robot via the Bluetooth module each time the robot requests the data.
-
Analog tilt sensors
08/14/2018 at 02:43 • 0 commentsBuild instructions are added showing the assembly of the DIY analog tilt sensors made from two potentiometers, scrap plastic and a couple of bolts and some nuts. The sensors will be used to detect the pitch and roll of a hand and used to command a robot to move forward, backward, left and right.