Jack Crossfire's blog View Details
Posted by Jack Crossfire | Mar 07, 2017 @ 10:02 PM | 3,238 Views
With the 18A cannibalized for fixing the Ruckus, the stepper motor switched to a 35A which didn't work at all.


The 1st problem was the same locking up of the FETs on startup & burnout. It wasn't a defect. Current from the UART retained the register contents when the ESC was off. It never happened in practical vehicles, probably because all signals were off at the same time. Zeroing the registers as soon as it boots up got it to work, sometimes.


The required deadband when switching MOSFETs was 24us on the 35A instead of 9us on the 18A. Probing the gates revealed an incredibly slow rate of turning off the P FETs. It just seemed to be a fact of life with cheap hardware. The simonk firmware doesn't PWM the P FETs, so it's not an issue for commutating motors. The stepper motor does PWM the P FETs. Simok also turns off all the FETs 1/3 of the time to detect back EMF.

The stock 35A P FET turned off faster than the stepper motor P FET, so there's some variability.
Posted by Jack Crossfire | Mar 06, 2017 @ 12:20 PM | 2,992 Views
The software fuse completely failed when powering the ESC because any practical load has multiple USB dongles connected to it. The USB dongles pass ground from the load to the USB dongle connected to the fuse, which goes to the supply GND. The easiest solution was to cut V+ instead of GND.


Also decided to put back the 3DR's BEC module. It would now not work below 6V instead of 2V, but it would lessen the chance of another misplaced connection.


Even better than a software programmable fuse would be a software programmable fuse which recorded the maximum current usage & the amount of time the current usage was over the limit. There were also a few old time text effects allowed by VT100 emulation, to more clearly show the user configured areas & when the fuse was active. VT100 character formatting is definitely an underappreciated area of microcontroller development.


It was quite convenient being able to control the power from the same console as writing the firmware & viewing the load output, but probing the load was now difficult. The fuse defaults to off, so turning on the load requires sitting at the fuse console. Ideally, the fuse could be controlled from a phone, but there are no phone apps which access a serial dongle & provide a remotely bearable VT100 interface.


The maximum current readout often shows bogus values because the 3DR current sensor isn't reliable below 6V. The Mastech always cuts the voltage during an overcurrent condition, so the fuse always shows current higher than the Mastech could provide.


The 3DR is definitely a limiting factor, but it would be pretty rough to replace it. A custom op-amp would need rail voltage higher than the load voltage.


The fuse definitely ended up worth the investment. MOSFETs were instantly heating over 60C, but the cases were staying cold. Only the source pins carried the heat. Being able to automatically drive short bursts of power & record the maximum current is required.
Posted by Jack Crossfire | Mar 02, 2017 @ 10:30 PM | 3,664 Views
The next servo lasted only about as long as the last one, despite being a Futaba instead of Horizon's own overpriced one. What should have been a simple replacement ended up being total destruction of the electronics by plugging in the wrong cables. Plugging the battery balancer into the ESC header fried the PWM GPIO because that was the 8.4V line. The tach GPIO survived because it was the 4.2V line. Then pulled it out & plugged the ESC into the servo header. This fried the ESC because the tach pin connected to the servo's 5V line. The tach pin forced a P FET on, frying it. 2 days of repairs thus began.

If only it was as easy as buying a new ESC down the street. Recycling FETs from other ESC's managed to revive it. Put a diode in the tach line, so plugging it into a servo header wouldn't send current to the P FET. It was easier to shuffle parts than flash a new ESC. Fortunately, the fried PWM GPIO was driven by software & plenty of pins were brought out to debug pads, so it could be easily swapped. Only the single GPIO fried instead of the entire chip.

Couldn't find a better solution than just labeling the battery balancer & not plugging it into a servo header.

Helas, after 5 more miles of driving, the ESC failed stuck going forward & the CPU lost communication. Other parts of the CPU may still have been fried. The Ruckus's duties had already been curtailed in the last 3 months, so it isn't a big loss if it goes on a long vacation.
Posted by Jack Crossfire | Mar 01, 2017 @ 12:30 AM | 3,740 Views
Instead of hacking the Mastech to detect its current limiting LED, it was decided to make a standalone fuse which was fully programmable from a serial terminal. It was finally a use for the ancient 3DR current sensor. Merely plug the fuse into a USB port & it provides its own console interface. It requires 5V from the serial dongle. The load & power for the load are on a separate circuit from the fuse.

It was the 1st programming of an 8 bit PIC in C, with the official MPLAB. It was also the 1st use of a C program on a point to point soldered, through hole chip. All those years of assembly language with the free gputils & nedit weren't worth it. MPLAB on even a Mac is lightyears faster. It has all the navigation & autocompletion functions of other IDE's. It has handy displays of memory usage. The compilation & flashing is automatic. The crippled features of the commercial compiler don't matter. Many commercial products are made with unpaid versions of the compiler.

The fuse program used 80% of the PIC's 4k of ROM & 20% of its 256 bytes of RAM, but probably a lot more of its stack. It needed a few 32 bit operations to handle current & time conversions. It needed routines for persistent settings & a menu interface. It wasn't a huge amount bigger than an assembly language program.


The original idea was to have just a bag of analog comparators & RC timers. After LTSpice proved that to be very complex, it moved to a...Continue Reading
Posted by Jack Crossfire | Feb 25, 2017 @ 02:59 PM | 3,377 Views
Managed to get the ESC up to 16khz without resorting to assembly language, while keeping the software UART functional enough for testing. The trick was making a longer table of events with simpler operations to perform in the interrupt handler. Each event contains a value to copy to the timer & a value to write to the PORT. The long term plan is a 2 wire SPI with the ESC as a master.

At 16khz, the motor was super inefficient. It had to be reduced to 8khz to get any movement. At 8khz, it was still taking a lot more current for a lot less power than before, but it was much quieter than the previous 6khz routine. The only difference was the ability to have multiple FETs in the deadband between P & N, simultaneously. The table still goes from N to P without a deadband.

Discovered the MOSFETs were getting extremely hot, even below 3A. It was a Supersimple 18A but it overheated under 3A. Somewhere during the 16khz upgrade, all of the MOSFETs got fried & were intermittently short circuiting, despite the power supply being limited to 10A. We all know about current spiking when a motor is stalled, but whether stalled or short circuited, these were limited by the power supply to much less current than when they hovered a quad copter.

So for motor testing, the power supply needs to limit time more than current. Besides burning up a bag of ESC's, the next step would be a smarter power supply which shut down if the current limit LED stayed on too long. Even better would be not relying on the LED but a table of times vs current. Unfortunately, it's not clear if the LED was on when the MOSFETs blew.
Posted by Jack Crossfire | Feb 24, 2017 @ 01:57 AM | 2,889 Views
So when is spaceflight going to be like the movies, with multiple spaceships docking & undocking simultaneously & fast enough to discern motion with the naked eye?
Posted by Jack Crossfire | Feb 20, 2017 @ 12:08 AM | 2,967 Views
Spacex crs10 landing (6 min 12 sec)



The complete landing.


Spacex crs10 vs iridium1 landing (6 min 3 sec)
...Continue Reading
Posted by Jack Crossfire | Feb 18, 2017 @ 10:48 PM | 3,046 Views
Hobbyking 18A driving Hextronic DT700 as a stepper (1 min 25 sec)



It turned out just enough of the ancient DT700's were acquired over the years to make exactly 8 legs. 1 would have to be rewound & the exact number of turns is unknown. It seemed to be 19 turns in a delta. The ESC department has 5 Hobbyking 35A's, 1 Hobbyking 18A, 1 Castle creation 35A, 1 Align 35A. The last 2 are based on the 8051, so quite hard to reprogram.

They're amazingly still sold. They performed much better than the smaller motors. They could jump the load with only 12V. With active cooling, encoder feedback, reducing the lever size, they could probably just manage a slow bounding movement.

Active cooling has been deemed essential for any application. Even with active cooling, overheating still makes it impossible for them to hold the torque longer than a second. The mane problem with continuing is finding encoders for feedback.
Posted by Jack Crossfire | Feb 16, 2017 @ 12:37 PM | 2,816 Views
Hobbyking 18A driving 9 turn stepper motor (1 min 37 sec)



Call it ignorance about magnetic theory, but for jumping movement, 9 turns ended up better than 50 turns. Where the 50 turn couldn't jump at all, the 9 turn jumped the 140g load quite efficiently with very little heating, at 20V. Surprised the maximum starting torque as well as the maximum speed increased, since one would think the 2 would trade places. Holding movement suffered, since it could no longer hold the load without instantly overheating.

The power supply showed 8A being used for jumping & 3A used for holding. The holding current couldn't be fine tuned below that. Software PWM isn't precise enough. There's a way to theoretically determine the optimum turns count, but prototyping has proven faster.

Decided to use active cooling to reduce the risk of a burnout. A scaled down version of the Minotaur's bounding movement is certainly possible. It would start as a single leg with 2 wheels, to predict performance. It wouldn't stand up when not jumping.
Posted by Jack Crossfire | Feb 15, 2017 @ 06:58 PM | 2,936 Views
Hobbyking 18A driving a stepper motor (2 min 28 sec)



There was 1 rewound motor left from 2014. Even though the requirements were never met, it was worth documenting what it did. Drove it at 16.8V to simulate a 4S battery. Set the load to 140g. Hard coded a jumping movement which powered it for 250ms at full power & a holding movement which powered it at 50% power for 1700ms. This managed to keep it from burning out, but it heated up quickly. Care had to be taken to let it cool down & it could never hold the load continuously.


It never got the load to a parabolic trajectory, but it was an open loop programmed as close as possible to the ideal acceleration. A closed loop with encoder feedback might have gotten more acceleration to it. The bare motor was 70g, so the load simulated the motor lifting itself + any required accessories.


Rewinding the motor may have made it more optimal for holding loads at the expense of jumping movements. It might be better off with a higher KV.


It was around this time the lion kingdom finally read more of kaloucheThesis.pdf & discovered the Ghost Robotics Minotaur. That thesis is valuable reading for anyone interested in robot legs. It was exactly the envisioned vehicle, showing the limit of what brushless motor driven legs could do. With an unlimited budget, it could only go 4.47mph & it only lasted 20 minutes, so it would only go 1.4 miles. A reduced cost version would be even worse. It did show a robot with legs that only moved in 2 axes could still turn 360' in 6 seconds.


They provided some documentation on how the Minotaur worked: a 5.3Ah 4S battery, an STM32 realtime board, a blurry photo of motors which looked like t-motor U-10's. Unfortunately, you have to buy the robot to get the source code.
Posted by Jack Crossfire | Feb 15, 2017 @ 12:09 AM | 2,763 Views
So a simple dummy mass with lever was built. The plan was to gradually increase power until the motor held it in 1 position. A human would trigger a fixed motion & manually turn it off. Hold a dummy mass in an equilibrium position was required before ever considering jumping movements.


It was assumed that since the motor previously pulsed 20V without overheating, with no load, any lower voltage could be held on for longer periods of time. At 16V, it held the load in the air, but in less than a second, the magic smoke came out. The multimeter showed no temperature change, but it still burned out. Minutes later, the multimeter rose to 40C. The only clue that it was heating up was it immediately started sagging after lifting the load.


There was probably more heating when it had a load. The test without load pulsed for only 260ms & probably missed the amount it was really heating up. The amount of time it can handle 20V would have been 200ms rather than seconds. Since holding a load like this for extended periods of time was required for any leg application, the use of direct drive motors was busted.


A better test would be to not rely on a human to turn it off, but make a minimum preprogrammed pulse just to observe the load moving at first, then slowly increase the preprogrammed holding duration to observe the load being held. This would allow the multimeter to more easily catch any temperature rise.


If anything, the leg would have to be really stubby. There is a lever diameter at which it could hold the load & jump. It would have to move more like a millepede than a dog & it wouldn't be fast enough or be able to overcome the required obstacles. The lever might have to be shorter than the motor diameter. It would purely be a science project.
Posted by Jack Crossfire | Feb 13, 2017 @ 12:04 PM | 2,513 Views
The answer is yes. You can reprogram an ancient Hobbyking 18A as a stepper motor control. The mane advantage is a lot more current than your crummy L6234. The mane disadvantage is less precision. Unlike the advancement of radios & servos, there seems to be no limit to how long these ancient ESCs are going to be made, with the same ATMega8.

The problem is it requires software PWM. The FETs aren't connected to any hardware PWM pins, even if swapping the ATMega8 for an ATMega328. Your best route for higher precision is replacing the ATMega8 with a daughter board.

The precision was good enough for lion purposes. The Simonk firmware provided a starting point, but couldn't be translated directly from assembly. It uses only the timer 2 overflow interrupt. The output compare doesn't work for some reason if the prescaler is too low. Timer 2 is reloaded after updating every FET pin. It requires making a table of all the transition times in absolute time units, converting the absolute times to differences. An 8uS delay is needed between switching from P to N FETs. It happens in the interrupt handler, creating glitches when 2 transitions happen close together. Set the PWM to 2khz for maximum torque.

The UART pins are connected to FETs, so debugging requires bit banging a UART.
Posted by Jack Crossfire | Feb 09, 2017 @ 11:00 PM | 2,657 Views
After years of searching for robot dogs, putting "robot legs" into the search box turned up more intriguing results. This one was closer to the ultimate goal than any previous ones:

http://spectrum.ieee.org/automaton/r...losive-jumping

http://www.ri.cmu.edu/pub_files/2016...ucheThesis.pdf

Introducing GOAT: A Legged Robot with 3D Agility & Virtual Compliance (3 min 42 sec)



The key was the use of direct drive, brushless motors with stock windings to achieve high jumping. Jumping is the key to any robot running. It wasn't obvious in his thesis, but after extensively testing $75 gearboxes, he didn't use any gearboxes for the jumping. Pulsing the motors allowed the briefly high torque for jumping. More surprising was the holding torque they could provide.


They were the t-motor U10's at $330. The windings were only 95mOhm. A rewound motor for higher torque would have 14Ohms. The mane question is whether similar motors can be had for less money or if the robot can be scaled down for an after-tax budget. Maybe there could be a cheap motor for directional control & an expensive motor for the thrust. Maybe a servo could provide a degree of freedom.


The other note was how instead of 1 knee & 2 hip motors, he used 3 identical hip motors with freewheeling knee joints to achieve the same degrees of freedom. If it was passively stable in 1 direction, the leg could get by with 2 motors. To be passively stable in 1 direction, the CG has to be closer to the ground. That requires using jumping to overcome obstacles instead of leg clearance.


Unlike the quest for autonomous cars, virtual reality, & 3D TV's, there's going to be a single blog post someday about a commercially viable robot leg & it's instantly going to change the world. We've never had a commercially viable robot leg, so no machine has ever been able to get around terrain with the ease of an animal.
Posted by Jack Crossfire | Feb 05, 2017 @ 07:27 PM | 2,647 Views
It used 250mAh in 87 minutes of driving. It stayed fastened, but took the room for a 2nd battery. Putting it in the back obstructs the sound. Putting the 2nd battery in the back would unbalance it. It might have to fasten to a side. What was convenient was having a removable battery which could be charged without taking out the speaker.
Posted by Jack Crossfire | Feb 05, 2017 @ 01:39 AM | 2,546 Views
Congrats to the guy who got the last of the $10 Vivitars. That made the rest of us losers, even if $18 was equivalent to a single commute. Paying more than someone else for the same thing is still losing. $18 later, the 2nd bluetooth speaker arrived, with the goal of a robot speaker & job interview headset. It has become essential over the years for every vehicle to have sound & for it to be wireless.




It was quite loud & was probably light enough to use intact. The mane interest was hacking it to also take a microphone input. The innards revealed a 350mAh battery. 350mAh batteries have been revealed to last 30 minutes. It would have to be upgraded to support a full drive.


Most of it was a big, heavy speaker brick which can't be opened. It weighs 150g, which is the same as any other speaker. New speaker technology is needed if the same loudness is going to get any lighter.


Connectivity uses a very old BK8000L board. It uses a PN25F04 flash chip to store firmware. Audio amplification comes from an HT6871 3W class D mono amplifier. The positive stereo outputs of the BK8000L go through a pair of R + C's. The outputs of the 2 C's are tied together before feeding the amplifier's positive input.


An overly aggressive standby mode wipes out all transients, so it can't play game sound effects or metronome sounds unless something is always playing in the background.


Volume down is floating. Volume up is pulled to Vbat by a 10k, so the volume is...Continue Reading
Posted by Jack Crossfire | Jan 31, 2017 @ 05:49 PM | 2,252 Views
So the bluetooth board caused a power supply noise problem when it used the TDA1517 as an amplifier. Must figure out how to defeat power supply noise, 1 of these days. Decided to discard the entire TDA1517 board & just use the bluetooth board with the old speakers because it would be the lightest.


The bluetooth board had some kind of series capacitor network feeding the amplifiers.

1uF + 20k + 100nF + 20k

Replaced it with just a

470nF

to try to make it louder. It now seemed just as loud as the TDA1517. The chinese datasheet showed a 58nF + 30k.

The BK3254 had no datasheet, but if holding down the power button to turn it on was annoying, it could be powered directly by applying 3.3V to pin 16. Unfortunately, it automatically reset this way so some other voltage was missing, perhaps 4.2V on pin 17. Never could find a 3.3V source on the board, so perhaps the chip implemented its own regulator & power button control.

Also, cable management nightmares proved a speaker is best powered by its own battery instead of the vehicle power.

It's probably best to use a bluetooth speaker as is, except for replacing the speakers & enclosure to make it lighter & louder.


In other news, discovered phones probably aren't cracking when the vehicles roll over but when they jump off curbs. When the vehicles always carried a shirt, the phones had cushioning & didn't crack. With a severe winter leaving the vehicles devoid of a shirt for many months, phones started cracking like crazy. They're also self destructing to get cheaper & thinner.
Posted by Jack Crossfire | Jan 28, 2017 @ 07:39 PM | 2,461 Views
The lion kingdom still remembers when the most $10 would get were the cheapest, tiniest, most horrible sounding speakers which plugged directly into a walkman. The sound was completely unintelligible, but what a novelty in the old days to hear a walkman through any portable speaker.



There should be no disappointment in 25 years later, what would appear in Walmart but $10, Lipo powered, bluetooth speakers which actually sound as good as a boombox did. It's not just a case of something getting cheaper by getting smaller, but a lot more getting cheaper.



The purpose of this was not the speakers, but to gain a bluetooth receiver for a lot less than $parkfun's $25 bluetooth audio module. Managing the headphone cable had become quite a chore in 6 months of driving around with it. Sadly, the new speaker would be too heavy & quiet to use intact. It would require a much bigger robot to move around a decent speaker & loudness has taken precedence over quality.



The teardown was completed & the electrical signals probed.
It uses ANT8110 class D amplifiers which take 5.5V & output 3W. The only datasheet was purely chinese except for 5.5V, chipsourcetek, 3W, & class D. Though the reduction in voltage would be a huge convenience, it wouldn't be as loud as the 6W TDA1517.


The receiver is a Beken BK3254. Analog audio comes out of 2 pins at line level.


It requires 4.2V power at the battery terminals to power the ampilifier. The receiver can work on...Continue Reading
Posted by Jack Crossfire | Jan 21, 2017 @ 07:30 PM | 2,858 Views
1) A robot dog which can go 10mph & traverse curbs.
2) A way of editing text on a tablet which is as fast as a keyboard + mouse.
3) Action cam with image stabilization

Quite different from years ago because the autonomous RC car is gone. That was deemed very impossible, for the moment.

1 is probably going to happen in the next 30 years. Thinking of ways to do it with standard servos. The mane problem with 10mph is the actuator needs to be more like a spring to generate a bounding movement. There could be a slow movement to charge the spring followed by a fast discharging movement. Traversing curbs would use fixed movements rather than adaptations based on sensor feedback. It would have to be passively stable.

The leading idea is standard servos for the knees & hips. Both rear hip servos would connect to a common, shmick servo. Only the standard servos would move for walking. For bounding, the shmick servo would fire simultaneously with all the rear servos to jump. If the servos are cascaded, the simultaneous motion of the 3 servos should produce enough velocity. The jump would lift off the front legs, then land on the front legs. The front legs would steer & allow the rear legs to reset.

This might move more like a rabbit than a dog, in which case the front legs would need another shmick servo, but the same general idea would provide any bounding movement.




2 is probably impossible. The Goog had some research which compared keyboards to...Continue Reading
Posted by Jack Crossfire | Jan 20, 2017 @ 11:46 PM | 2,438 Views
So the Kyocera Hydro was a total failure. It was too slow to even type on, let alone load any web pages. The mane problem was the camera had permanently blurry regions. The lion kingdom didn't realize how important the phone cam had become until it didn't work. Japanese electronics once again came in far behind, subsidized by quantitative easing but not improving in 30 years.

In the world of phones, no matter what the problem is, the solution is to change providers. Boost Mobile had become cheaper than Virgin in the last 3 years. Virgin jacked up LG's bottom end, but Boost was still affordable.

The LG Tribute HD is a miracle for the price. It's lighter & thinner than all the other cheap phones. While noticeably slower than its predecessors, it's still faster than the Kyocera & a $50 screen of this resolution was unthinkable 3 years ago even if it's nowhere close to an iPhone. The camera isn't iPhone quality, but not a total failure like the Kyocera. LG cameras have always been just good enough. The internal flash was finally big enough to eliminate the need for an SD card. The Moto X wouldn't have been worth it.

It may have been inconsequential for someone who lived 30 years ago, but a screen where you can't see the pixels now seems essential. Part of the appeal may be that it looks like an iPhone.

Interestingly, below the Tribute HD are now $30 phones with decent screens, which can be used as real cheap standlone computers without a plan. A phone can be just a car music system or a dashcam for a lot less money than a stock device.


The day job has real nice phones which require hideous plans. The Galaxy S5 needs a $55 Verizon plan.