Self Paced Treadmill

Discussion in 'The Projects Forum' started by Smyleorelse, Feb 13, 2016.

  1. Smyleorelse

    Thread Starter New Member

    Dec 19, 2015
    9
    0
    Hello :)

    I am interested in modifying a treadmill so that my position on the belt will control the speed in order to keep me in the middle, making it a self paced treadmill. I have an Arduino program that I made to control a little DC motor with a 9V battery, but now I'm trying to apply it to a real treadmill and I'm in way over my head. I just spent two weekends trying to hack into a 15 year old Precor treadmill to no avail. I understand electricity and have some background in programming, but electronic components are uncharted waters for me and I'm learning, but no expert.

    Ultimately, my question is twofold: 1 - Is there a way to simply use a PWM pin from the Arduino to tap into the gate lead for the treadmill motor transistor in order to maintain all other treadmill functionality while controlling the speed? 2 - Is this way harder than I think it is or are old boards just tricky to decipher?
     
  2. electricnut

    New Member

    Feb 9, 2016
    5
    0
    Kudos to you for the idea!
    I will start by noting that it will be very difficult to make a system like this dummy-proof, (read "kids") or even very safe for anybody that doesn't have experience using it. As I'm sure you've seen, the motor has a large flywheel on it to, well, basically to keep the motor from briefly stopping each step from friction before the controller has time to compensate. Not only that, but the motor controllers used on traditional treadmills almost always have a intentionally slow response time. So, if you suddenly stop walking, you can't reasonably expect the treadmill to stop before you fall off the end without heavy modification to the controller board.
    Yes, that is possible, but if you're just getting started with electronics, (or even seasoned...) I highly recommend that you DO NOT attempt to control the motor yourself. That gets messy quick! Also, on many treadmill motor controllers, the AC wave is rectified (rather than rectified and filtered, like you would see in a regular SMPS) and then the motor is controlled with SCRs (rather than a transistor or MOS-FET) using the basic principal that a light dimmer does. However, the circuitry required to do this is quite complex and tricky. Factor in everything else that the controller does: overheat protection, current limiting, speed regulation, just to name a few, and, well, that board has all those little parts on there for a good reason!
    I don't know for sure that your controller uses SCRs to control the motor, but if it does, believe me, SCRs are no transistor! Controlling them is a very different ballgame. And if it uses MOS-FETs or transistors, that hardly makes things much easier.

    Even though it is really hard to give a detailed step-by-step without knowing the controller's schematic, I would recommend starting at the circuit board with the speed knob on it and checking to see pin/pins the knob changes, and attempt to emulate that.
    Without knowing much about the interface, I would guess that the best way to interface the Arduino to the speed pin/pins that go to the motor controller board would be to first isolate the Arduino with an optocoupler, that way you can't damage it. Also, the optocoupler behaves more like a potentiometer; it doesn't generate voltage, it changes resistance based on the input current.
    Then, a simple R/C block to convert your PWM signal to a constant current. (you'll need to experiment with the resistor value, I would recommend a moderate sized capacitor >10uF. This could be made smaller, but that depends on your PWM frequency and how much power the controller requires on that pin.)

    Yes, way harder if you attempt to control the motor directly yourself. However, if you can figure out how to drive the motor controller, it shouldn't be too bad. Though, unfortunately, especially with electronics, things are seldom as easy as they sound.:(
    I am curious to know how you'll tell where the person is on the treadmill. Sounds like maybe you have something figured out there?

    Good luck, hopefully this helps... it really is hard to say much without seeing a schematic of things, but I understand why that's not an much of an option. Though, I will note that with luck, you may be able to find a schematic on the internet. With diligent effort, I was able to find the schematic for one such motor controller board from a treadmill.
     
  3. Smyleorelse

    Thread Starter New Member

    Dec 19, 2015
    9
    0
    Man, you guys are awesome. Tha is for the quick feedback and not being mad at me for not being an expert.

    So the deal is, I don't want you to worry about safety and effectiveness of my Arduino program as that will be an iterative process once I can control the motor. I have a position sensor and an algorithm that I want to tweak, but to be able to tweak it, I need to see how the program controls a treadmill motor rather than a little DC motor.

    Thanks for your input so far. I'll get a more modern treadmill soon and I'll post what I'm working with so you guys can help me out. I see what you're saying about protective circuits and a programmed limit to rate of acceleration or deceleration which is why I was trying to get as close to the motor controller as I could, and with my limited experience I'm thinking it's the transistor. The 15 year old treadmill had an SPC, but I'm going to get a more modern one and report back.

    Thanks again!
     
  4. Smyleorelse

    Thread Starter New Member

    Dec 19, 2015
    9
    0
    Thanks for the quick feedback*
     
  5. Smyleorelse

    Thread Starter New Member

    Dec 19, 2015
    9
    0
    I was thinking about it this morning and now I'm wondering if it would be easier/cheaper to just build a circuit that will control the motor? I have a circuit that controls the little DC motor, but it's on a bread board so I'm worried about the current it could handle. Maybe upgrade to a better board and then I'd need a transistor that can handle more current? I know a large part of the board that's there is for the display, incline motor, workout programs, etc., which I don't really need at this point.

    If all I need is to control the motor, would that be easier than trying to hack into an existing board?
     
  6. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,779
    1,103
    Does it have an input for a tachometer signal? A tacho is essential for treadmill motor control.
    Does it allow for acceleration/deceleration control? Both would be required for safe control of a treadmill motor.
     
  7. Smyleorelse

    Thread Starter New Member

    Dec 19, 2015
    9
    0
  8. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,515
    2,369
    Most T.M. controllers have a zero start protection, IOW if you turn off the controller the speed pot or? at power on the speed has to be set at zero before the motor starts, two reasons, to prevent immediate high start rate and also because the motor has a large flywheel, this inertial would stress the motor and controller, especially with someone on it.
    Also some controllers have a PWM command signal, rather than the 0v-10v pot versions.
    Max.
     
  9. Smyleorelse

    Thread Starter New Member

    Dec 19, 2015
    9
    0
    Yeah, I've also been thinking about the flywheel issue. TM motors are designed for steady state running with only slow transitions between speeds, whereas I want something more agile. The motor I have currently has the heavy flywheel on one side and the belt pulley on the other, so in this case I guess I could just take the flywheel off. Maybe the pulley is there to reduce the motors ability to quickly change speeds, so that speed change isn't jerky? Thoughts?
     
  10. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,515
    2,369
    Yes, the flywheel stores energy due to the inertia of the flywheel, without it the motor/belt would jerk on rapid load change.
    Max.
     
    Smyleorelse likes this.
  11. ebeowulf17

    Active Member

    Aug 12, 2014
    678
    79
    I like the hacking into the speed knob idea, assuming it's a model with a simple potentiometer knob. Even if not, writing an Arduino sketch to close switches (relays or solid state) to simulate button presses to increment/decrement speed would be easy, and far simpler than trying to replace the motor controller circuitry.

    To get an idea how responsive the treadmill electronics/motor are, you could do a little test where one person walks/runs at varying speeds while another tries to make the treadmill match speed appropriately. Humans intuitively tend to be pretty good at stuff like this, compared to how hard it can be to make a computer react appropriately. If a human controller can make the treadmill behave the way you want, then you can just hack the interface side and not try to mess with the motor-controller side. If not, you'll have to determine whether it's circuitry, flywheels, both, or something else that's holding you back.

    I had thought of trying something like this a while back as well, but haven't had the time or space to try it yet, so I'll be very interested to hear how it works out. I'd love to build a self regulating treadmill for my wife and I!

    As a side note, on the control software side of things, you may want to look into fuzzy logic if you haven't already. I've recently started experimenting with it for the first time and found it to be far, far easier to get the response I want with fuzzy logic than with the PID control I'd otherwise be using.
     
  12. Smyleorelse

    Thread Starter New Member

    Dec 19, 2015
    9
    0
    So that's where I started. I even found the PDF for determining which line on the ribbon was for speed control, and when I tested the voltage on those lines while pressing the speed up/down buttons, the voltage didn't seem to change. I used Pin 5 as the ground and used the red voltmeter lead on pins 6 and 7. I got 5V on pin 6 and 2.56V on pin 7, and they just stayed that way no matter what I did (except when I turned the TM off).

    Is there some trick to testing the voltage to emulate it with the Arduino? Should I just not worry about testing and just see what the TM does when I give it random voltages?

    PS - MaxHeadRoom pointed out the safety feature where the speed has to be set at 0. When I cut the speed input lines, the treadmill just gave me an error, which I assume to be because of that safety feature. I had to reconnect them and leave the twisted ends bare to connect the voltmeter.
     
  13. ebeowulf17

    Active Member

    Aug 12, 2014
    678
    79
    I think you're looking at the wrong set of wires. Look at the very last page of your PDF. That's where the ribbon cable breakdown is, and it looks like most of the clever control system stuff happens before that. If you hack in at the ribbon cable, you've got a lot of circuitry to design carefully!

    The pin numbers you're using from page 15 say they're on J1. Without a schematic I'm only guessing, but I expect that J1 is not the ribbon cable you've been testing. Find J1 and test those voltages again. I suspect you can hook two Arduino output pins up to pins 6 and 7 (probably via relay or opto isolator) and speed it up or slow it down with pulses on the outputs that simulate key presses.
     
  14. Smyleorelse

    Thread Starter New Member

    Dec 19, 2015
    9
    0
    Well, I took the board out and removed the heat sink so that I could trace out the circuits and attempt to get a better understanding of the board, but after reinstalling it, the breaker (on switch) trips back to off when I tried to turn it on. I have a friend selling a more modern treadmill cheap with a board that I've found a lot of info on, so I'm going to switch to that one now that I've broken this one. I'll ask more questions before taking action on that one so that I don't end up with another broken TM. :-/

    Once I get the new one, I'll share pics and documentation for my board and get some advice before I start doing anything. Thanks again!
     
  15. Smyleorelse

    Thread Starter New Member

    Dec 19, 2015
    9
    0
    You're 100% right. On Pg 40 it shows J2 as the ribbon cable. J1 was a clear sheet of plastic with silver conductor embedded in it (maybe also called a ribbon cable?) and that's where I should've been testing. Dangit. Not sure how I made that mistake.

    Well, onward and upward. :)
     
  16. IamJatinah

    Member

    Oct 22, 2014
    70
    14
    Hi There....Your Arduino can connect directly to most controllers but we need to know what maker of TM this came from, and the feedback may be necessary for operation as in Johnson units, pull a feedback line and no movement.
    I may have pinouts you can use to use the controller, but without that flywheel you won't like that treadmill anymore. To regulate faster than intended, you will want to take that roller feedback, into the arduino and manipulate the original feedback stream to a variable you would like to have that controller "react" faster. Regulation is also itself "regulated" to not deliver jarring changes to humans. Overriding this is a bit tricky. DO NOT Connect your Arduino to the Gate of that switching FET, or you will watch much smoke eminate from the arduino, that motor drive rail uses a HOT Rectified Ground, very unfriendly to humans and arduinos ;o)
     
Loading...