1.     Aim

I had planned on all of this blog #9 being dedicated to using the TE Connectivity Load Cell but in blog #8 I managed to damage the A4988 stepper motor drive units and subsequently damage the STM32F411RE-Nucleo board as well. Therefore the first part of this blog will detail how I remedied a replacement unit and one that I hope is slightly more robust.

 

2.     The New Motor Drive

Although the STM32 Nucleo board was quickly re-ordered via CPC Farnell, the lead time on new A4988 boards was going to be excessive for my limited time left on this challenge. Therefore I had a look at what I needed to do. Back to the H-bridge drive circuit but I didn't have enough MOSFETS to build these. What I did find was an abundance of 12v coil relays. As the direction changes would not occur too quickly I decided that I could use two relays per coil to change the current direction and then use a single MOSFET to chop that signal on/off. The total would be four relays per NEMA-17 plus four transistors and two MOSFETS. I didn't have quite enough of the same relay but did find some extra 12v coil versions so carried on with that approach.

A relay and MOSFET H bridge

I set off building my version on stripboard but noted online comments about "just buying a quality driver" and therefore, before I finished the soldering, I decided to do just that. I ordered a pair of TB6600 - a 4A micro-stepping capable unit, more expensive than the A4988 or LM298 but hopefully better in every way. To drive the 'steps' and 'direction' pins of this module I was unclear if the inbuilt opto-coupler included a limiting resistor. Rather than damage my brand new purchases I decided to do some tests and started measuring the current with a few external series resistors to determine what the internal resistance was. Then just to be extra careful (as I think shabaz mentioned in a past blog) I added a small 15 ohm in series rather than pull the open-collectors straight to ground. The transistors I used were 2N3904 NPN with a 1.2k base resistor. Initial tests showed it worked at both 5v and 3.3v drive levels. The boards were something I spotted in CPC Farnell - some really neat 2-up prototyping boards of single pads on a 0.1" matrix.

{gallery} The Stepper Driver Modules
Stepper Driver Module
Nice little prototyping board from CPC Farnell
Stepper Driver Conditioner Circuit
New Stepper Motor Drivers

My new GT2 pulley also arrived so I was able to gear down my stepper motors to the axles by 4:1 which will increase the torque on the wheels, albeit with a slower speed. To accommodate these larger pulleys I then needed to make some new drivebelts so back to the needle and thread. This method still is not idea and would be much better if a jig was made. Something to allow the needle to be passed through and into is also helpful as is very good lighting (working up by the window was best)

{gallery} Homemade_GT2_Belts
Clamping G T 2 belt together
Clamping G T 2 belt with pliers

The finished belt joint

That was a bit awkward, and this time I kept the belts fairly tight to length so I did not have to pull the stepper motors upwards to tension the belt. I did have to remove a pulley to slide the whole thing together.

 

At this point can anyone see what is wrong with my new geared down design?

The geared down  R 2 B 4

 

[SPOILER ALERT]

As soon as I hashed the cabling up, using the Arduino Uno again rather than risk damaging my new Nucleo board at this stage, I noticed something had gone very bad. Increasing just one drive wheel pulley resulted in the front wheels turning at 1/4 the speed of the rear ones (Doh)!

I have had to resort back to the 1:1 design as I cannot order (or really afford) another two pulleys in such a short amount of time. However I have built the wheel diameter up somewhat and I hope that will give better grip and traction as well as the motor drivers allowing the full 2A per stepper to be delivered. The controllers have DIP switches to set the microstepping options as well as the maximum coil current.

New Nucleo ready and waiting

Taking a slight step in the middle of this work, as I didn't want to fry my brand new Nucleo board again, I've decided to test the drivers out with my Arduino Uno (as at least I could swap out the MCU if I damage it). And below is a video of what I got, R2B4 running around on a prescribed script of forward/backward/turn etc. To be clear there is no sensor at the moment to gauge the amount of angle turn.

 

#define BAUDRATE (9600)

#define DIR_PIN_LHS 4
#define STEP_LHS  5
#define DIR_PIN_RHS 8
#define STEP_RHS  9

int pos = 0;    // variable to store the servo position
int stepdelay =10;

enum  mode_t{
  servotest=1,
  R2B4=8
};

  enum mode_t thisMode=R2B4;

/*******************************************
*             ARDUINO SETUP
********************************************/
void setup() {


  pinMode(DIR_PIN_LHS,OUTPUT);
  pinMode(DIR_PIN_RHS,OUTPUT);
  pinMode(STEP_LHS,OUTPUT);
  pinMode(STEP_RHS,OUTPUT);
  
  int step_delay=15;

  Serial.begin(BAUDRATE);
  Serial.print("Welcome to R2B4.");
   
}

/*******************************************
*             MAIN LOOP
********************************************/
void loop() {




  while(1){
      //forward
      digitalWrite(DIR_PIN_LHS,LOW); 
      digitalWrite(DIR_PIN_RHS,LOW);
      // 200 pulses = 1 turn of servos
      for(int x = 0; x < 255; x++){ 
        digitalWrite(STEP_LHS,HIGH); 
        digitalWrite(STEP_RHS,HIGH);
        delay(stepdelay); 
        digitalWrite(STEP_LHS,LOW); 
        digitalWrite(STEP_RHS,LOW);
        delay(stepdelay); 
      }
      delay(2000);

      //left
      digitalWrite(DIR_PIN_LHS,HIGH); 
      digitalWrite(DIR_PIN_RHS,LOW);
      // 200 pulses = 1 turn of servos
      for(int x = 0; x < 255; x++){ 
        digitalWrite(STEP_LHS,HIGH); 
        digitalWrite(STEP_RHS,HIGH);
        delay(stepdelay); 
        digitalWrite(STEP_LHS,LOW); 
        digitalWrite(STEP_RHS,LOW);
        delay(stepdelay); 
      }
      delay(2000);

      //right
      digitalWrite(DIR_PIN_LHS,LOW); 
      digitalWrite(DIR_PIN_RHS,HIGH);
      // 200 pulses = 1 turn of servos
      for(int x = 0; x < 255; x++){ 
        digitalWrite(STEP_LHS,HIGH); 
        digitalWrite(STEP_RHS,HIGH);
        delay(stepdelay); 
        digitalWrite(STEP_LHS,LOW); 
        digitalWrite(STEP_RHS,LOW);
        delay(stepdelay); 
      }
      delay(2000);

      //BACKWARD
      digitalWrite(DIR_PIN_LHS,HIGH); 
      digitalWrite(DIR_PIN_RHS,HIGH);
      // 200 pulses = 1 turn of servos
      for(int x = 0; x < 255; x++){ 
        digitalWrite(STEP_LHS,HIGH); 
        digitalWrite(STEP_RHS,HIGH);
        delay(stepdelay); 
        digitalWrite(STEP_LHS,LOW); 
        digitalWrite(STEP_RHS,LOW);
        delay(stepdelay); 
      }
      delay(2000);
      
  }
  

}//loop

3.     TE Connectivity Load Cell: Product Characteristics

The TE Connectivity load cell is a small (19mm diameter) diecast unit that is capable of measuring weights placed on it. It operates via the piezo-electric effect and has been configured as a Wheatstone Bridge arrangement. Therefore the output will be a differential voltage.

The datasheet for this loadcell was a bit too short in detail for my skill level and lacked a 'typical application' circuit. I was a little lost as to how to actually use it and what to expect. The datasheet for this loadcell is unclear which device I am actually using. I have some numbers hand-written on the side as either 1198 or 8611 but neither seem to relate to any of the load cell models listed by TE Connectivity. I checked between the four pins to see what the resistance were and they are noted in the diagram below, but I couldn't get any variation as I pressed on the device (perhaps it needed wiring up completely).

The T E connectivity load cell

 

4.     Approach - Signal Conditioning Circuit

I decided the try and make a difference amplifier to at least amplify the small signals on the Output pins (O and O+). The best way to not load the Wheatstone Bridge would be to buffer both output connections with a high impedance circuit - the op-amp being my first simple choice. I could then amplify the difference between those two voltages by a third op-amp circuit. Below is a sketch of my proposed circuit:

Load Cell Signal Conditioning Schematic

Prior to building this I thought I would go and attach the wires to the load cell - the sun was still shining so the shed wasn't as cold as it would be later. Then in the evening I could work on the breadboard in the comfort of the warm house....

 

5.      Results

Well that ended up being a massive fail on my part. Below is a photo after I attempted to connect some thin wires to the load cell pads. I ended up pulling a pad off completely, deciding to use the via instead, getting a solder connection to that one and then finally pulling off another pad that I could not see the connections for anywhere else

My badly soldered load cell

 

My sincere apologies to TE Connectivity - I feel I have let you down here as this was the main sensor I required for R2B4 to become functional as intended.

 

The main issue was my approach where I twisted the cables together and added heatshrink prior to starting to attach them to the module (now they had very little flex in them). In my attempts to get the second and third wires there was little slack in my design fo the full force was on the first/second solder pad....an they gave up. This also highlights I need to get myself (or make) a few accessories for helping with such tasks:

 

  • a low strength, positional, helping hand
  • decent extra lighting
  • magnification on the subject

 

My other suggestion for someone using this sensor is to keep the wires separate, attaching each to the sensor, use the thinnest wires you can find and then perhaps a blog of epoxy to hold them in position. A better approach might have also been to use push pins to make a pressure contact to the board rather than solder to it?

 

6.     Summary

This blog seems to read as a catalogue of failures. With a bit of thinking back however I don't think that is quite the case, but perhaps more of a 'dynamic learning experience' ? More importantly when doing something like this, never give up as each failure is a chance to learn,

 

The good news is that those stepper motor drivers are working well, and given the size of the heatsink, should be able to take some heavy currents. The small buffer board that I have made to go between the Nucleo (or Arduino) and the stepper driver is also working well.

The R2B4 currently weights 5.2Kg and can just manage to haul itself along although it seems this approach cannot steer very well. This makes me think about the lateral forces a tracked tank must have to endure. (The hex key and precision screwdriver are tensioning the drive belts for now).

R2B4

 

7.     Next Blog

There is only about one week left on this Sixth Sense Challenge. I would like to get the Nucleo board integrated in that time so at least R2B4 is powered by the STM32F411RE-Nucleo....that is my main aim now.