Monthly Archives: January 2013

Some thoughts on motors

A basic requirement for this project will be to accurately adjust the trainer resistance cable throughout its range of motion. (Time will tell how accurate we can get!). As a starting point, there are probably three viable options for moving the cable – a hobby servo, a DC gear motor with leadscrew, and a stepper motor with leadscrew.

Option 1 – Hobby Servoservo

For: Simplest mechanical build, positional adjustment directly from a microcontroller (no driver IC circuitry), reasonable accuracy and resolution.

Against: Will always be pulling against the load, so likely the highest stress on the motor and bearings. Need to convert angular to linear travel.

A standard hobby servo (commonly used in RC planes and cars) provides angular positional control of a movable arm or linkage, commonly over an angle of around 180 degrees, and with a minimum resolution of <1 degree. The torque of hobby servos is rated in kg*cm, so for instance a 4kg*cm servo would be able to move a load of 4kg at a distance of 1cm from the axis of the shaft. In our case we need to produce a maximum load of 5kg, over a travel of 30mm. As a rough estimate, we can get this travel from around 120 degrees rotation, at an arm length of 16mm. This would require a minimum torque of around 7.5kg*cm.

servo_anglesWith the cable attached directly to the arm, we also need to calculate the required angular position for a given linear motion along the x-axis. In the diagram to the left – the arm will need to rotate further to achieve the same linear travel as it moves away from the y-axis. Knowing the the total travel along the x-axis, and the proportion required, we can calculate this from the arcsin of a unit circle. (Is worth noting that there will also be some inaccuracy introduced as the point of attachment moves off axis in relation to the cable outer fixing. However, the length of the servo arm is small compared to the distance from the cable mount, so this angle will be quite small and will be ignored for now). These calculations would be greatly simplified by attaching a pulley or wheel to the servo, and running the cable around the outside. Unfortunately the cable is a bit thick for this bend radius, but could be attached to the pulley via a thinner wire.

Option 2 – DC Gear Motor & Ledc-gear-motoradscrew

For: Using a leadscrew means less strain on the motor (especially when holding a static position)

Against: H bridge or driver IC required, likely to be a more complex mechanical build, unlikely to have built in positional sensing.cover

A DC motor rotates when power is applied, reversing the polarity of the power will reverse the direction of rotation. A DC gear motor is a common form where the output of the motor is transmitted through an integral gearbox before reaching the output shaft.

To achieve linear movementleadscrew1, a leadscrew can be coupled to the motor output shaft, whereby a nut is moved up and down the threaded shaft as it spins. Although this assembly introduces an amount of friction, it does have an advantage that it will tend to be self locking when stationary.

A commercial lead screw has a different type of thread to a standard threaded rod (for reduced friction), but the parts are more expensive, so standard v-threaded rod is sometimes used in small DIY projects.

This complete arrangement of motor and leadscrew is known as a linear actuator and can be bought commercially (greatly simplifying the mechanical build), however in almost all cases, the cost would exceed our entire project budget.

To track the rotation of a DC motor, it is common to use a shaft encoder of some type. These provide a specific number of logic output pulses per rotation. Another alternative would be a linear potentiometer to measure the position of the nut on the leadscrew.

Option 3 – Stepper Motor & Leadscrewstepper

For: Best accuracy, using a lead screw means less strain on the motor (especially when holding a static position)

Against: H bridge or driver IC required, likely to be a more complex mechanical build, most bulk/weight (but not really an issue for this project).

A stepper motor provides positional control of rotation, usually at 1.8 degrees resolution, or 200 steps per revolution. Just as with the DC motor, a lead screw can be coupled to the shaft to achieve linear movement. This solution gives great accuracy, with 200 steps for each pitch of the thread. Again, complete linear stepper assemblies can be bought, and again would almost certainly blow the budget.

First Prototype

Doesn’t get any simpler than this!

proto2The resistance cable is directly attached to the servo arm, and we can use use a bit of remedial maths to calculate the required arm angle for a given linear position of the cable.

This servo wasn’t powerful enough for a full range of motion (the force on the cable increases as the spring in the resistance unit is compressed), but was sufficient to get things started and verify the maths.

A more powerful servo is in the post, and I have a few DC and stepper motors in my parts drawer, so plenty of scope for more experimentation..

Next post will mostly cover software, microcontrollers, and adding rudimentary device support to Golden Cheetah

The turbo trainer

As the resistance of my existing fluid trainer (an Elite Crono Fluid) is dependant purely on speed, I’d need another trainer to base this project on. I briefly considered an eBay cheapie, but thought it was unlikely to be a satisfactory experience, even before getting to any modifications.

So looking for a mid-price trainer with a cable operated resistance lever, I settled on the Tacx Blue Motion 2600. This trainer has the new frame design from the Blue series, but uses the same resistance unit as found in the older Satori model. I managed to pick one of these up for £135 shipped.

For what they’re worth, my initial impressions of the Tacx after a quick spin are;

Good – Smooth. More flywheel weight than the Elite. Stable. Probably a bit less flex in the frame.

Bad – Manually adjusting the roller pressure (I prefer design of the Elite, where rider weight provides the pressure on the roller). More tyre slip (vs the ElastoGel roller on the Elite). Noise, not sure whether it’s actually any louder, but it sounds a bit rattly.

Next up, taking it apart…lever2

There were no obvious screws around the resistance unit, but the lever assembly dismantled relatively easily. After removing the resistance lever, and using a small screwdriver to prise the black cap off, the cable nipple can be pushed out of the slide, and the whole cable pulled free. The original 10 steps of resistance are a factor of the handlebar lever.

Google turned up some useful information and photos for dismantling the resistance unit, but I haven’t needed to do this yet. The pictures linked from the above forum posting show how the sprung loaded magnet slides out from the centre to the edge of the flywheel.

Next step was measuring the travel of the cable and the force required to move it. Full adjustment required 30mm of cable travel, and a peak force (at maximum extension) of about 5KG. Ok, kilograms aren’t a unit of force, but are hopefully more intuitive than Newtons!

Next post will cover thoughts on motor selection, and a first prototype.

The beginnings

Like many cyclists in the northern hemisphere, I find myself stuck indoors on a turbo trainer at this time of year.

Trying to follow a more structured training program (and partly to relieve the boredom!), I’m doing more interval training, and using the occasional Sufferfest motivational video. With my existing turbo trainer, it’s just a question of using the gears to increase/decrease the resistance as required.

While spinning away one day, I got to lusting after an expensive computer controlled ergotrainer (where the resistance is changed automatically according to a workout file), but no way I could really justify the price to myself.

So an idea was formed. Could I adapt a basic magnetic turbo trainer (with manual adjustment lever), into a computer controlled ergotrainer? And for bonus points, hook it up to the real-time training view of the excellent open source Golden Cheetah analysis software?

I’ve set myself a hardware budget of £50 (on top of the trainer), and am aiming for weekly progress updates to this blog (to maintain momentum for the project). All hardware designs and firmware will be released under an open source license. Follow along if you’re interested to see where this goes next..