Rug Warrior Pi: Build Blog (a PiDA bot)

Moderator: Steve

Re: Obituary for a dead robot

Postby alanmcdonley » Thu Jul 14, 2016 4:00 am

alanmcdonley wrote:
As part of the disassembly, reassembly I took the opportunity to swap in a Pi 3, .



I have some good news. I stripped my bot down to essentials and changed the processor back to the Pi B+ 512 - everything is back to the original problem - left encoder misses 40% of pulses when wheel is rotating forward!

Never been so happy to have a problem, but compared with dead I'm loving it.

IT MAY BE LIMPING, BUT ITS A-L-I-V-E :P
alanmcdonley
 
Posts: 90
Joined: Thu Jul 23, 2015 10:50 am
Location: Boynton Beach, Florida

Reviving a dead robot, one part at a time

Postby alanmcdonley » Thu Jul 14, 2016 5:02 am

alanmcdonley wrote: I stripped my bot down to essentials and changed the processor back to the Pi B+ 512 - everything is back to the original problem


Since that was three changes at the same time, the question remained - what did the trick?

I reassembled the short stack on the Pi 3 (again not using the Polulu 5v supply) - voila - the Pi 3 is not a problem.

The top board contains the power switch, current sensor, tilt/pan servos, 7v2 2:1 divider, HC-S04, IR sensor, and camera.

I'm feeling so much better today.
alanmcdonley
 
Posts: 90
Joined: Thu Jul 23, 2015 10:50 am
Location: Boynton Beach, Florida

Re: Rug Warrior Pi: Build Blog (a PiDA bot)

Postby mikronauts » Thu Jul 14, 2016 6:13 am

Glad to hear its alive again!

Regarding missing pulses... remember that the MCP23S17 will only give you one interrupt signal even if two of its pins had transitions.

So if you get an interrupt, check for encoder events in all the bits on all the boards you are monitoring for encoder events.
mikronauts
 
Posts: 119
Joined: Tue Sep 16, 2014 6:58 pm

Case: Robot Without A Pulse - Closed!

Postby alanmcdonley » Fri Jul 15, 2016 4:56 am

Talk about a great mystery for late night television:

The Case of "The Robot Without A Pulse"

"Just the facts Ma'm:"
    - He never missed a pulse going backwards
    - If he walked forward at any speed his pulse dropped 40%
    - It even happened when pushed forward
    - It even happened when only one wheel was turned

The robot was stripped down to a short stack and interrogated under heavy scrutiny. It was discovered that the wheel had some in-out play. When the wheel was rotated while "in fully", it would miss some pulses. When the wheel was rotated while being pulled "out fully", it never missed a beat.

Case Solved: The robot had a slight "toe-in" which caused the wheels to move to the "in fully" position when moving forward, and caused the wheels to move "out fully" when moving backwards. The encoder sensor was just slightly too close to the encoder striped-target when the left wheel was "in fully", going forward. The robot was stripped bare, and underwent an encoder "attitude adjustment" to "back-off".

The "rehabilitated" robot was released to the supervision of his happy owner.

Code: Select all
pi@raspberrypi:~/RWPi $ ./encoderDriveTest.py
Motors: worker thread readingsPerSec: 10
Motors: pollMotors thread started with 0.100000 at 2016-07-15 08:01:25.618606

ENCODER DRIVE TEST
Travel Forward 24 at Medium Speed

********************* DONE TRAVEL

encoder status:
    left.state: 0 count: 149 | right: 0 count: 149 | bias: 0
    interruptState: NOT ACTIVE
Travel Backward 24 at Medium Speed
DONE TRAVEL
encoder status:
    left.state: 1 count: 153 | right: 1 count: 153 | bias: 0
    interruptState: NOT ACTIVE
Motors.cancel() called
Waiting for Motors.control Thread to quit
myPDALib.PiExit():  PDALib.pi.stop() called
ENCODER DRIVE TEST: Bye Bye
alanmcdonley
 
Posts: 90
Joined: Thu Jul 23, 2015 10:50 am
Location: Boynton Beach, Florida

Re: Rug Warrior Pi: Build Blog (a PiDA bot)

Postby mikronauts » Fri Jul 15, 2016 9:39 am

Glad you found the issue! I was wondering how it was missing pulses.
mikronauts
 
Posts: 119
Joined: Tue Sep 16, 2014 6:58 pm

under-voltage at boot

Postby alanmcdonley » Fri Jul 15, 2016 8:48 pm

Write up on under-voltage throttling at boot from robot supply but not from wall-wart:

pololu forum post
alanmcdonley
 
Posts: 90
Joined: Thu Jul 23, 2015 10:50 am
Location: Boynton Beach, Florida

Re: under-voltage at boot - SOLUTION found

Postby alanmcdonley » Sat Jul 16, 2016 8:03 pm

alanmcdonley wrote:under-voltage throttling at boot from robot supply but not from wall-wart:


So here is the scoop - and what an "educational experience" this robot has become.

Who knew that 6 inches of cable could drop 0.2 - 0.3 volts. I didn't know that I needed to spec a variable voltage regulator to allow for the voltage drop in a 6 inch cable.

The Gizmo Junkies wall wart is "spec'd" at 5.3v 2A and puts out 5.44v at the wall wart. By the time the juice gets to the Pi down the cable Gizmo Junkies provided with the wall wart, the voltage is at ... wait for it ... can we guess? exactly 5.25 volts - the upper limit of the Raspberry Pi power requirement specification. Talk about a thorough design - I am impressed.

The Pi spec is 5v +/- 5% which gives a seemingly wide range from 4.75v to 5.25v. I was very happy with my 5v 2A step-up / step-down switching supply when I saw 4.97 to 4.99 volts coming out. I never thought to measure what the voltage is at the Pi six inches away. I bought one of the shortest USB to mini-USB cables I could find on Amazon. Pretty ones too! Turns out at idle the voltage reading at the 40 pin connector is 4.82 - 4.86v with that 6" cable. When I cranked up fibanacci.py at 100% of one core and pull 500mA of that 4.97 to 4.99v through the cable, the voltage varied from 4.67 to 4.77v at the 40 pin connector.

The Raspberry Pi says "wait just a minute there cowboy" at exactly 4.75v declaring an under-voltage event and throttling the processor back from 1.2GHz to 600MHz, which draws a little less current, which means slightly less voltage drop in that 6 inches of two tiny wires. The Pi3 sees the voltage go up and eventually runs the clock back to 1.2GHz and the trouble comes right back.

I grabbed my thirty year old rolls of "hookup wire" and built me a 6 inch twisted pair cable and soldered the hair thick conductors of the mini-USB connector at the end. Now my Pi 3 is drinking a solid 4.93v at idle and 4.90 at 500mA running that fib sequence on one core. The proc says it is starting to sweat (65.5 degC) but did not register an under-voltage at boot or under this load.

In fact - I just ran four remote WiFi ssh shells, two running fib.py, one looping a status which reads the HC-SR04 ultrasonic sensor, checks the ADC readings of the IR sensor distance sensor, the main battery voltage, and total current draw (635ma at 7.4v), and the last shell looping checking the vcgencmd to get proc temperature (I stopped everything at 80.1 degC), proc frequency (1.2GHz) and the throttled flags (all 0x00000 - no under-voltage, no throttling!).

The board above the Pi 3 got pretty warm, and the 40pin connector "5v0" went down to 4.88v, but the bot survived the load with no "events".
alanmcdonley
 
Posts: 90
Joined: Thu Jul 23, 2015 10:50 am
Location: Boynton Beach, Florida

Re: Rug Warrior Pi: Build Blog (a PiDA bot)

Postby mikronauts » Mon Jul 18, 2016 12:14 pm

Well-written description of the problem and the solution.

It is amazing how important it is to have a good USB charging cable (and power supply).

Lately I've been trying some "iLink" branded power cables in 1'/3'/6' lengths, with good success. I use the 1' ones on my bots.

As you note, making your own from heavy gauge copper wire works really well :)
mikronauts
 
Posts: 119
Joined: Tue Sep 16, 2014 6:58 pm

My Robot Has A Lot To Say And Bad Teeth

Postby alanmcdonley » Thu Jul 21, 2016 6:41 am

Bluetooth speaker for my robot - installation, pairing, connecting, playing, but still looking:

Bluetooth Speaker Has Bad Teeth
alanmcdonley
 
Posts: 90
Joined: Thu Jul 23, 2015 10:50 am
Location: Boynton Beach, Florida

Re: My Robot Has A Lot To Say And Bad Teeth

Postby mikronauts » Thu Jul 21, 2016 8:41 am

Good write-up, and I'll avoid that cube :)

alanmcdonley wrote:Bluetooth speaker for my robot - installation, pairing, connecting, playing, but still looking:

Bluetooth Speaker Has Bad Teeth
mikronauts
 
Posts: 119
Joined: Tue Sep 16, 2014 6:58 pm

PreviousNext

Return to Pi Droid Alpha

Who is online

Users browsing this forum: No registered users and 1 guest

cron