Note de ce sujet :
  • Moyenne : 0 (0 vote(s))
  • 1
  • 2
  • 3
  • 4
  • 5
Attempt at cheap homemade version of Harmony
#21
What happened to the Arduino? Toasted?
-
Si ça a déjà été fait, je peux le faire
Si ça n'a jamais été fait, donnez-moi juste le temps de trouver comment !


Répondre
#22
That's a good question I have no idea at the moment. I was just riding along and suddenly it stopped shifting. The Uno has been running fine since. Apparently if an input voltage is higher than the power supply to the Arduino it can damage the chip. That's not possible with my setup as everything is supplied from the Arduino's 5V supply unless its coming through the servo somehow. Seems unlikely and would only be a problem if the Arduino's onboard regulator failed. It was a cheap clone Arduino so it may just have been a bad one. I've just bought a pack of 5, should keep me going for a while.
- Oran
Répondre
#23
Update on range with the increased shift update speed. I managed about 20 miles short of 200 so the range has been reduced by about 10%. Not as much as I expected. I suppose the servo isn't really moving much more its just doing it in twice as many smaller steps.

To make the Arduino easily replaceable I have used some old ribbon cable to make a socket.
[Image: WP_20160716_002_zpsvtdrrvaz.jpg]
By grouping the wires into pairs it gives a second position for each row of pins on the Arduino. This also makes it possible to temporary connect to an Arduino pin by using the second row in the socket.

Here's a circuit diagram I used to get the 9pin connecter wired up right. Will make it easier to understand the setup I'm using.
[Image: NV%20auto%20shifter%20curcuit%20diagram_zpsr5tvftvn.jpg]
- Oran
Répondre
#24
Here's a video of the auto shifter functioning nicely out on the road.


- Oran
Répondre
#25
Love the transparent shift box!
You really are imaginative!


- Normand Nadon,
Via TapaTalk mobile
-
Si ça a déjà été fait, je peux le faire
Si ça n'a jamais été fait, donnez-moi juste le temps de trouver comment !


Répondre
#26
Thanks Normand
I thought I would make an effort as I get to leave the bike out at the visitors centre where I volunteer. Apparently people had been seen looking at it with much confusion. QR codes are used around the centre so I created one with a link to this page.
- Oran
Répondre
#27
Here's a screenshot of the Arduino code I'm currently using, I keep making minor alterations and improvements. It looks like a lot of code but two large sections of it I haven't written. They are the reed switch timer code originally meant to be used as a cycle computer. The other is servo control using timer2 as timer1 is tied up with timing the reed switch. The library code for servo control uses timer1.

The most important line of code is this one servopos = constrain (((val) + (100 + (Wheel x 20))), 540, 2450);
The constrain function sets the limits on under and overdrive. This should be adjusted to suit the servo in use. In my case its 540 and 2450. Val is the potentiometer and allows adjustment of cadence. Wheel is the output of the reed switch timer, it can be adjusted to feed directly into this function. The multiplication by 20 allows me to add in the derailleur position value to the reed timer code. The offset of +100 determines when the hub starts to shift as to bicycle starts to move from a stop. A value of 540 means it will start immediately which can compensate for a lag in shifting due to acceleration and load on the hub. In practice its too much and results in a low cadence when going slowly up hill.

[Image: NV%20auto%20shifter%20code%20ss%201_zps8os6mgzr.jpg]
[Image: NV%20auto%20shifter%20code%20ss%202_zpslmdpgswq.jpg]
[Image: NV%20auto%20shifter%20code%20ss%203_zpsq5lhhjv6.jpg]
[Image: NV%20auto%20shifter%20code%20ss%204_zpsfoho9okh.jpg]
[Image: NV%20auto%20shifter%20code%20ss%205_zpsmn0bzz7s.jpg]
[Image: NV%20auto%20shifter%20code%20ss%206_zpsnwnglvrx.jpg]
[Image: NV%20auto%20shifter%20code%20ss%207_zpsqg1jxw00.jpg]
[Image: NV%20auto%20shifter%20code%20ss%208_zpstdpwz74g.jpg]
- Oran
Répondre
#28
I'm beginning to experiment with data logging to further improve the performance of the auto shifter. I have successfully got a data logging shield on a separate Arduino Uno to log the potentiometer output, mode switch, derailleur position, and speed. Speed is logged by running the cycle computer code on the data logging Arduino. Next I want to get it running 2 cycle computer codes one for speed and the other for cadence. If not I will get the main Arduino to output a voltage proportional to the speed on a spare pin.

Two things I want to do, first is see if I have a range of preferred cadences. I don't like having to find the right cadence by adjusting the pot, I would prefer to have buttons with pre-set cadence's. Depends on whether my perfect cadence varies from day to day.
Second is to compare measured cadence with the potentiometer value. This will reveal how good it is at maintaining the correct cadence. It will also tell me how close I am to getting the relationship between wheel speed and ratio correct.

An example of some of the data I'm getting from the logger. Not sure why the potentiometer value is so irregular when the derailleur switch is off.

[Image: Auto%20shifter%20data%20graph_zpsaoeje2t2.jpg]

As I do more miles this graph will develop.

[Image: Sum%20of%20Cadences%2016_10_2016_zpsnv3jfcil.jpg]
- Oran
Répondre
#29
You have the arduino bite!

I don't get your cadence thing... Shouldn't the cadence vary depending on the terrain?

Envoyé de mon SAMSUNG-SGH-I747 en utilisant Tapatalk
-
Si ça a déjà été fait, je peux le faire
Si ça n'a jamais été fait, donnez-moi juste le temps de trouver comment !


Répondre
#30
I don't fully understand it yet either, it appears that my cadence doesn't vary as much as I thought. I think it's partly because I tend to be lazy and let the bike do its own thing. I definitely vary my cadence when shifting manually. This is a graph of todays commute which shows much more variation.

[Image: 19_10_2016%20cadence%20graph_zpskzbqhiuv.jpg]

Once I start logging my actual cadence it might become clearer as to what is happening. At the moment this is just a record of the potentiometer position.
- Oran
Répondre


Atteindre :


Utilisateur(s) parcourant ce sujet : 1 visiteur(s)