That moves both gears that are above each other, my gears are ~4’ apart & the front gear derailer is top mounted, and the rear is bottom mounted, but the funny thing is we both watch Thang010146! .
I’ll play with CAD and see what I come up with, the front gears are straight forward, but because of the huge difference between rear sprocket sizes/chain tensioner travel I’m going to need something ingenious!
More measurements needed
Here is a simpler one, a bit easier for me to understand (once I set Youtube speed to 0.25!). The top slider is the input linear motion. The bottom is the output linear motion. When the yellow pivot point on top is adjusted higher (further away from the input slider), the output linear motion is not amplified nearly as much as when the yellow pivot is in the lower position.
This would be used only for the linear servo that needed to be made larger, from 27mm to 54mm.
the length of the linear servo for the rear, just got a whole easier, and simpler!
The rear derailleur actually only moves 27mm to cover the entire range of the gears, so all I need to do is connect the linear servo motor to the actual cable stop, and use that, and we get linear electric shifting front and rear
and just measured the front derailleur cable stop movement, and that is the same, so anyone wanting electronic shifting only needs to connect the linear servo motor to the cable stop bolt, and run the simple arduino coding as Mitch has calculated, and they’re cruising for well under the $1800 Shimano $$$
Great news. Simpler is better! The speed of the servo is acceptable? 26 mm in 0.72 secs seems good.
Your chain needs time to change sprockets anyway. I doubt <1sec to go from one extreme to the other is going to be an issue. I suppose if you are racing, it could become an issue when switching the front sprocket & having to move the back sprocket from one extreme to the other…you might have to ease up on the peddles for more that 1/2 second…
Due to the lengths of my main chain, ~1-1.5m from front to rear & return, I don’t have the issue an upwrong bike has, going big to big/small to small.
I actually need 3 chain tensioners to make all the gears work, one as the rear derailleur, and 2 tucked up under the seat, doubling up as chain guides.
To connect the linear servo motor to the derailleur cable pull bolt, you only need to clamp/solder a 3mm bolt into one of these electrical connectors, and everything gets connected nicely together
So the decision to go to electric gear shifting has been made, the parts sourced, and soon to be bought, the question is now;
How does XOD get Arduino to do the circuity bits to allow Electric Gear Shifting (EGS)
Here is table that shows the increase in Gear Inches(GI)
The second column from the right is the one that shows gear position of front gears
This is my steering wheel, I think there is a small bit somewhere that I can put an extra switch or two
A semi side view, need to check if all the labels are actually current, think some of them got changed to simplify things when the steering wheel was made into a mechanical steering wheel, not an electric steering wheel
If I understand this properly, you would use two 29 input nth-input nodes as lookup tables, one for the Front gear index and one for Back gear index, each selecting one of 29 (0th is skipped) numbers, like the one used for Gear Ratio in the “Bike Gears with Motor” project.
I would then use 4-input and a 7-input nth-input nodes for the front and back index to servo position tables, respectively. This would let you easily re-trim the beginning and ending positions separately. These four nth-input nodes could be descriptively named:
I. SetNumberToFrontIndex which would effectively be the G-1 column
( for 24, 36, 46, and 52), with the values for the 29 input nth input nodes actual data entries being:
0, 1, 1, 2, 3, 2, 1, 4, 1, 1, 3, 1, 4, 2, 1, 2, 2, 3, 2, 3, 4, 3, 2, 4, 3, 4, 4, 3, 4
II. SetNumberToBackIndex which would effectively be the G-2 column
( for 14, 16, 18, 20, 22, 34, 44 ), with the values for the 29 input nth-input nodes being:
0, 44, 34, 44, 44, 34, 22, 44, 20, 18, 34, 16, 34, 22, 14, 20, 18, 22, 16, 20, 22, 18, 14, 20, 16, 18, 16, 14, 14
actual data entries being:
0, 7, 6, 7, 7, 6, 5, 7, 4, 3, 6, 2, 6, 5, 1, 4, 3, 5, 2, 4, 5, 3, 1, 4, 2, 3, 2, 1, 1
III. FrontIndexToServoPos ( the 4 linear servo positions for G-1 A, B, C, D)
IV. BackIndexToServoPos ( the 7 linear servo positions for G-2 1-7 )
Then the user’s gear number then is looked up in I and II to get the Front and Back indexes. Then those indexes are looked up to get the Front and Back servo positions.
Then those positions are simultaneously set and the Front and Back immediately change the proper positions for Front and Back.
If the servo positions are all equally spaced (as should be for a linear servo and equally spaced sprockets), one need only set the first and last values in table III and table IV and linearly interpolate the two in between entries 2 and 3 for table III and the five in between values for entries 2, 3, 4, 5, and 6 for table IV as previously described.
If servo positions really are equally spaced, you can use “map” to convert from gear to servo position. Source min/max will be gear, Target min/max will be servo position of lowest & highest gear.
Before I try and get the electric gear shifting bit working, how do I insert the Hall effect sensor, or whatever it is called into XOD, so that the motor calculations only show up if the motor is getting power/rpm?
With these bits?
Ok I was able to transcribe the above two response into this, but now how do I connect in the linear servo motors and tie it back to the gear position index?
You are using the Hall sensor to count revolutions? If so, you will not be able to use it directly to control the display. It will be on when magnet is near sensor and off all the other times. If you are counting revolutions, you will probably need to use interrupts to get an accurate count; I don’t have any experience with that.
Digital-read is going to return 0 or 1. If you tie that to the motor SPD, it means the motor is either on or off, you will not be able to control the speed. If the digital-read is your rpm sensor, you do NOT want to tie that to your motor-SPD pin; it will only turn on when the wheel is in one specific position. I have no idea what you are trying to accomplish sending a DONE pulse to an if-else node…
I assume you really want to display motor info whenever the motor is getting power (whenever motor-SPD is greater than 0), though there is the chance that a low power setting for the motor might spin the motor slower than what the speed of the crank is already going.
To change the output display based on motor condition, probably the easiest solution is to put an if-else just in front of the LCD node. If speed of motor > 0, then display concat with motor info, else display “Off” (or some other string to show motor is off).
For each derailer, you will use two nth-inputs OR an nth-input and map. There is no reason to use two nth-inputs and map.
Smin/Smax will be the low/high of gear you are selecting. Tmin/Tmax are the servo positions for low/high gears.
The two nth-input nodes will work for any servo values needed for each gear (but you will need to manually input each position). The map will only work if servo position is equally spaced for all gears.
Note that if you are using servos to set each gear, you shouldn’t need sensors to determine which gear you are in…you can assume it is in the gear servos are set for (unless you really want the extra hardware/code to confirm actual gear).
Thanx gweimer, I really do appreciate your help.
Give me a mudmap, a hacksaw, a welder and a grinder, and I can do my best to make a decent rendition of the mudmap:smiley:
Give me circuit tech terms and I’m , but I’m slowly learning.
As the motor is independently controlled, you’re correct in the fact I only want the LCD showing if the motor is on/off to start the display “process”, followed by displaying the actual SPD of the motor if >0.
Which brings me to my next question, which I did ask right up near the top of this thread.
Can I use IR sensors, Rx and Tx modules as separate bits, to shoot through a single hole in the chainring to give me both my motor speed and pedal cadence?
If so, what circuit/XOD bits do I use?
Yes, it should be possible to measure cadence by counting revolutions. The issue is that you need an accurate count, so you probably need to tie the sensor to an interrupt pin so that each “hit” is counted even when the Arduino is busy doing other things. I don’t know how to do this, so I can’t help with it. The only sample interrupt I know of that already exists is the “delay” node, but it uses an alarm, not hardware interrupt.
You will also need to track how long it has been since you last checked cadence (and either reset count, or also log count at that time). Each time you check cadence, you will need to divide count by time since that count was started (and reset count & record new time). If you try to check cadence too often, there may be too few “hits” on the sensor to get an accurate measurement; checking every 3-5 seconds might be a good compromise between real-time and accuracy.
Regarding the nth-input vs equal spacing, gweimer gave a XOD example of what I mentioned only in words.
I think cadence can be measured very precisely and easily and is even best with a single sensor. It can be a Hall effect or a pickup coil, very much like bike cyclometers. Using a system-time node triggered by each revolution of the pedals and then a diff-time between the previous and the most recent system-time, one gets the difference in seconds, the period for one revolution. A divide node directly gives you the cadence as
pedal RPM = (1 / seconds). This is how heart rate measurement devices give you a quickly changing BPM.
It can also be done, and perhaps more easily, with a delta-time node which takes in pulses and gives you the delta time (period). That may be what gweimer was referring to. It looks like for a continuing pulse string like a pedal revolution pickup, the reset is done only on startup.
Also doing it by measuring the period and taking the reciprocal (1/period) will give you a cadence update every 1-2 times per second (for a cadence of 60 to 120 RPM). That seems fine to display. It will be perfectly accurate and not too fast to read. If you want to slow it down, you could always add the periods for every 2 updates and divide by 2. In any case the display should have perhaps only one digit past decimal point, i.e. 67.2 … 73.1.