Work Completed

No, Winston is not currently walking. I couldn’t think of a title. Anyway, a lot of progress has been made since the end of the last semester, where only a single leg was functional in vertical movement based on input from a potentiometer. Now, two legs have been implemented, and are joined to the chassis. Each leg as three responsive motors, and take input wirelessly from a joystick. The week started by using the previous semesters leg and duplicating it. Once two were plugged into the Arduino (still controlled by the potentiometer at this point), the front half of the chassis was required before anymore development on the legs was made. However, during the many tests for the two legs, the most frequent issue was the lack of reliability, as well as the inconvenient placement, of the potentiometer. As the leg extended, wires were unplugged and the potentiometer was knocked around. The solution to this was to change the control. A potentiometer was never intended to be the final method to control the robot, and it was time to advance this to a more suitable method. A few days were spent playing around with the NRF24L01 wifi chip, until enough knowledge was gathered to use it with the joystick to wireless send movement signals. The code for this is as follows:

#include <nRF24L01.h>
#include <RF24.h>
#include <SPI.h>

#define joyX A0
#define joyY A1

int xval, ymap, yval, xmap;

RF24 radio(7,8);  //CE, CSN

const byte address[6] = "000001";

void setup() {
  radio.begin();
  radio.openWritingPipe(address);
  radio.setPALevel(RF24_PA_MIN);
  radio.stopListening();
}

void loop() {
  xval = analogRead(joyX);
  yval = analogRead(joyY);

  ymap = map(yval, 0, 1023, 200, 290);
  xmap = map(xval, 0, 1023, 30, 45);
  radio.write(&ymap, sizeof(ymap));
  radio.write(&xmap, sizeof(xmap));
}

This short snippet of code is all thats required to transmit signals to another Arduino Uno. The receiver is even simpler, although I still don’t fully understand any of the libraries, but I can use them to do what I want to do.

void setup() {
  radio.begin();                          
  radio.openReadingPipe(0, address);      
  radio.setPALevel(RF24_PA_MIN);          
}

void loop() {
  radio.startListening();                 
  
  if(radio.available()) {                 
    Serial.println("Hello");
    while(radio.available()) {            
      int ymap = 0;
      int xmap = 0;                       
      radio.read(&ymap, sizeof(ymap));    
      radio.read(&xmap, sizeof(xmap));    
      Serial.println(ymap);
      Serial.println(xmap);
      IK(ymap, xmap);                     
    }
  }
}

With this, reliable wireless signals for movement could be used, and all future tests became just a little more tolerable. After this, a chassis design was required, as the two legs needed to be connected somehow for collaborative movement. With way too many hours spent on Fusion360, I came up with a design that was small, lightweight, and easy to connect to all external pieces:

These pieces where to be connected with dowel rods through the small holes, and the left was to contain motors, and the right bearings. This would allow an additional axis of rotation, giving more movement to Winston as desired. Once this was printed and assembled, it was tested to see if each piece works together (luckily it seems as though they did), and it is now a matter of duplicating this whole section, combining that with this and hoping no issues arise.

Another thing to note with the project is that although the original timeline saw this due at the end of the semester (around week 14), with the acceptance into PyCon (yay!) a functional robot dog is required by week 5. Oh no.

Reflection

Progress with Winston has rapidly increased in the last week, going from developing a leg for 18 months, to having a nearly function front half and very promising results overall. This is exciting, and gives me hope that Winston is achievable. However, PyCon being in just under three weeks means that rate at which work is being completed needs to continue to climb, as 18 days is not a long time to build a robot dog. The next few weeks are going to be stressful, but I do have optimism that this is completable and I won’t embarrass myself in front of 1000 people live on stage. I hope. The other people playing parts in Winston have also seen commendable success in recent weeks, giving me more hope and, better yet, motivation to complete this project. An unfortunate side effect is that Winston is costing time that would otherwise be spent studying for classes, meaning I may see a small decline in those, as well as keeping me from having a good sleep schedule. Or any sleep schedule at all as it seems.

Overall, the development of Winston has made impressive progress over the last few weeks, and I have no plans of slowing that down. The next 18 days will be spent almost solely on this project and there is now a chance that we will have something good to present at PyCon.