Friday 28 August 2015

Complete (kind of)

Sorry for the lack of posting over the last couple of weeks, I have been very busy trying to complete the bot for my deadline (today). The bot now works, although with a few small issues.

Robot with eyes, metal claw and bodywork
Since my last post, I have printed out both the bottom and middle sections in 100% infill in black, both of which came out at a very high quality. I also included mounts for some "eyes." These eyes were made using bits of brass piping with some LED's inserted in the middle. These look very effective and really help give the robot some character.
Also, the metal claws came back from the workshop and are of a really good quality and look very menacing.
Another thing I have completed is the bodywork. This has made using bits of scrap metal found in the workshop and bent into shape, then mounted using the designed mounting holes on the base section that I 3-d printed. This has worked well as it really allowed me to improvise with the body and make it look really beaten up and menacing!

However, in this time I have run into some pretty major issues with the electronics. I have been using an RC transmitter/receiver pair to control the motors and claw through an arduino.

The RC transmitter works by sending a PWM signal to the receiver. The nature of the PWM signal can be altered by programming the transmitter (e.g. which channel corresponds to which movement on the transmitter). This is because the primary idea of the receiver is to hook your servo's straight up to it. However, because I was using an arduino, I have had to read the PWM signal and then convert to my own varibale with defined range (e.g between 0 and 255 for the motor speed). This was easily done by using the pulseIn command.

When testing, I found that I could get the motors working and the claw working fine with the rc transmitter separately, however when combined many issues started occuring. The first one being that when using multiple PWM channels and the servo library, the servo librarys functions has some very strange and undesired effects on the PWM pins. This meant that when using the claw and the motors, the motors behaved very erratically (lots of jitter). This was a very hard problem to figure out but with the aid of Google I eventually got somewhere!

My next step was to write my own code for the servo, not using the library. I did this by writing the pin high and the pin low for a set amount of time using the digital write command. This worked fine when testing, however, it had power related issues to power as the Arduino froze when I moved the stick too quickly and it was powered by the battery (it worked fine with USB power).

I spent a long time trying to figure out the problem with no joy. With time running out there was only one immediate solution I could think of, using two arduinos. One for the motor control and one for the servo. When attempting this method, it didn't fully solve the power issue and it still freezes up occasionally. However, the motor drive arduino never freezes. So, when a freeze does occur, I have made a reset button on the transmitter using the motor drive arduino to reset the frozen one. Therefore, if the claws do freeze for some reason, a simple button press will sort out the problem.

Although not ideal, it works for the time being and I aim to sort out the problem at a later date.

Here are some photo's and video's of the house robot.




No comments:

Post a Comment