Connecting a Cycle Analyst to a Castle Creations controller

Get all your technical information about electric bikes here.
Post Reply
User avatar
ElliottE   100 mW

100 mW
Posts: 36
Joined: Apr 27 2012 11:42pm
Location: Spokane, WA

Connecting a Cycle Analyst to a Castle Creations controller

Post by ElliottE » Sep 03 2014 1:23pm

Hello everyone,

I'm in the final stages of assembling my second e-bike prototype, and I'm currently trying to get everything all wired up. This design uses a Cycle Analyst V3 with a Grin Tech shunt, and I want to connect the shunt to a Castle Creations HV160 controller. The Grin Tech shunt has three small wires that (I believe) are intended to connect to the controller, these are green, yellow and black. The Castle Creations HV160 controller has three small wires that (I believe) are intended to connect to the shunt, those wires are orange, red and brown.

My best guess at the moment is to connect it as follows, and I will include what I think these signals are:

Green > Orange (Control / Throttle signal)

Yellow > Red (+5 volts)

Black > Brown (Ground)

If anyone out there has any information regarding this, your input would be greatly appreciated.

Elliott

User avatar
ElliottE   100 mW

100 mW
Posts: 36
Joined: Apr 27 2012 11:42pm
Location: Spokane, WA

Re: Connecting a Cycle Analyst to a Castle Creations control

Post by ElliottE » Sep 03 2014 2:22pm

I've been searching repeatedly, unfortunately I'm not finding any threads that address my particular question. If anyone would be kind enough to provide a link, it would be greatly appreciated, apparently my search-fu is weak.

User avatar
ElliottE   100 mW

100 mW
Posts: 36
Joined: Apr 27 2012 11:42pm
Location: Spokane, WA

Re: Connecting a Cycle Analyst to a Castle Creations control

Post by ElliottE » Sep 03 2014 3:19pm

Hello amberwolf,

Thank you for those search links, I'm checking those out now. In the meantime, being as a picture is worth a thousand words and all that, here's some pics of what I'm working with:

Image
Cycle Analyst V3

Image
Grin Tech shunt

Image
Castle Creations HV160

Image
Another piece of the puzzle. This is a CastleLink USB connector, connected in such a manner that it communicates with the controller. Note the wires and the corresponding signals indicated on the CastleLink.

Image
Prototypes 1 and 2 (prototype 1 is in the background)

https://www.youtube.com/watch?v=I-5eys9y2bo

Here's a link to a YouTube video of prototype #1 being taken out for a ride up and down a good-sized hill.

User avatar
teklektik   10 GW

10 GW
Posts: 4020
Joined: Mar 26 2011 1:15pm
Location: CT, USA

Re: Connecting a Cycle Analyst to a Castle Creations control

Post by teklektik » Sep 03 2014 4:53pm

ElliottE wrote:This design uses a Cycle Analyst V3 with a Grin Tech shunt, and I want to connect the shunt to a Castle Creations HV160 controller. The Grin Tech shunt has three small wires that (I believe) are intended to connect to the controller, these are green, yellow and black. The Castle Creations HV160 controller has three small wires that (I believe) are intended to connect to the shunt, those wires are orange, red and brown.

My best guess at the moment is to connect it as follows, and I will include what I think these signals are:

Green > Orange (Control / Throttle signal)
Yellow > Red (+5 volts)
Black > Brown (Ground)
I do not have specific experience with your ESC - however:

Presumably you are powering the ESC via the CA-SHUNT 'CTRLR' power leads.

As I understand things, the CC EDGE HV 160 has no internal BEC and requires an external BEC for ESC operation (specifically the red receiver wire must be tied to the BEC). You can verify this by powering the ESC via the shunt and using a DMM to measure the voltage on the red receiver/USB ESC cable. You should not find +5v there (no BEC). The brown receiver cable wire and primary black ESC power lead should both be connected within the ESC and so be at Gnd potential.
EdgeHvEscWiring.png
EdgeHvEscWiring.png (16.61 KiB) Viewed 2026 times
Based on that, you will need to provide +5v BEC functionality via the CA3 by re-wiring the CA PCB and re-purposing the CA3-SHUNT breakout cable yellow wire according to Section 4.2.1.5 "Installation with RC Electronic Speed Controller (Normal Mode)" of the Guide.

Having done that, your proposed hookup looks exactly right.

The Guide is light on description for ESC setup, but mentions relevant settings as they are needed during the installation section. In particular, you will need to ThrO->OutptMode = R/C Pulse. Section 5.3 "Ebrakes" also mentions a possible adjustment to ThrO->BrakeOut if your ESC balks at zero-width PWM on the throttle lead.
Last edited by teklektik on Sep 03 2014 9:06pm, edited 1 time in total.
Visit Grin Technologies at www.ebikes.ca
Build Thread: 2WD Yuba Mundo V4

User avatar
ElliottE   100 mW

100 mW
Posts: 36
Joined: Apr 27 2012 11:42pm
Location: Spokane, WA

Re: Connecting a Cycle Analyst to a Castle Creations control

Post by ElliottE » Sep 03 2014 8:30pm

Thank you teklektik for that information, it is greatly appreciated.

Elliott

User avatar
ElliottE   100 mW

100 mW
Posts: 36
Joined: Apr 27 2012 11:42pm
Location: Spokane, WA

Re: Connecting a Cycle Analyst to a Castle Creations control

Post by ElliottE » Sep 05 2014 2:12pm

Just FYI to anyone interested, I now have my CA V3 updated and working with my controller and motor, just got the motor to light up and spin. Next step is to do a couple of more things on the e-bike, and then I can install the motor and take my first test ride. I'll post pictures when I do.

Elliott

User avatar
teklektik   10 GW

10 GW
Posts: 4020
Joined: Mar 26 2011 1:15pm
Location: CT, USA

Re: Connecting a Cycle Analyst to a Castle Creations control

Post by teklektik » Sep 05 2014 3:34pm

CA/ESC Kill or ON/OFF Switch

This Castle Creations ESC needs an external +5V supply (BEC - Battery Eliminator Circuit) to power the on-board logic. The present CA V3 Guide provides the same BEC wiring instructions as discussed above.

But - thinking about this, it occurred to me that this is not unlike the situation with Xie Chang and other ebike controllers that possess an 'ignition' wire that must be connected to Vbatt+ to power up the controller. This low current wire affords a handy ON/OFF switch and/or kill switch. Internally, this ignition wire is simply tied to Vin of a +5V regulator that powers the controller logic - the equivalent of the external ESC BEC hook-up. This same capability should be able to be realized with ESCs requiring an external BEC by simply switching the BEC connection.

Here's how this might be done:
CA-BecWithKill2.png
Add new Kill Switch connector to CA
CA-BecWithKill2.png (46.82 KiB) Viewed 1965 times
CaV3-RcEscHookup.png
CaV3-RcEscHookup.png (92.78 KiB) Viewed 1961 times
This is untried - I don't have one of there ESCs to inspect, but it seems extremely unlikely that CC has anything other than a conventional FET phase driver etc. There is no mention in the CC literature of any restrictions on the order in which the ESC power and BEC wiring is hooked up. I have an email in with Castle Creations about this, but no words yet about any possible issues or if there are any parasitic resistors that might cause a minor current drain if the controller was switched off this way. Anyhow - you might give this a go if you want to add a kill switch to your CA/ESC hookup.

Please PM if you verify this and I will add it to the CA V3 Guide. :D
Visit Grin Technologies at www.ebikes.ca
Build Thread: 2WD Yuba Mundo V4

jucasan   1 mW

1 mW
Posts: 18
Joined: Mar 02 2015 9:49pm

Re: Connecting a Cycle Analyst to a Castle Creations control

Post by jucasan » May 17 2016 1:31am

I'm working in my first project and connected a castle creations hv80 as described in the CaV3-RcEscHookup.png picture. The CA works and the throttle seems to work too since I see the throttle going up and down on the CA display.
The problem is there is a red LED blinking on the controller and the motor doesn't run.
Anybody can give me some advice. Do I need to set up the controller or something like this?
Thanks

User avatar
amberwolf   100 GW

100 GW
Posts: 27937
Joined: Aug 17 2009 6:43am
Location: Phoenix, AZ, USA, Earth, Sol, Local Bubble, Orion Arm, Milky Way, Local Group
Contact:

Re: Connecting a Cycle Analyst to a Castle Creations control

Post by amberwolf » May 17 2016 2:16am

If the light is blinking it is probably in a pattern that you would have to check the controller manual for to find the error code.

User avatar
teklektik   10 GW

10 GW
Posts: 4020
Joined: Mar 26 2011 1:15pm
Location: CT, USA

Re: Connecting a Cycle Analyst to a Castle Creations control

Post by teklektik » May 17 2016 7:43am

First, you must set ThrO->OutputMode = 'Rc Pulse'.
This replaces the normal ebike throttle voltage signal with a PWM waveform like that provided by R/C servo receivers/testers.

Next, Castle Controllers throw a throttle fault if the input pulse stream goes away or has a pulse width less than about 0.4ms (0.4ms is an empirical value offered by CA users - CC actually has no specification for this minimum width, so that figure may vary somewhat.) The out-of-box CA default value is 0ms (no pulse output) which undoubtedly accounts for your controller fault.

The CA has ThrO->BrakeOut=0 by default. In the earlier 'preliminary' CA 3.0 firmware releases (e.g. up to 3.0p11), this voltage (in your case period in ms) is what the CA outputs when brakes are applied. In those cases, it was necessary only to set BrakeOut >0.5 ms so that on braking, the CA would reduce but not entirely remove the pulse stream.

Unfortunately, the new proportional regen feature released in CA 3.0 can cause problems for R/C installations. In 3.0, hitting the ebrakes shifts the throttle output to BrakeOut voltage/period as before, but now opening the throttle with the ebrakes applied causes the Throttle Out signal to decline from BrakeOut to 0 as the throttle goes from ZERO to WOT. This controls proportional regen for Grin controllers, is ignored by all other ebike controllers, but can cause R/C controllers to throw an throttle fault near WOT (maximum regen braking).

There are some workarounds for this, but they really belong in the CA V3 Beta thread not here.
Here's two quickie approaches instead:
  1. Verify that:
    • ThrO->OutputMode = 'Rc Pulse'
      ThrO->BrakeOut = 0.4ms or more but less than ThrO->MinOut
    This should get your controller working as long as you don't got WOT with the brakes applied.
  2. OR - Re-flash your CA with new 3.1 beta firmware which allows you to disable proportional regen. Here you make similar settings:
    • ThrO->OutputMode = 'Rc Pulse'
      EBk->BrakeOut = 0.4ms or more but less than ThrO->MinOut
      EBk->PropRegen = Disabled
    With proportional regen disabled, the CA simply outputs BrakeOut and does not vary it with the throttle setting - behavior identical to the older 3.0p11 release.
Hope this helps... :D
Visit Grin Technologies at www.ebikes.ca
Build Thread: 2WD Yuba Mundo V4

jucasan   1 mW

1 mW
Posts: 18
Joined: Mar 02 2015 9:49pm

Re: Connecting a Cycle Analyst to a Castle Creations control

Post by jucasan » May 17 2016 11:21am

Set up
Thr0>OutputMode=rc pulse
Thro>brakeOut=0.4
Thro>MinOut=0.3

But the LED is still blinking and the motor is not running.
Any other sugestion?
Thanks

User avatar
teklektik   10 GW

10 GW
Posts: 4020
Joined: Mar 26 2011 1:15pm
Location: CT, USA

Re: Connecting a Cycle Analyst to a Castle Creations control

Post by teklektik » May 17 2016 11:59am

Not until you look up the fault code in the CC manual...

You've set the throttle ZERO pulse width (Thro>MinOut=0.3) smaller than the minimum that the controller considers a fault (?).
That means that when you turn on the bike with the throttle at ZERO you are guaranteed to get a controller input fault.
Visit Grin Technologies at www.ebikes.ca
Build Thread: 2WD Yuba Mundo V4

User avatar
DanGT86   10 kW

10 kW
Posts: 688
Joined: Sep 06 2012 9:18pm
Location: Saint Louis MO

Re: Connecting a Cycle Analyst to a Castle Creations control

Post by DanGT86 » Oct 04 2019 7:41am

I'm messing with a CA3 and an RC ESC that also requires BEC power. Using the above diagram as a guide I connected the yellow CA3 wire to the 5v pot pad on the CA3 board. Im using an external grin shunt with the pass through throttle ground and yellow wire.

A strange observation is that the CA3 screen goes blank if I connect the Throttle to the ESC after the CA3 is powered. If I make the throttle connection first then connect the CA3 it works fine. The screen stays powered it just goes to all solid blocks instead of characters.

Initially I had powered the Ca3 by plugging in the 6pin connector to the shunt. I thin verified the 5v present on my yellow wire and connected it to the ESC throttle plug. The screen immediately went blank and I freaked out figuring I had cooked something. Upon reconnecting the CA3 plug It booted and worked fine.

Post Reply