Saturday, January 25, 2025

Moccamaster KBTS - Single Cup Brewing Adapter

I created this adapter to let me use my Moccamaster KBTS coffee maker as a single cup brewer. This model comes with a thermal carafe that normally presses against a button on the base of the machine to initiate brewing. Using one of my favorite coffee cups to press the button positioned the stream of brewed coffee near the right lip of the cup. While it worked, it made me nervous about the risk of misalignment or using a smaller coffee mug. So I put on my designer hat and went to work.

https://makerworld.com/en/models/1038925#profileId-1023339

What I needed was something to center my cup under the brew basket that also presses the brewing. After sketching a few concepts, 3D printing some rough models, I settled on the design you see here that  positions my cup exactly where I want, while an integrated sliding bar presses the brew button.

You might be thinking, "Isn't the Moccamaster Cup-One designed to brew a single cup of coffee?" When I decided to try a Moccamaster brewer, choosing between the single-cup model and a larger model was a challenge. While I typically brew one cup at a time, I liked the flexibility of brewing into a thermal carafe when needed.

The deciding factor came down to the difference in water distribution systems. The Moccamaster Cup-One features a water outlet arm with a single spout. While researching how to get the best cup of coffee from the machine, I found several videos suggesting stirring the grounds for more uniform wetting. 

These aren't affiliate links, I just want to make it easier to learn more about the machines if you are interested. 

https://us.moccamaster.com/collections/single-cup-brewers/products/cup-one?variant=40377761726627

In contrast, the KBTS uses a 9-Hole Outlet Arm to ensure even wetting of the coffee grounds. The KBTS also features a selector on the brew basket that lets you choose between high flow for full-carafe brewing, low flow for four cups or less, or stopping the water flow to allow timed soaking of the grounds. Stopping the brew basket flow also prevents drips when the carafe or coffee cup is removed.



Additionally, the KBTS includes a thermal carafe with a Brew-Thru carafe lid, which is an impressive piece of engineering. The Brew-Thru lid minimizes coffee exposure to air and introduces coffee into the carafe from the bottom up. This design helps maintain the coffee's strength and temperature uniformly within the carafe. It also reduces oxidation, minimizes evaporative cooling, and preserves flavorful volatile compounds, keeping the coffee as warm and flavorful as possible without additional heating. Very nice engineering!

If you own a KBTS, I suggest downloading my adapter model and giving single-cup brewing a try.

Thank you!
Shane


Thursday, January 23, 2025

Minimal Carry Handle for FRC Robot Batteries

This 3D printed minimal battery handle requires less than 15 grams of filament (I recommend PETG in a bright color) and quickly clips on and off of the battery. 

https://makerworld.com/en/models/1015389#profileId-995541

One of the most common electrical issues with FRC robots is loose batter terminal connections caused by lifting the battery by the cables. Loose terminals tend to reduce the quality of the contact surface with the battery terminal, and can lead to random reboots or loss of radio connection with the FIRST Field Management System.

Rechecking (because you checked them back in lab, right?) the terminal connections on all of your batteries the morning your competition is always a good idea. If you can wiggle a battery cable terminal using only three fingers, then it is too loose for match play. But it only takes a few minutes to loosen, clean, and retighten the ring terminals. 




I hope this can help provide a starting point for improving battery handling habits.

Good luck on the field!

Shane
Battery Nerd
Mentor, FRC #4561 TerrorBytes



Friday, May 21, 2021

LEGO EV3 Minimal Gyro Proportional Drive Straight for FLL Robots

How to Help Your Robot Drive Straight Using the Gyro Sensor

Wait, It Drifts Left AND Right? 
During my second season coaching FLL, the team had a robot that would sometimes drift to the left, but other times drift to the right, sometimes during the same run! This drove them crazy most of the season. Worst of all, when they put a mat on a hard floor to simulate a perfectly flat board, the drifting all but disappeared! 

We finally figured out that the northside of our regular practice board was slightly higher than the south side.  The robot had much of its weight on the back which made the back of the robot want to slide downhill while the robot was driving. This made the robot tend to drive uphill! So driving west to east the robot would drift left, but driving east to west the robot would drift right (always uphill). 

Driving straight can be one of the most challenging tasks for any robot, including those in FIRST LEGO League. The issue is that robots do not naturally drive straight. Actually very few things naturally move in a straight line (even people, see MythBusters Season 9 Episode 15: Walk a Straight Line). The article below discusses some of the reasons driving straight is such a challenge for robots.

http://www.legoengineering.com/why-doesnt-my-robot-drive-straight/

When properly applied, a Gyro Sensor can help your drive robot straight. I am going to walk you through the simplest way I know to use a Gyro sensor, on an EV3 in this example. We are going to start simple, and explain in more detail as we progress. 

The program below uses the Gyro Sensor to help the robot driving straight. We want the robot to drive straight in the direction, or heading, of 0 degrees at 50 power for a total of 4 rotations. We use 0 degrees because that is the initial reading from the Gyro Sensor anytime you run a new program.









One of the first things to notice is that we are using the Gyro Sensor in Angle mode. When the program starts the Gyro Sensor resets to 0 so we are using 0 degree as our heading ("a" in the red Math Block).

If the robot drifts left, the Gyro Sensor will report how far the robot has turned left in negative degrees. For example, if the robot is pointing 5 degrees left of where it was pointing when the program started, the Gyro Sensor will read -5. And if the robot drifts to the right the Gyro Sensor will report how far it has turned to the right in positive degrees. So if the robot is pointing 10 degrees to the right of where it was pointing when the program started, the Gyro Sensor will read  10. 

The program works by using a LOOP to read Gyro Sensor on port 2, then calculate the heading error by subtracting the gyro reading from our desired heading, 0 degrees, and using the heading error as the Steering Angle for the Move Steering block (the Motor Power is fixed at 60). This happens as fast as the Loop can run (many times per second). This continues until Motor B rotations are greater than or equal to 4, or for four rotations.

This is a Proportional Control or Proportional Feedback system. It is called this because you are changing the output, the Steering Angle, by an amount that is proportional to the error, or the difference between the desired heading (0 degrees) and the measured direction.

A control system work to keep the system error as close to zero a possible. In this case it just means that the EV3 blocks above will keep adjusting the move block's steering angle to keep the robot's gyro sensor, and the robot, pointing at a heading of zero degrees. 

Understanding Proportional Feedback to Help Your Robot Drive Straight


The Good Stuff - Proportional Feedback and Proportional Control

We are going to walk through how to use the Gyro Sensor and Proportional Feedback to make your EV3 based LEGO robot drive straight. The robot will drive straight even if the wheels slip or if the wheels are even different sizes. I am still impressed every time I push the back of the robot to make it turn off course and it turns back to follow the desired heading.

Gyro Sensor
We are going to assume that your robot's Gyro Sensor is mounted with the arrows facing up (ensuring that rotating the robot to the left will produce negative readings from the sensor) and somewhere near the centerline of the robot (ensuring that turns to the left and right each require similar adjustments to the robot's drive system.

The Gyro Sensor does have a few unique traits. First, it calibrates while the EV3 brick is booting up. This means your robot needs to be very still while booting. I recommend putting the robot on a clean piece of paper on the floor for booting up.

You can force the Gyro Sensor to recalibrate by plugging and unplugging the sensor's cable or using a specific combination of programming blocks. I will not cover software methods for resting the Gyro Sensor because it very often causes more problems than it solves.

Move Steering
The Move Steering block makes our task simpler by allowing us to change the robot's direction by adjusting the Steering Angle input.

Proportional Control simply means that you are making a change, this case steering angle, based on the size of the measured error. Here our error is the difference between the direction we want to drive and the angle the gyro says we are driving. output to a value that is proportional to the system error. In the case of the Gyro Sensor, any errors to the right, or clockwise, are read as positive angles and error to the left are negative angles. And we are going to use a Move Steering block and adjust the Steering Angle based on the Gyro Sensor reading to make the robot drive straight. So if the robot is going a little left of where we want, say -5 degrees, then we want to set the Steering Angle to steer to the right, perhaps 5 degrees.

Below is a Minimal Gyro Drive Straight program. I think it is very cool that you can build it with only five blocks, including the Start block!

Going Straight
Going in a straight line is not a natural thing for a robot, or for humans for that matter (see MythBusters episode 173: Walk a Straight Line). It turns out that humans and robots both need some kind of feedback to go in a straight line. For humans, the feedback is usually visual but you can also use a compass as a reference to keep you pointed in the same direction. Robots are similar in that you can use a Color Sensor to follow a line or use the Gyro Sensor to follow a heading.

Why Straight is Difficult for Robots
Driving straight using only mechanical design is challenging. The robot needs to have wheels of the same diameter, precisely aligned to each other and in line with the robot chassis, the motors must rotate the wheels at the same speed (be synchronized), the weight distribution must be balanced between the wheel to ensure the robot has a center of gravity centered between the wheels and the wheels cannot slip. 

Rarely if ever are all of these conditions true, so most robots, even good designs, do not actually drive straight. For example, a ball bearing castor will often provide changing forces during a straight drive and cause small changes in direction. Some of the driving straight issues can be difficult to diagnose. This is one reason that robust FLL robot strategies always include aligning on mission models, or lines or walls at multiple points during a run. Alignments and referencing are a top of their own that I hope to touch on in the future.

Potential Gyro Pitfalls and How to Avoid Them

Gyro sensors are very useful sensor but can be a little confusing, and has some pitfalls that have tripped up even advanced teams.

First, Gyro sensors usually calibrate automatically at power on, like when the EV3 boots up, which means any movement of the robot, or table, while the EV3 brick powers up can produce drifting in the gyro. I recommend setting the robot on the floor on a sheet of paper (to keep dirt off of the wheels) and let it boot up without being disturbed. 

Second, poor wire management can lead to connection glitches that cause the Gyro Sensor to restart and recalibrate. The robot may drive in sharp arcs or even spin in place follow a gyro reset due to a poor connection while the robot was being handled by the team. This can be a very tough problem to identify because the problem happens when the wires are bumped but the robot driving failure doesn't show up until you go to use the gyro later. So the robot can be great on a practice table but suffer a gyro reset while walking to the competition tables or even during a match.

I recommend NOT using a program to force the gyro to recalibrate. I have worked with many teams who had a great plan for how and when they would calibrate the gyro. But most, if not all, eventually had the gyro fail them during a competition run. 

I do recommend that early in the season adding some programming that will alert you if the gyro reading is changing (my team liked programming the robot to beep on every degree change from the change when stopped in the Home area) when the robot should not be moving. This will let you find out if and when your robot's gyro starts drifting. This can warn you when someone didn't follow the EV3 startup procedure, or alert you when cable movement caused a gyro reset (another reason to key your wiring neat).

I hope this has been helpful and encourages you to look into trying out a gyro sensor on your robot! 

Friday, July 05, 2019

The Wharf Rats and the Hail Mary Mods at the Houston 2019 FIRST LEGO League Wold Championship

The Wharf Rats qualified for the FIRST LEGO League World Championship in Houston when they received the Grand Champion award at the North Carolina's FLL  State Championship - Track B for the FLL Into Orbit Season.

I want to share a little of the real world engineering experience the team had in Houston. During practice rounds they saw new features (missions) break in new ways under new test conditions and had to respond to the new data. Fix a bug or delete the feature so you can ship the product? Their "ship date" was inflexible. So they learned that sometimes you have to delete features to move a project forward.

Their robot had a rough day during Wednesday's Practice Rounds (scored runs that do not count toward competition scores). Some fixes appeared to work but then they saw new failure modes in missions later in the run. The more they tried to fix it, the worse it seemed to get. The robot was score was just over 100 where it scored 192 at the state championship, and closer to 300 in practice sessions prior to Worlds. They were discouraged and stopped working on the robot before the pits closed at 4:30 pm. Instead they went to the party in the park, listened to the music, played games, danced and just had a good time.

When the party was winding down, I shared that it was a common programming practice to eliminated unstable features from a product to allow you to hit your ship date. So we talked about looking for a key failure point that might have the most impact on their total score. They picked Run 4's Strength Exercise mission whose failure impacted the most missions down the line. They agreed it would be better to eliminate that mission, and it's points, to improve the robot's reliability for missions that follow. But that would require modifying the robot, changing mission fixtures and updating the firmware (thing they worked on for months). Their robot and fixtures are locked up in the pit until 7 am the next morning and their first competition run is at 8:40 am. Time for a Hail Mary! No fear! 

This is engineering! A bug is found in late testing. Your project ships tomorrow at 8:40 am. You can start working on it at 7 am. Now fix it!


Here is the team at 7:33 am Thursday morning. Everyone is tired but ready to go. They are working on their robot with less than an hour before they need to be in the queue for their 8:40 am run. You can see the venue is almost empty (the practice boards do not open until 8 am).

They modified the robot's attachment to remove the mission being deleted, update software and signed up for an 8 am  practice table. They had time for one 10 minute slot to test the mechanical changes and dial-in the programming changes. After multiple corrections, the robot turned the wrong direction then started driving the wrong way, they finally got Run 4 to work ONCE before they had to run to the pit to drop-off the laptop and get in the queue by 8:30 am for their first run! Their 8:40 am run scored 250 which held on to give them 13th place in robot performance! Video linked below.


My favorite part of the run is the 180 degree turn at 1:51. The turn was needed because the robot had been aligning on the wall using the Strength Training fixture on the back of the robot that was deleted. The fixture that was removed left the back of the robot uneven, so the robot had to spin and do the wall alignment using the front of the robot. That also meant that the first mission after the wall alignment, 3D Printer, had to be updated to turn the opposite direction since the robot was now facing the wall rather than backing into the wall for the alignment. (I also like how at 0:39 seconds that the robot does a 180 degree turn when a fixture is removed to point in the correct direction for the next fixture)

And for a while, they were at the top of the robot game leader board.


They also had a great research project (a system to reduce the deterioration of the human balance system during extended exposure to micro-gravity) that we hope to continue to advance. I could not be more proud of what they accomplished this season!

If you are curious, below is their YouTube video showing their planned robot game strategy a week before worlds. They did get that first cart to roll down the ramp. You get a better look at the robot rotating in base at 0:44 in this video.


You can support FIRST by volunteering as a coach, mentor or assistant! Teams can always use extra help with something. Find a team (or teams!) in your area and share your skills! Email me if you want help finding a local team. And contact me if you are interested in establishing an FLL program at your school. 



Thanks!
Shane

Coach - Wharf Rats - FLL #5027
Instructor - Summer Robotics Camp

Tuesday, July 02, 2019

Repair OVER SPEED Error on Generac 15 kW Generator

Note this is a follow up on the post linked below where we installed an external battery charger on this Generac generator. The Battery Tender we installed has been working well for over 4 years using the same battery that failed twice using the factory charger!

https://fettricks.blogspot.com/2015/06/substitue-battery-charger-for-generac.html

The most recent issue with the generator was a failure to complete its weekly self test. Upon inspection the OVER SPEED error light was on. You could still run the generator in Manual mode and it sounded like it was running normally.


My research indicated that, in addition to a genuine over-speed condition, this error can be caused when the sensor board doesn't have power so the sensor reading is not present, causing an erroneous Over Speed error. So I started looking for reasons that the sensor board might not be getting power. Let the sleuthing begin!

Danger Will Robinson! You should have a qualified generator service technician diagnose any issues with your generator. The voltage levels in the generator and associated switch gear are lethal. Forgetting to disconnect the power or touching the wrong spot at the wrong time can and will kill you. It is too easy to forget that you closed a breaker a few minutes ago. Really, have a technician do the work on your generator.


Safety first, this meant putting the generator in OFF mode and turning off the power to the house. Even then I pretend that every circuit is still live and avoid touching any conductors. Belt AND suspenders type of caution is the only way to go when dealing with electronics that can kill you!

When everything was off, I open up the generator's electrical panel and the transfer switch panel to look for obvious issues like disconnected wires, loose wire terminals and blown fuses. I got luck and found a blown fuse in the top of the transfer switch. There had been thunderstorms in the area shortly before the generator failed it's first weekly test. 



I ordered a pair of fuses, $7 each, and a $15 fuse puller/installer. The fuse were not cheap but I ordered two since there is at least a 50-50 chance that the fuse blew for a reason and the first replacement will blow again as soon as you power the unit back on. If that happens, then back to the diagnostics. I would start with again killing the power and checking the resistance between the fuse terminals and the chassis, looking for a frayed wire shorting against an edge somewhere.

Fuse on Amazon
Fuse Puller on Amazon

The fuses arrived quickly, thank you Amazon, and I repeated the process of turning the generator off and turning off power to the house. I then used the fuse puller to remove the old fuse and install the new one. To be honest, I also wore rubber gloves when working with the fuses. Never bet your life that a power circuit is actually off.

We reconnected the house power, set the exercise time and the generator ran fine. It has now been over a year since the fuse was replaced and the generator has not missed a weekly self-test. It has also automatically started several times during actual power outages. And we still have a spare fuse!

Preview

I am doing some early testing for a battery voltage monitoring system that I put together for this generator. Below is a graph showing the battery voltage during the generator's weekly exercise. Here you can see the battery voltage drop during starting, then the voltage begins to recover while the generator is running and then the battery is topped off by the Battery Tender before dropping back to the standby voltage. I can also configure the system to send me an email or SMS when the voltage drops below a specific voltage (generally this happens during starting so I am notified of start events). My goal is to be able to detect battery deterioration (and indicate that the battery needs to be replaced) before a failure to start occurs. It is also reassuring to see the battery charger topping off the battery following the weekly self test.







Wednesday, March 13, 2019

Minimal 3-Axis Magnetometer Rapid Prototype




This project started when a friend asked me to develop a method to measure the strength of a low-level magnetic field for a fixture in one stage of the playing field for a robotics competition. This was a college level event with teams from around the globe. The system used a low-level magnetic field so detecting the field was more challenging than simply using a reed-switch or hall effect sensor.

The design target for the magnetic field stage of the event was 1000 microTesla (μT), or 1 milliTesla (1mT). To ensure fair competition, the event manager needed a way to verify all of the boards produced a field meeting or exceeding 1000 μT. I suggested a potential sensor, the Melexis MLX90393 Triaxis Magnetometer for calibrating the fields and was quickly asked if I could put something together. That is the ever present danger of tossing out an idea in a meeting, "That sounds great! Why don't you make that happen!".

It sound like a great opportunity to quickly assemble a minimal viable product (MVP) and share some rapid prototyping tips. Here is how I built the magnetometer used to validate the magnetic field generators for the IEEE Southeastcon 2017 Student Robotics Competition

One of the robot challenges required performing an action only when a magnetic field was present (there was a Star Wars theme for this stage so detecting the field was referred to as sensing "The Force"). The goal was for the robot to detect the field and mechanically tap the target to score and turn off the magnetic field. After a random time delay the field turns back on and the process repeats until the end of that timed stage. Tapping the target when the field was off would award negative points. The video below shows The University of Alabama on this stage. You can watch the whole video to see all of the event's stages.

"Sense the Force" Stage from The University of Alabama

There were many innovated robots on display at the event. Here are more videos from this and other IEEE Southeastcon events.

The MLX90393 was available from Sparkfun as a SparkX product (SparkX devices are early development boards made available to adventurous customers for early testing). Note that this breakout board is now availability as a regular Sparkfun product with the modular Qwiic connectors. Sparkfun also offers a full hookup guide to get you started with your own project.


I purchased a couple of SparkX boards, combined them with a Sparkfun Arduino Pro Mini and a Sparkfun Basic Serial board along with an OLED display on a bread board and got started. Below you can see all of the elements on a breadboard on my workbench.




I began with an example sketch, modified it to send the the data to the OLED, added a little text formatting for the display and the programming was done! Here is a link to the code that was hacked together from several sources.

https://github.com/sdtrent/Minimal-Magnetometer

Next up, the breadboard was fine for my workbench, but how should I package the magnetometer for travel and use on the floor at the actual IEEE event? This was a fast and dirty project so I did not want to design a case. I wanted something that was just good enough to meet my minimal requirements. A quick glance around my workbench provided the answer! At arm's reach was a Sparkfun box that fit the bill nicely!

It was quickly re-purposed to hold the sensor, display and power switch. It took only a few minutes to make holes in the box for each of those. By carefully cutting the holes as slits and keeping the fit tight, the flex and friction of the box held everything in place. I did cover the actual sensor with a layer of clear packing tape to provide some insulation since we were going to be placing the sensor up against the the metal head of the bolt used for the core of the electromagnet. The clear tape also made it easy to see the sensor to help ensure we were putting it directly over the head of the bolt.



The 18650 Lithium Ion battery is massively over spec for the use-case, but I had the battery and holders on hand so in they went! The breadboard and battery holder were attached with Velcro dots.


The device worked great in the field. We even caught when a few of the boards were wired (or wound) with the opposite magnetic polarity. Those boards were quickly rewired to ensure a level playing field for all of the teams.

I was impressed with the performance of the Melexis MLX90393. It could easily measure the change in magnetic field when a neodymium magnet is rotated 15 cm from the sensor.

This is one example of how you can quickly assemble a proof-of-concept prototype to test an idea or even provide a Minimum Viable Product for initial field testing. I hope this helps you with your prototyping!