Friday, November 29, 2013

“Do you want to build fifty in a basement, or do you…”

On Friday, the 15th of November, a piece of paper was signed which saw my work change hands taking me along with it. I don’t remember what the rest of that quote was from my first telephone call with the CEO that I nervously made from my car in a parking lot. I want to insert something like “change the world” or “change the face of cycling” or maybe it was just a larger number. I walked away from the call a little confused with a lot of thinking to do. I trust and believe in the people at this company.

I truly think this is the best thing possible route for me to take. I didn’t want to be another late and under delivering Kickstarter with production troubles due to my inexperience with outsourcing or marketing. Striking while the iron is hot is hard when you can only dedicated 15 – 25 hours a week to something and maybe a few hundred dollars a month.

As for the blog, it will remain (no posts will be deleted) but it will stop any further documentation of the development as it’s going to be under a commercial entity. There is going to be a major design change, and the final product will look nothing like what I’ve developed and conceptualized.

This is a super exciting time and I’d love to explain the new and unique ideas on the table or just how we think we can shake things up. The people I’ve met truly feel very like minded, and in a the few days with them I felt like part of the team even though we were just in the initial phases of talking.

Below are a few imaginary FAQ question about the situation and general explanations.

Monday, October 21, 2013

Cheap Arm Programmer

DSC_9764
So you have a custom ARM Cortex-m0 (or other) board you want to program. Perhaps, like me, it’s a custom board using Nordic Semiconductors nRF51422/822/922. You may have bought an Evaluation Kit with a built in J-Link debugger. However, once you move to a custom board you now face the problem of programming it.
I bought both the nRF51422-EK and nRF51422-DK. Each kit was $100 USD. The EK did what I wanted, the DK “requires” the nRFgo development kit which is $400 dollars. What you might not know is that this board provides only power and the nRF51422-DK comes with a Segger J-Link lite. The J-link Lite is what I’ve been using to program my custom boards. I think $100 dollars for a programmer is ridiculous. My AVR was $50 dollars and that allows me to do everything.
Enter CMSIS-DAP. It seems this is intended to add debug functionality and firmware updating to embedded applications but looks like you can use it as a standalone programmer without any restrictions (like with the J-Link EDU; Cost effective but limited to Educational).
So pick yourself up a $14 Freescale Freedom FRDM-KL25Z. Cheaper than an Arduino and way more powerful with a 3 axis accelerometer, a tri colour LED and a capacitive sensor. It has two microcontrollers – the main one and a little one running OpenSDA. With OpenSDA you can load up a CMSIS-DAP firmware from Freescale and program other boards. Credit to www.mcuoneclipse.com for the idea

Here is how:
  1. Cut J11 Trace. This disables programming the main KL25Z microcontroller.DSC_9767
  2. Install a 1mm pitch, 10 Pin header at J6. Little bit difficult to solder due to the fine pitch.DSC_9766
  3. Break Pin 7 off – This is the Key pin. This isn’t needed if you don’t have a blocked pin on your ribbon cable. DSC_9770
  4. Hold RST while plugging it in. This loads it into OpenSDA firmware upload mode.DSC_9768
  5. See a new drive image
  6. Download Freescale Quickstart here and copy CMSIS-DAP_OpenSDA.S19 to the Bootloaderimage
  7. Unplug and plug back in. Now Freescale is in CMSIS-DAP mode.
  8. Connect your custom board DSC_9763
  9. Set to CMSIS-DAP (I’m using Keil) image
  10. Switch to SW programming and not JTAG image
And now you can program. The one caveat is that it won’t autoreset my board. I have to disconnect.
There are other firmwares for programming but they are locked to Freescale Devices. The CMSIS-DAP isn’t. The trade off is that you lose the Serial to USB lines on the OpenSDA programmer. Oh well.

Saturday, October 19, 2013

Random Trip to Alberta

AB Ride

2013-10-06 11.05.342013-10-06 11.05.56
As some of you may have read, I recently travelled to Alberta and I got to take my bike with me. Everyone had talked to me about riding from Canmore to Banff, but having seen the drive to Canmore from North West Calgary, it was a bit of a longer round trip plus I had to go Karting later that afternoon. A lot more after the break. Less powermeter, more adventure stuff.

Thursday, October 17, 2013

More on Accuity + Quarq

image

After spending a few nights dealing with the required decoupling math for the Quarq + Accuity unit I’m still not 100% there. I feel I’m 95% there, but something is eluding me.

The right measurement is dead on, within 1-3% of the Quarq.

The left measurement is another story ranging from 5 – 8% out.

What I thought was the original issue was due to the non-integrated spider and that I didn’t place the shear strain gauge deep enough down the hole. As a result it can see some of the stain caused by the torque on the right arm in the left sensor. A few ways of dealing with this:

  • Reinstrument with another strain gauge (about 3 evenings of work)
  • De-coupling Math (in theory short, but probably 3 evenings of work… to get right)

Essentially the math works by calculating the torque on right arm from the right strain sensor setup, and then subtracting that small percentage from the left arm. How much are we talking?

For every 1 N-M on the right arm, I can see 0.0075 N-M on the left arm. I messed up the math earlier which caused each arm to work nicely independently but together they didn’t work right which resulted in a significantly reduced measurement of power and the balance skewed 100% right.

Now that this is all sorted I have the problem that the Left sensor is reading low, both independently and concurrently. I can artificially dial it into the Quarq but I don’t believe that is the correct thing to do.

Question I’m trying to determine. Could the loss of torque due to the bottom bracket bearings be affecting the calibration? Would the Quarq have been calibrated for each side and then averaged? Am I missing something?

I was checking for force sensitivity due to twisting the arm and at best I could muster was adding more force, not losing it.

Other things of note

The small Sunnto style m-ANT (tiny) stick DOES NOT WORK with the old .NET libraries. You need the latest ones! Having realized that I’ve started using my double powermeter recording software with an AP1 or AP2 usb stick. I dislike how it sticks out on my laptop though. I think I just need to replace a .DLL file but haven’t tried it.

To summarize:

  • Carbon fibre remaining linear; multiple calibrations resulted in nearly the same numbers (18.62 versus 18.82 bits/N-M) with multiple points.
  • There is some permanent strain in the carbon caused somewhere between flying it from ON to AB. Didn’t affect calibration really.
  • Bad decoupling math was the problem with it not functioning correctly in AB and resulted in swapping to my Aluminum Rival Crank which still works very well.
  • Still investigating the small percentage difference between prototype and Quarq
  • m-ANT stick requires new libraries for .NET development
  • Samsung commits to ANT+; At least on flagship
  • If you have an idea on why my calibration might be off write me here

Personal notes: I wish that the Nexus 5 will be reasonably priced and have ANT+.

Tuesday, October 15, 2013

Short Break–Back Very Soon

There have been a lot of things going on in the background which has prevented me from posting anything for the last few weeks. I’m currently refining the Quarq + Accuity unit. It’s working well but there are some force sensitivity investigations that I want to conduct and I might want to reinstall the left leg sensing strain gauge.

Upcoming potential posts

  • Carbon, carbon, carbon – the good and bad. Surprisingly little bad thus far.
  • My interview with Auto21 which funded my Masters research. Canadian Automotive research at it’s finest
  • Potentially a biweekly podcast with some other good folks interested in cycling and power (still working out details).
  • Strain gauges and some issues
  • Trip to Alberta – Less bike related and didn’t make it to the ANT+ symposium but some fun things to do in AB. Must cycle Banff and Canmore next time. This time was just outside Calgary area cycling. Also, Go-Karts.

Monday, September 30, 2013

Quarq or Accuity


Quarq or Accuity? Guess which is which.

Testing right side then left side!

Close, almost perfect. Going back to check calibration data. This one requires some "Decoupling" math which I'll get into when I do a serious post soon. Very very busy week.

Friday, September 27, 2013

Quar-ccuity (or Accuiq?) and ANTride

DSC_9660

Quarq + Accuity

The Quarq + Accuity crankset is almost ready. Major changes since the Rival based version include:

  1. Zero offset (or “calibration response”) programming has had a major change. Rather than a separate function that takes over control temporarily, it uses the existing code in the main body read the strain gauges. This probably sounds unimportant, but it’s the result of a peculiar issue where current drain was increasing when I tried to zero only the right side. By leaving it to alternatively read left then right sensors like it normally does it maintains currrent draw as is.This improves stability and how “clean” the code is. I think this is the result of the higher impedance wiring used combined with a capacitor issue. Either way, this makes the system more robust over the usable voltage of the battery.
  2. When you use a cycle computer to tell it to Zero offset (or “calibrate”),  it reads back the offset (eg –417 when I zero my Quarq Cinqo). Unlike Quarq, which translates this value to 1/32 N-M, mine is left as the raw ADC values. I’d be surprised if Quarq isn’t doing this as well and it just happens to be “about” 1/32 of a N-M. For this Accuity build each value is 1/20.26th of a N-M for the left and 1/17.50 of a N-M for the right.
  3. This Build uses a different strain gauge setup for the right leg compared to the Rival unit. The S900 crank is using the actual intended setup that was intended for Accuity and not re-working the existing setup of V3. V3 was more sensitive setup, but it’s a pain to wire and difficult to integrate the setup into the board without some lead wire resistance mismatching.
  4. Detection for when the rider has stopped pedalling gives better / “cleaner” restart values. It’s still not perfect, but it generally doesn’t interfere with data. David Johnstone over at cyclinganalytics.com has been picking apart my L/R data and pointing out an issue that the values go to 100% left value when you resume pedalling. I haven’t fully nailed this down but I’m almost there (I think).
  5. Reduced power consumption. The Rival crank has a different voltage drop resistor and received the power from the battery directly. Now the strain gauges are powered from the 2.048V linear regulator on the ADS1248. That’s a 1 volt drop plus the same 750 ohm in line resistor. The strain gauges are operating at less than 0.5V. This is important because in the planned sleep mode (ie: not riding) it can turn off the strain gauge power supply.

The next major step (to hopefully happen Sunday) is doing my initial indoor tests. Kurt pointed out to me via twitter that I could use the small cup cone on the lever skewer. I didn’t trust it when I got the trainer so I swapped it. I’ll carefully try it. I’m not 160lbs climber. More Clydesdale.

ANTride

This isn’t really a real name. I’ve had a lot of traffic thanks to Ray over at Dcrainmaker.com due to tweeting in response to the Muin review. He linked to a short post (here) asking for feedback on his week end review.

DSC_9658

What is ANTride? The short explanation is that cycle trainers are predictable devices. Things like TrainerRoad and the Lemond trainer have taken advantage of this to create “virtual power”. This is the indoor equivalent of what iBike tries to do outside. Kurt built the inride as an application of their regression curve for average power on their site. However, they were very clever having already tried a basic cycle computer before – they incorporated a spin down test to to measure acceleration and possibly rolling resistance to increase the accuracy. As you can see from the review there are a few people asking about ANT+ since it’s a BTLE only device.

If you’ve used a powermeter then you know that outdoors it can be tough to dial in on a number and hold it since there are so many competing factors such as wind, hills, other riders, etc. Eventually you get better at this but it takes a while. On a trainer this is much easier. If you already own a powermeter then there isn’t a point to this device. If you don’t own a powermeter, or one is out of financial reach than this can be an attractive option to a lot of people. Off season training means training with power.

Why build this if you can indoor train at a computer using a speed sensor. A few reasons.

  • You want to capture that data to your ANT+ cycle computer
  • You don’t train in front of a computer (Garage, basement, spare room, etc)
  • Improved accuracy

That last one is something that Inride does well at a fraction of the price of a direct force power meter. However it comes at a price. Location. In order to determine the acceleration of a wheel accurately a simple magnetic switch sensor doesn’t cut it. This means that none of the Speed interpolators can have that level of accuracy. That is why Inride senses at the roller. It’s higher speed means it can detect accelerations much more accurately.

So going forward there is a choice here. I can achieve the same accuracy as Kurt Kinetic Inride putting it within 2% of a real powermeter but only if I can get more accurate measurements of acceleration. This is where people might say that “all hope is lost”. Hold tight.

There is another way to pull this off with very good accuracy. Enter the MEMs gyro. I discounted this for the powermeter (though I’m thinking about it again, mainly in terms of wanting to offer every possible feature out there at a fraction of the price – and a high speed mode will need it). A gyro attached to the wheel can provide very accurate information.

I’m going to test the magnet sensor on my kurt kinetic and see if I can make the calibration work.

I’m low on available development time so I’m going to think about this some more. In the meantime feel free to leave a comment or email me at kwakeham@gmail.com.