Thursday, April 19, 2012

Day Forty-Nine

So here are many of the pictures that I kept meaning to upload the past few months. Sorry!

Above: The claw of our mechanical arm.
Lower Left: Backside of Arm. Lower Right: Front-side of Arm.

Lower Left: Encoder with Servo.              Lower Right: Close-up on Encoder Case.

  Below: Arm and Microprocessor Board while I was 
working on my Quadrature Encoder Program.

 Above: The driver board that had originally come with the Arm.
Below: Side View of Arm.

 Above: Better view of claw with the pneumatic servo.
Below Left & Right: The encoder without its protective cover.

 Below: Better view of my setup for the encoder program. (4 images)




Below: Images showing the MMBe on the microcontroller board with current wiring. (3 images)


Day Forty-Eight

After 2 hours of testings we, Dave and I, have come to the conclusion that our MMBE is junk. It cannot tell what the status is anymore, neither forward nor backwards. I have a bunch of pictures to upload for Day 49. I'll Also get a copy of our newest program for that day.

Friday, April 13, 2012

Day Forty-Seven

As I promised, CODE!


Interface Test #1

CON
  _xinfreq = 5000000
  _clkmode = xtal1 + pll16x


  counthi = $27
  countlow = $10
  speedy = $80


OBJ
  debug:"FullDuplexSerialPlus"
  bob:"MMBe"
                                          
PUB Main
 Comm


 repeat
   Display
                                                                                             
PUB Comm
  debug.start(31,30,0,57600)
  bob.start(3,4,2400)
  waitcnt(clkfreq+cnt)
  debug.tx(16)


PUB Display | key, forward, reverse, power, xf, xr, status, a, b
  xr:=0
  xf:=0


  repeat until xf == 1 or xr ==1
    debug.str(string(13,"press F or R for direction"))
    key:=debug.rx
    debug.tx(13)
    debug.tx(key)
    debug.dec(key)                              
    debug.tx(13)


    status := bob.getstatus                                     
    debug.dec(status)  


    if key == 102  
      xf:=1
      debug.str(string(13,"Motor is moving forward"))
      bob.setdir(0)
      bob.set(200)
  
    if  key == 114
      xr:=1
      debug.str(string(13,"Motor is moving in reverse"))
      bob.setdir(1)
      bob.set(200)


    if key == 115
      bob.motorstop
                                
 if xf == 1 or  xr == 1                        
   debug.str(string(13, "yay it worked"))
   
Interface Test #2

CON
  _xinfreq = 5000000
  _clkmode = xtal1 + pll16x
   
OBJ
  Debug : "FullDuplexSerialPlus"
    MMB : "MMBe"


VAR
  byte counthi, countlow, Speed, dir, trip
  word MoveCount, TotalCount                                


PUB Main
 Comm


 waitcnt(clkfreq+cnt)
    Totalcount := mmb.readHiCount
      Debug.dec(Totalcount)
      Debug.tx(13)


 repeat 
   MoveCount := debug.getdec
   Speed := debug.getdec
   dir := debug.getdec
   mmb.setdir(dir) 

   outb[15..0]:= MoveCount
   counthi := outb[15..8]
   countlow := outb[7..0]
   Debug.tx(13) 
   Debug.dec (mmb.encode(counthi,countlow,speed))


   repeat 
     Totalcount := mmb.readHiCount
     Debug.dec(Totalcount)
     Debug.tx(13)


     {if totalcount > 10000 and trip == 0
        trip :=1
        mmb.encode(counthi,countlow,60)} 
  
PUB Comm
  debug.start(31,30,0,57600)
  mmb.start(3,4,2400)
  waitcnt(clkfreq+cnt)
  debug.tx(16)


PUB Display | key
  mmb.set(128)


  repeat 
    key:=debug.getdec
   
Speed Control

CON
  _xinfreq = 5000000
  _clkmode = xtal1 + pll16x
   
OBJ
  Debug : "FullDuplexSerialPlus"
    MMB : "MMBe"


VAR
  byte counthi, countlow, Speed, dir, trip
  word MoveCount, TotalCount

PUB Main | x
  Comm
  mmb.speedcon_mode
  x := 0
    movecount := debug.getdec
    outb[15..0]:= MoveCount
    counthi := outb[15..8]
    countlow := outb[7..0]


  repeat 
    x++
    mmb.speedcon(counthi,countlow)
    waitcnt(clkfreq*2 +cnt)
    mmb.motorrev
  
PUB Comm


  debug.start(31,30,0,57600)
  mmb.start(1,2,2400)
  waitcnt(clkfreq+cnt)
  debug.tx(16)

Tuesday, April 10, 2012

Day Forty-Six

We pulled up my good old encoder program that I shared a few weeks back. Started modifying it so that it would work with the MMBE program for motor control. (Which I WILL post tomorrow, I promise!) We, Dave and I, cut out much of the originals of both programs in the effort to give signal to a specific point. The MMBE program gives the signal; the encoder program tells where the arm is.

Thursday, March 29, 2012

Day Forty-Five

Worked the kinks outta the program except one, it only works in the forward direction but not reverse. Dave H and I started working on maintaining speed while under load. It didn't work. Our teach said that we may have to go back to my original encoder based program to actually make good progress. The MMBe has aspects of itself that limit what we NEED to do.

Tuesday, March 27, 2012

Day Forty-Four

Today we, Dave H. and I, re-wired the microcontroller for neatness and safety for the circuit. In this way, we do not have lots of looping wires going hither and thither. Then we retested the circuit to verify that everything worked as it did on Day 43. 'Twas a success. Tomorrow, Day 45, we will be working on cleaning out the bugs in the Forward/Reverse program that Dave H. wrote the beginning of last week.

Larry J. and John are working on getting the pneumatic hand/claw working on our arm.

Friday, March 23, 2012

Day Forty-Three

So we didn't actually work on that program today. Larry, John and I worked on getting the pneumatic intake from one of the non-operational arms onto our arm. It was screwed on TIGHT. Afterwards, we looked for a quick connect system for that intake. The intake is to operate the pneumatic solenoid for the claw/hand of the arm we are working on. The searching and removing and fitting took about 45 minutes. The remaining 5 minutes of class and the next 105 minutes after that was spent working with the MMBE chip on another microcontroller board. I was working with Dave and the teacher, Michael, to get the counter portion of the program reading at the right time. Mostly my part was watching and learning, as this part of the project I had not been working on. I have a decent idea as to what they are wanting to happen, but I'm hoping I'll get a clearer answer on Day 44. At that time, I'll write it down here, along with a cleaned up code of what the Michael and Dave have achieved so far.