Final image of R2B4 - in the zone

1.     Final Modifications

Following some great comments from the community I added some 'treads' to my wheels and managed to get R2B4 to even run over my finger. But there was one last challenge I wanted to address still - to get back to powering R2B4 from the STM32F411RE-Nucleo board. I made the changes to the solder links on my new board, wired it up and ....nothing. After going back into the debug mode of TrueStudio I found a single line I had added called 'TestPins'. That function just toggled all my output pins so the stepper motors did very little. Upon taking that line out an re-compiling I found I was able to power R2B4 along using the STM32F411RE-Nucleo board. It has taken 15 weeks but I can now say I have used an ARM based MCU to do something 'useful' and was running my own code

 

{gallery} Final Modifications

The new treaded tyres

The new chunky treaded tyres

R2B4 with STM32F411RE-Nucleo Board

I swapped the Uno for the STM32F411RE-Nucleo Board - this is powered from the L7805 regulator directly into the +5v expansion connector along with 0v.

The Nucleo Board - using 4 pins to power R2B4

It almost was made for the job as it sits neatly on the battery.

At last - powered from the Nucleo Board

The STM32F411RE_Nucleo Board - used to control the direction of both servos via a buffer circuit and the stepper motor power controllers.

An here it is doing the basic preset manoeuvres:

2.     Summary

 

It looks like I'm now almost out of time on this Sixth Sense Challenge. Therefore I thought it nice to finish with a summary blog to detail what I aimed to build, what I actually built, what were my highlights, lowlights and achievements. Finally I will detail my aspirations for the future of R2B4. The previous blogs on this project are:

R2B4 - #1 An Introduction

R2B4 #2 - Getting Ready to Build

R2B4 #3 - Drive Motor Calculations, Drive Train Design and Control Design

R2B4 #4 - Making a Basic Bot

R2B4 #5 - L298 Troubles

R2B4 #6 - SensorTile Outputs

R2B4 #7 - Reading the SensorTile

R2B4 #8 - STM32F411RE-Nucleo Coding

R2B4 #9 - The TE Connectivity Load Cell (and new motor drive)

R2B4 #10 - TE Connectivity Magnetic Angle Sensor

 

{gallery} Gallery of R2B4

A piece of Ash tree

Did I really consider using this to make the wheels? The answer is yes ! Matured over ~16 years.

Wooden Wheel Making

Plywood wheels were a little easier to make, although the hole saw was not really big enough in diameter.

Threading an Axle

Threading halfway down some 8mm steel rod to make the axles

Wheels and Axles

The assembled wheels

Glued in Bearing

A 8mm bearing, axle partly protruding from centre

R2B4 Basic Chassis

A very basic chassis with plans to mount the stepper motors centrally, with space for the sealed lead acid battery at the front/back.

Belt Driven via GT2

A first attempt at adding slots for the GT2 drive belts

The STMicroelectronics SensorTile

The feature packed STMicroelectronics SensorTile

PCB for KMT32B Sensor

The PCB (negative) for making the PCB to hold my KMT32B magnetic sensor

STM32F411RE_Nucleo Board

STM32F411RE-Nucleo: the happy days before the A4988 stepper motor drivers' back EMF damaged it

My new S T M 32 board

But it was very quick to order a new replacement via CPC Farnell (a UK subsidery of Farnell/Newark/Avnet)

SensorTile Example Output

Output as seen on PuTTY from SensorTile Datalog USB Example

Drives on R2B4 - odd sized pulleys don't work !

The drive system that was not thought through very well !

The navigation method

Navigation Design into Software

The microscopic TE Connectivity Magnetic Sensor KMT32B

Testing the KMT32B

A more manageable KMT32B

Playing in the sand

R2B4 in the Sand

Burning rubber on the sand pile

More getting the wheels dirty

 

3.     The Initial Aim

 

This was what I stated in my first blog:

This is my idea for giving extra 'intelligence' to a robot. I want to make a robot that works as a builder's mate, bringing a specific weight of material from a large heap of building material and placing it in another location for loading into a cement mixer. This would be sand or mixed ballast/gravel. The robot would use the TE load cell to know how much material is loaded, navigate in some method (to be determined) and offload that material. The TE load cell is capable of a 25lb load (approx. 11Kg) so it would be likely that the R2B4 droid would have to go back and forth a few times to transfer the actual amount for a mixer load. However this will carry on whilst the builder is using the current mortar mix and will signal to them when that load has been transferred.

 

Often mixing is undertaken by volume rather than weight as the moisture content of the sand effects the weight enormously. Getting a robot to measure the volume would negate the use of the load cell and also prove difficult as the moist sand would not evenly distribute into any measuring container and would also likely clump to some extent. Adding a moisture sensor to my design would seem important so that the required weight can be calculated. I’ve seen moisture meter modules and circuits to make a bespoke one, so this should be quite easy to implement (famous last words there ! ). Calibration could be empirical and the user could adjust as required – perhaps a teach mode might be useful where the user has already calculated the correct volume and then passes it to the R2B4 to weigh.

 

Initially I looked through the materials provided for this challenge, determining the specifications of each part and identifying what was mandatory to use. Whilst the STM board was overloaded with functionality I found it difficult to think of an idea that utilised at least one of the TE connectivity accessories, they seemed to be a random mix of sensors and already had some functionality replicated in the sensor tile. Initially the load cell seemed like the most difficult sensor to incorporate into a project; a weight limit of 25 pounds is approx. 11Kg which is a reasonable amount of weight in the real world. I asked myself what someone might want weighed automatically by some form of robot? I then had the idea that a builder mixing up mortar has to go to the sand pile and often approximates the amounts of sand and cement. This could form the basis of a great autonomous robot - one that can measure the required amounts of damp sand and bring it over to the mixing area - perhaps dumping it onto a secondary conveyor belt (for automatic lifting into the mixing drum) or depositing it on a mixing spot. The robot would be able to go back and forth until the required weight is gathered and then alert the builder that they are ready to mix. The builder would know that the correct amount was in the neat pile in front of them.

 

4.     What I Have Achieved and Learned

4.1     My First Mobile Project

I have never owned or made a RC car or other robot. It was kind of cool watching R2B4 struggling along the carpet and latter the tiled floor even if it was a little slow and unresponsive, made some aweful noises and had virtually no autonomy.

 

4.2     The Drive Train

I made a chassis, added some bearings, manufactured my own axles and a cogged drive system including bespoke GT2 drive belts which have actually held up to being used since.

The GT2 drive chain

 

4.3     A Real STM32CubeMX Project

I learned to make my own STM32CubeMX project - it built, debugged and downloaded. I was even able to modify the code in STM32CubeMX and update my project using the wisdom of several E14 community members.

Being able to modify the STM32L476JG SensorTile - again with lots of help from the E14 community. This was my main reason for applying for this Challenge - to have a real motivation to get to grips with the STM32 boards - knowing the Element14 community was watching my progress helped to spur me onwards. I now also have a much better understanding of how the Nucleo and Dicovery boards have been made generically with multiple solderbridges to add/remove as required, and doing so requires reading of the schematics. As I carried on I found I got quite confident at using my IDE of choice, this was the Atollic TrueStudio, I opted for that as it was totally free and without any restrictions on its use (code size or time bounded).

 

4.4     The SensorTile and UART

The STM BLU sensor app for the SensorTile is very comprehensive and great fun, and I was pleased to make some great progress with this feature packed device. I took my board into work (my day job) showing it off to the team and I think everyone was quite impressed that that small SensorTile had so many features packed onto it.

SensorTile Output

 

4.5     Stepper Motor Control

Lastly I learned a lot about how the stepper motor drives work, their weaknesses and what makes a good one.

 

4.6    Making the PCB

There are quick ways to make a reasonable PCB at home and they don't actually need very expensive equipment. I learned a nice technique for mounting the TDFN magnetic sensor device by first tinning each pad and then heating the trace nearby and letting the heat flow along, pushing slightly down on the IC to ensure the solder took properly. A flux pen is a real help here.

The mounted TE Connectivity KMT32B Magnetic Sensor

5.     What Didn't Go So Well

For anyone who followed my blog posts, it was clear to see not everything went as planned. This included:

  • Difficulty in making the wheels !
  • The extra weight of a wooden robot with a Sealed Lead Acid battery
  • The pitfalls of L298 drivers and lack of power transfer to the stepper motors.
  • Damaging the only other driver boards I had - the A4988 and worse still damaging my only STM32F411RE-Nucleo board (OK, I bought myself a new one via CPC Farnell)
  • Trying to add HAL functions to the already finished STM32L476JG SensorTile Datalog example
  • Working out how to get the BLE functionality of the SensorTile to the Nucleo board
  • Using the TE Connectivity Load Cell - my appologies again to TE Connectivity for messing that sensor up

 

6.     Still to Do

In this final blog post the following is still required:

  • An angle/bearing measurement to allow R2B4 to turn in specific angular measures
  • There is no user programmable interface, the video examples of R2B4 moving are using a scripted set of instructions
  • A mechanism to load platform; loading mechanism or offload mechanism.
  • Learn about Instrumentation Amplifiers and try out some experiments on a 'rainy day'
  • I never got to use the TE Connectivity temperature sensor properly, I have plans to use it for my PCB tank thermostat (suitably protected in plastic).

 

7.     What I Did Not Understand

From the very outset of this project I could get the BLE Android app working and was able to read the multitude of data from the SensorTile. However I was not sure what route Element14 team expected this to get merged with the Nucleo board (which did not have BLE connectivity). I also had a huge problem understanding how to modify an existing STM32 project to add in additional peripherals or functionailty. I posted an article asking for help and got some great replies: https://www.element14.com/community/message/272477/l/hal-libraries-importing-and-using#272477

 

I was at first reluctant to move from the SensorTile connector to irectly soldering it to either the cradle or cradle extension board. As I have started to understand how the ST-LINK can program the STM32 range and where the actual MCU are in these boards I better understand. I may therefore solder the SensorTile down to the cradle in the future so I can concentrate on using the BLE functionality for data transfer to other devices - feeding it to the RPi would be awesome.

 

I was unsure how I would actually use the load cell to measure the weight of sand. Obviously I could not balance the sand hopper on such a small device and so it would need to rest on corner mounts or a hinged side. Uneven loading of the sand would surely give an incorrect reading on a single load cell - I would suppose that I needed 3-4 sensors to act as the feet of my sand hopper and to sum their individual readings to calculate the overall load mass.

 

8.     Conclusions

This was my first Element14 Community Challenge. I was relunctant to enter this challenge as my previous two attempts to roadtest ARM based boards wasn't too successful and I really struggled. I entered this challenge to give myself a realworld aim and requirement to learn more about ARM Cortex MCU, and I must admit I am much more knowledgable now - therefore to me it has been a great success even if R2B4 was not so much. I recently bought myself a Product LinkProduct Link from Farnell (the STM32F429I Discovery board) and I am now confident I will be able to use that as well as looking forward to returning to look at the STM32L4R9I-DISCO Discovery Kit - Review and NXP I.MX RT1050 EV KIT and Display - Review

 

I also have a 'working' robot chassis that I aim to upgrade/rework over the years as my knowledge and skills improve. My first improvement will be a lighter battery, then better (e.g. lighter, wider tread and bigger diameter) wheels and a better drive system (belt tensioning).

 

I hope you have enjoyed reading my regular progress blogs as much as I have enjoyed writing up my journey on this project. I have not managed to save the world with my R2B4 - and if you didn't realise, the concept was slightly light-hearted in that this stands for Remote Robot, Builders' Bot Banishing Bot (R2B4) and I bet that  never makes it to a Star Wars film

 

If you have never applied for a Design Challenge before then I urge you to give them a try - attempting to deliver a project you have suggested is really rewarding, chipping away and making the regular blog posts is also fun. There is a new Design Challenge just starting called PiCasso Design Challenge: The Challengers  and it contains a huge variety of interesting and fun projects, I am going to enjoy watching those progress. For anyone that wants to take part you can just start building as a non-sponsored challenger - you just need to use the Raspberry Pi 3B+ in your design.

 

9.     Thank You

These are a few of the people I would like to thank for their support, encouragement, comadary of the challenge over the last few months, motivation and of course, selecting me to take part in this challenge:

 

  • E14 Community - I received some great encouragement and suggestions from the E14 community in response to my blog posts, for which I was really grateful
  • TE Connectivity
  • STMicroelectronics
  • dougw
  • kulky64
  • e14phil