Another Treadmill Conversion

Not sure yet how I'm going to machine down the lip on the hole... it's about 1/2" high and I need to remove about half of that. I could just cut it out with a Sawzall, but I'd like to retain at least part of the lip for the stiffness it provides.

If you have a Dremel or a die grinder with HSS or carbide burr, I think that would do a nicer job than the Sawzall. Mike
 
It spins!

Tonight I got the motor mounted and [temporarily] wired. I ended up having to cut the entire lip out of the belt guard as there was less clearance than I thought, but the sawzall made short work of that, and the enlarged hole gave more room for motor adjustment. Then a couple of evenings fiddling with the motor mount to get the center of adjustment in the right place. Before that I got all the wiring to the head and hooked up to the switch and the 12VDC power supply. Of course I decided there was a better way to wire it after it was half done, which required redoing some of it, but that's done now.

With the belts as you see them below, it goes from too slow to measure (with the Heathkit tachometer) but estimated around 100 rpm up to 4000 rpm, and is smooth as silk.

motor_mount_200646257.jpg
motor_installed_200638039.jpg
Still to do is finish the permanent motor wiring, and wiring for the tachometer and fan.
 
I'm not surprised no power supply decoupling (filter) cap was shown in the original circuit- It's assumed if you have worked with 555s before you would know to add one.
If it seems to work without one you should add it anyway because the circuit may be unstable without it. I would actually add more, say, 10uf/25volt.
MS

What do you mean by "unstable"? Though I think I know. It's been working, most of the time, but then it'll just stop working, apparently it drifts off the frequency the motor control board expects. Sometimes I can tweak the trim pot one way or another and it'll start working again, but this evening was frustrating.... I had everything working, all the final wiring done, and then it started working intermittently, now it doesn't work at all. I do think the trim pot is the issue at the moment as the nose where the adjustment screw is came loose at one point, though it still worked when I pushed it back together and held it with some hot melt glue.
 
What do you mean by "unstable"?

Capacitors are used with digital logic devices to help provide stable power. When a digital logic circuit switches, it can draw hundreds of milli-amps of current from the local power rail. The power supply will try to supply the current, but it might be electrically far away. Any long wires provide both resistance and inductance, and both limit current flow. The voltage rail can "droop" or dip.

Decoupling or filter capacitors act like small local batteries. They are placed as close as possible to digital devices. Most of the time, they just sit there charging/charged up to the the supply voltage (Vcc, Vdd, rail voltage, etc.). However, when some digital logic switches and suddenly draws more current, the capacitors help supply it. Therefore they help maintain a stable local supply voltage to the digital device.

Many digital device can do very goofy things when they lose stable power.

The decoupling capacitor value is normally chosen to help at the switching frequency of the circuit. The value is normally some tiny part of a Farad (like micro-Farad, or uF). For this circuit (where the frequency varies based on the position of the potentiometer) I'd likely add three decoupling capacitors; two of 0.1uF (one across each 555 power pins) and one of 50-100uF somewhere on the board.

Be sure the capacitors are rated for at least the 12V supply you are using, and that they get connected properly if they care (some are polarized, some not).

-brino
 
Last edited:
Oscillation is what I meant. The circuit could suddenly break into oscillation and give all sorts of goofy behavior. Without a scope it can be hard to figure out what's going on.
Just add plenty of decoupling cap and it shouldn't be a problem.
MS
ps what Brino said too.
 
Thanks, about what I figured. The PWM frequency in this case is somewhere between 17-20 hz. I'll have to see what's laying around in my electronics box. Funny how it works, then doesn't, then works again... but when it did work, it was at the hairy end of the trimmer's adjustment, so I may have to increase R1 a bit more, too.

Or I could just bypass all this fiddling and buy a MC-60 controller which only needs a pot to control the speed...
 
I finally have everything working.

I think there were multiple problems with my 555 based circuit. Last week I borrowed an oscilloscope from a friend to look at things before replacing the trim pot and adding the decoupling caps. It looks like something fried the second stage 555 as I was getting a 21-23hz signal from the first stage, but nothing from the second. And something was wrong with the first stage too, as the frequency wasn't what it should have been based on the R-C values I used. Then when I was poking around further I must have missed with the probe, I heard a little "pop" and that was the end.

But I had already bought an Arduino to play with "just in case", which I should have done in the first place (and which I recommend to anybody trying to use an MC-2100). The $10 for an clone Arduino Uno board is less than I spent on all the other stuff. I've never used one before, but it's stupid easy to use if you know anything at all about programming. I started with another page at Sons of Invention, which shows one setup much more complicated than I wanted (since I already had a separate tach) and another simplified one that didn't work as presented. I started with the simple one, tweaked it a bit with bits of the more complex code, and had it working in short order.

As you can see the wiring is a lot simpler than the 555 based circuit (below circuit modified from the one on the SOI page):

Simple MC2100 Arduino Circuit_fixed.jpg

Wires going to the board were soldered to header pin connectors and strain relieved (sort of) with hot melt glue. The red connector in the lower left corner was an extra that I cut out of the treadmill so I could do all my soldering on the bench instead of the side of the machine:

arduino-wired_130324707.jpg
I spent some more time today getting the tach (ebay, about $10) working once I figured out the wiring of the Chinese labeled components, and got everything mounted in a box. That's the sensor for the tach just to the right of the tach display.

controls_133611693.jpg
Here's the box on the back of the mill with the MC-2100 controller and the auxiliary power outlets. The toggle switch is the motor reversing switch, safely out of the way (by all accounts reversing the motor while it's running will fry the controller). All the air vents in the box are covered on the inside with window screen to keep chips out.

MC-enclosure_133722581.jpg
And here's the wiring to the motor, and the new fan (salvaged from an old computer):

motor_135218529.jpg

The mill's original power switch now switches power to the motor controller, which in turn also provides the 12VDC power for the Arduino. I added another power switch next to it which turns on a separate 12V power supply which runs the fan, display lights, and tachometer (since I don't know how much power the MC-2100 can supply). The smaller switch below the tach is the one that actually starts and stops the motor in normal use.

Everything seems to be working quite well. RPM range is from a little over 4000 max to something too low for the tach to measure reliably but something under 200 rpm. I currently have the belts at a 1.4:1 ratio which seems good for normal use but if I want to go really slow I can use the 1.9:1 or the 4.8:1 ratios. The motor rpm does seem to drift up and down a bit, but I don't think it'll be a big issue. If it becomes a problem I may try hooking up the tachometer input to the MC-2100... there was a reed switch on the treadmill's driven pulley reporting rpm back to the board but I don't know if it actually was for motor control feedback or just for the walking speed display. At any rate, it runs without it.

Sigh, this was one project that took far longer than it should have...
 
Last edited:
By request, here is the Arduino code. Save as an .ino file or cut and paste it into the development environment:

Code:
#include <TimerOne.h>

/*
  MC-2100 Treadmill Motor Controller Interface
  Lathe Motor Controller via PWM
  ON/OFF Toggle

  Original from
  Joe Schoolcraft
  Brian Schoolcraft
  May 2013
  https://sonsofinvention.wordpress.com/2013/05/22/arduino-compatible-mc-2100-controller-and-lathe-tachometer

  Updates to make it work and add debounce FanMan 170122
 
*/

#define POT_READ A0 //Wiper of pot connected as voltage divider (Speed Command)
#define PWM_OUT 9 //Connected to blue wire of MC2100 (50ms period PWM out)
#define ON_OFF 12 //On/Off Switch Input
#define TO_LOW_DELAY 50 //Debounce time for HI to LO switch transition
#define TO_HIGH_DELAY 50 //Debounce time for LO to HI switch transition


#define PWM_CYCLE 50.0 //Output Signal PWM Period (50ms)

#define POT_DIF 4 //Change detection threshold on pot
#define MAX_DUTY 869 //Max Duty Cycle expected by MC-2100 (85% of 1023)
#define MIN_DUTY 0 //Min Duty Cycle expected by MC-2100 (0% of 1023)

int potTemp;
int potValue;
int lastPotValue;
int potCheck;
int speedLevel;

byte onOffState = 0;
byte lastonOffState = 0;
unsigned long lastOnOffTime = 0;

void setup()
{
  pinMode(POT_READ, INPUT);
  pinMode(PWM_OUT, OUTPUT);
  pinMode(ON_OFF, INPUT_PULLUP); //Enable internal pullup resistor to simplify external circuit

  Timer1.initialize(PWM_CYCLE * 1000); //Set pin 9 and 10 period to 50 ms
  Timer1.pwm(PWM_OUT, 25); //Start PWM at 0% duty cycle
}

void loop()
{
  //Read and condition pot value
  potTemp = analogRead(POT_READ);
  potCheck = abs(potTemp - potValue);
  if (potCheck >= POT_DIF) { //Only accept new value if it’s far enough from the current accepted value
    potValue = potTemp;
  }

  speedLevel = map(potValue, 0, 1023, 0, MAX_DUTY); //Convert Pot input to pwm level to send to MC-2100

  onOffState = debounce(ON_OFF, &lastonOffState, &lastOnOffTime, TO_LOW_DELAY, TO_HIGH_DELAY);

  if (onOffState == LOW) { //Off  switch to ground is closed
    Timer1.setPwmDuty(PWM_OUT, 0); //Shut down MC-2100
  }

  if (onOffState == HIGH) { //ON switch to ground is open
    Timer1.setPwmDuty(PWM_OUT, speedLevel); //Send speed command to MC-2100
  }

}

////////////////////////////////////////////////////////////////////////////////////////////
/* Function for debouncing digital inputs

  Arguments:
  _debouncePin - ID of pin to be read/debounced
  lastReading - pointer to variable storing the previous reading (HIGH/LOW) of the input pin
  lastDebounceTime - pointer to variable storing the last time (ms) the input changed (not debounced)
  _toLowDelay - debounce time for HIGH to LOW transition
  _toHighDelay - debounce time for LOW to HIGH transition

  Returns:
  _state - debounced state (HIGH/LOW) of _debouncePin
*/
////////////////////////////////////////////////////////////////////////////////////////////

byte debounce(byte _debouncePin, byte * lastReading, unsigned long * lastDebounceTime, int _toLowDelay, int _toHighDelay)
{
  byte _reading = digitalRead(_debouncePin);
  byte _state = *lastReading;

  if (_reading != *lastReading) { // pin state just changed
    *lastDebounceTime = millis(); // reset the debouncing timer
  }

  if ((millis() - *lastDebounceTime) >= _toLowDelay && _reading == LOW) {
    // whatever the reading is at, it's been there for longer
    // than the hold delay, so take it as the actual current state for use in the rest of the script
    _state = _reading;
    *lastReading = _reading;
    return _state;
  }

  if ((millis() - *lastDebounceTime) >= _toHighDelay && _reading == HIGH) {
    // whatever the reading is at, it's been there for longer
    // than the hold delay, so take it as the actual current state for use in the rest of the script
    _state = _reading;
    *lastReading = _reading;
    return _state;
  }
  *lastReading = _reading;
  return _state;
}
///////////////////////////////////////////////////////////////
 
Hi everyone...i am a new user here. It is a stout motor, must be from a commercial treadmill. I found one used for my wife a few years back and I think she would be a little upset if I commandeered it. I am betting your really going to like that kind of rpm range and torque, but you may have to upgrade the spindle bearings to take full advantage of the top end potential.

printed circuit assembly
 
Last edited:
Back
Top