CroBorg Super Commuter

windtrader said:
This lever will have two cables; one for the brake switch contact, and the other for the linear output.
What is on the other end of the switch and linear output? Regen and brake light?

Sabvoton Regen requires both the switch to enable it (and cut motor power/disable throttle), and the 0-5V analog to control the level. The switch could also be used for brake lights at the same time, I may do that later. My present goal is to have a lever eBrake.
 
It was quite a struggle to assemble the variable eBrake lever, but it is together. I'm not going to test it tonite. I don't want to know if it doesn't work until tomorrow. :)

I tested the switch earlier, all that remains is the analog output. The magnet touches the sensor directly, so it should produce a fairly wide range signal. It won't be 0-5V, but it may be enough. If it is marginal I will add an external amplifier to increase the voltage span. The thumb throttle I'm using now doesn't have a terribly wide voltage range, and it works fine, so I expect this will also.

It is not quite finished, but it is basically together. After successful bench testing I will epoxy things into position, right now they are held temporarily with gap filling cyanoacrylate. It holds pretty well, it tore the nickel plating off a magnet. :shock:
 
A quick test, powering with 3xAA batteries shows what I expected. I checked data sheets today, and the data sheet I was using was for a different part, and the magnetic polarity is reversed from the part I'm actually using.

So the output swings from 3.97V with ebrake released, to 2.36V with full on. It looks like the lever will hit the handlebar grip before it reaches 2.36V so it will have change over the full range. I'd guess about 2.4V at the grip, so 4 - 2.4 is about 1.6V of swing. I can reverse the polarity of the magnet, but this doesn't solve the problem, the voltage swing is about 3 times to small. If the magnet were reversed the output would go from 0.77 to about 2.3V. That might work, sort of, but not as well as I'd like.

So we'll need a secondary amplifier for best results. :roll:
 
I've been looking at a few configurations for this circuit. A quick one transistor DC inverting amplifier is possible, but the temperature stability would not be very good. An operational amplifier would be better. But if I want to remap the control linearity the op amp would get rather complicated to work with. I also want to be able to set the minimum ebraking, right now when the switch engages it drops out the slip regen so it reduces the braking, it would be better if the initial ebraking was equal to or slightly greater than the slip regen so you didn't get the feeling that applying the brakes initially caused less braking.

I have on hand some hardware that would allow fiddling with the gain, linearity and offset to make the feel of the brake better while also handling the requisite gain and offset requirements. Since this is an experiment anyway, I think I'll try that. If it doesn't work out we can always revert to the op amp.

I'm considering trying an experiment with the Adafruit Trinket microprocessor. It is a very small (about an inch long) and very low cost Arduino type board, providing a subset of the normal Arduino range as it is based on an 8 pin microprocessor (the ATTiny 85). The chip can read an analog voltage from the eBrake lever, filter it, apply the gain and offset calculations, and output an analog voltage to feed to the controller. I've worked with this chip on a number of projects, though I haven't used these Trinket boards before. I purchased a few some months ago and they're still sitting in the anti-static pink bags.

20150331_093832.jpg


The usual analog output from these micros is PWM, so it needs to be filtered and possibly buffered, and is a compromise of ramp rates, noise and drive impedance. Instead of that I will use a separate Digital to Analog chip that will generate a very clean and buffered rapidly adjustable DC output voltage. The particular DAC chip I have is very tiny and comes on a little breakout board from either Adafruit or Sparkfun, and the interface is an I2C bus which requires only 2 pins to talk to a number of devices. This is good for the Trinket since it has only 5 I/O pins, and really only 3 I/O pins if you want to leave the USB programming fully available.

From a hardware standpoint this makes the project quite simple, these two very small boards have just a few interconnects to wire up. It does add a software component to the project and makes testing interesting. The software can be developed on a laptop with the available free tools and libraries, and loaded to the Trinket with a USB cable (no programmer required). It will take very little code to read the voltage, filter, offset, and send results to the DAC. The update rate will be quite fast, and the resolution more than 10 bits which should be beyond adequate.

Introducing a microprocessor into a braking system is a concern. Of course the Sabvoton Controller is already using a microprocessor to control ebraking. The function of the micro I am introducing is very simple compared to what the Controller is doing. During testing we will lower the ebraking gain of the Sabvoton, so the maximum braking will be only moderate. The way this ebrake lever works is also helpful for safety as there is a mechanical switch that enables ebraking in the Controller so if the lever is released the ebraking will cease regardless of the output voltage from the micro's DAC. This is also rear tire braking which is not as problematic if wrong.

Occasionally the micro may get a bad ADC voltage reading, so each reading will be range checked for sanity before being used. Additionally each value used for calculations will be the average of a number of ADC readings. The calculations will be simple integer arithmetic with careful attention to the range of values. We can do 16 or even 32 bit arithmetic on this micro to insure that there is adequate range for the calculations without danger of arithmetic overflow.

Thorough testing will be done, and when it is shown to be reliable the ebraking current in the Controller can be increased to a more normal level. In the event of a failure the ebraking system can be unplugged, or perhaps I will set up a fixed potentiometer value so it can be set to some value as a backup, and of course the dual 203mm hydraulic front disc brakes are unaffected by all this, so considerable braking is always available.
 
Hi everyone,

I have a sabvoton controller that was shipped to me without a cycle analyst connector. Does anyone here know how to create the cycle analyst connector on the sabvoton controller? Would someone be able to post a few pictures of the removable wiring harness on the Sabvoton and the wires that feed the cycle analyst connector?

My controller is rated at 72V & 300kW.

Thanks,
Will
 
TheJuice said:
Hi everyone,

I have a sabvoton controller that was shipped to me without a cycle analyst connector. Does anyone here know how to create the cycle analyst connector on the sabvoton controller? Would someone be able to post a few pictures of the removable wiring harness on the Sabvoton and the wires that feed the cycle analyst connector?

My controller is rated at 72V & 300kW.

Thanks,
Will

Hi Will, welcome to ES. Probably best to start a separate thread for your question, or ask in the CA V3 thread, or find it in the manual. You'll need an external shunt, and you can follow the wiring in the CA V3 manual for the external shunt configuration. Ebikes.ca sells a kit of connectors if you don't have one to fit the CA V3.

Rated at 300kW? 402 Horsepower? Perhaps a typo. :)
 
Hi Alan,

Thanks for the reply.

Yes, that 300kW was a bit of a typo. 3000W sounds a bit better. I have their instructions and the wiring picture in the manual but I need to know which wires from the Sabvoton I should be tapping into to create the connection.

1: Vbatt ( I assume this is a connection to the positive terminal on the battery pack)
2: Ground (this must be the negative terminal on the battery pack)
3: Shunt - (what is the difference between this connection and the ground?)
4: Shunt +
5: Speed ? (is there a speed sensor wire from the sabvoton?)
6: Throttle override ? (is there a throttle override from the sabvoton?)
 
TheJuice said:
Hi Alan,

Thanks for the reply.

Yes, that 300kW was a bit of a typo. 3000W sounds a bit better. I have their instructions and the wiring picture in the manual but I need to know which wires from the Sabvoton I should be tapping into to create the connection.

1: Vbatt ( I assume this is a connection to the positive terminal on the battery pack)
2: Ground (this must be the negative terminal on the battery pack)
3: Shunt - (what is the difference between this connection and the ground?)
4: Shunt +
5: Speed ? (is there a speed sensor wire from the sabvoton?)
6: Throttle override ? (is there a throttle override from the sabvoton?)

The shunt is a very low voltage signal, so an accurate reading requires four wires, two carrying current, and two separate sensing wires that sample the voltage drop across the shunt, and not across any other resistances in the circuit. The CA wires are the sensing wires.

The speed wire is connected to any of the hall sensor outputs.

The throttle override is the throttle output from the CA. If you want to use all the features of the CA you need to run your throttle into the throttle input of the CA V3 and take the override as the output to the Sabvoton. That's what I'm doing.

The older override mode puts this wire in parallel with the throttle, and it pulls down the throttle signal, overriding it. A series resistor to the throttle is added to facilitate this. Doing things this way precludes many features available in the CA and allows delay in the clamping which can lead to instability of limits.
 
A small progress report on the variable regen eBrake lever.

I decided to re-mount the magnet with the opposite magnetic polarity. Now the output voltage range is 0.77 released and 2.27 pulled in to my estimate of where the grip will stop it. It is not enough voltage range, but it will at least work this way for testing while I am working on the amplifier.
 
Hey Alan,

I have a 0-5 or 5-0 K ohm cable-actuated linear throttle (not unlike a Magura throttle) that I think should work to tap into that variable regen on your Sabvoton ..right?
 
Alan B said:
A small progress report on the variable regen eBrake lever.

I decided to re-mount the magnet with the opposite magnetic polarity. Now the output voltage range is 0.77 released and 2.27 pulled in to my estimate of where the grip will stop it. It is not enough voltage range, but it will at least work this way for testing while I am working on the amplifier.

I did some work on the Borg tonite, removing the thumb throttle ebrake, the lumenator and various extra wires, and installed my new linear voltage output magnetic ebrake lever. I did a quick test ride and the ebraking is working as expected. This means that it is a bit on the weak side with only a 2.27V max signal. When I get the amplifier working I'll splice it into the cable. I could experiment with raising the ebraking level, that might work fairly well.

I'm reviewing some different options for the amplifier, we'll see what we decide to try first.
 
Alan B said:
Stevil_Knevil said:
Hey Alan,

I have a 0-5 or 5-0 K ohm cable-actuated linear throttle (not unlike a Magura throttle) that I think should work to tap into that variable regen on your Sabvoton ..right?

It should work. Do you have a source for them? I'm up for trying one.

Not sure where they could be sourced, but I have a handful of them I collected over the years.
PM an address and I will send you one to try out.
 
Excellent Stevil! PM Sent.

This morning I dialed up the gain on the eBrake settings of the Sabvoton. It was set to 220 for the thumb throttle, but with about half the signal from the new magnetic ebrake lever it was a bit weak. So I dialed it up to 500 and rode it to work.

It is still not quite as strong as I will want it, but it is in a very useful range now. It has enough authority to decelerate on a 15% downhill to make the sharp turnoff. It is a good test, not quite at the level of full emergency braking, but control on a steep hill is adequate. The onset is a bit stronger than I'd like, so I may use an equation to change the curve in the amplifier to be added.

I was checking my inventory of differential amplifier integrated circuits, and found one that will work at these low supply voltages. That is another solution to the amplifier. I'm just not sure where those chips actually are, so I can't try one right now.

The return spring on the ebrake lever could be stronger. It is like having super power brakes, it would be easier to modulate with a bit more spring. However the hand will become accustomed to it soon enough. I did consider using a strain gauge based ebrake lever (such as Arlo has done), but I want something to move, the physical motion is useful feedback.

An ebrake lever is much better than the thumb throttle for regen and ebraking. Having to stretch out and reach the thumb ebrake was an ergonomic strain. The wide base of the grip throttle put the thumb flag a long way out, making it a stretch for the thumb. It is surprising how easily the thumb can be injured or stressed, especially when stretched out.
 
Today I extended the cable from the brake switch on the new magnetic eBrake lever and connected it to the eBrake circuit instead of the switch on the front hydraulic brake. Eventually I will parallel them, but for today I just swapped it. I used the dual-layer heatshrink, it has hot-melt glue inside of heatshrink, so it not only conforms to the joint, but it bonds the heatshrink to the joint and to the insulation on either side. This makes a water resistant and mechanically supported connection. This particular eBrake lever has a cable only about six inches long, so this joint is out in the weather in front of the bike in the curve of the wiring before it passes into the Borg covers.

So now the new magnetic eBrake lever works the way it should (for the most part). A small displacement of the lever cuts the throttle as the eBrake switch makes up, and the further it is pulled the harder the motor regeneration/eBrake comes on. Just like a real brake. Excellent!

The ergonomics are ideal. The eBrake strength is a good strong regen, clear down to about 2 mph. Much stronger than Infineon type controllers at the max, but not yet to the level of emergency disc braking. I'll get to that level soon. The voltage output from the lever is still low, and that is limiting the eBraking. I may try turning the gain up higher, but eventually an amplifier will be tested. I'm working on the setup for the test circuit.

I received more parts today that I could use on this circuit, but I still haven't been able to locate the differential amplifier chips that I have. Too much clutter here, trying to keep things organized but it is not always working.
 
Had you tried or given thought to placing the motor cutoff switch on the lever so it would still be one motion to cut motor and apply regen? I was thinking one could drill the brake lever toward the end where your pinky finger wraps the lever. Embed a small switch. Use the main lever for the regen. When you want to brake, you depress switch with your baby finger while applying pressure to the whole lever with all fingers.
 
It is one lever, with both a mechanical switch and a linear magnetic sensor generating a voltage. It looks like a normal brake lever, is a normal ebike brake lever but instead of having a brake cable coming out it has two small electrical cables, one with the switch output and one with the magnetic sensor leads. When the lever is pulled a little bit the switch closes, as the lever is moved the magnet moves away from the magnetic sensor and the output voltage changes throughout the travel of the lever.

The output of the switch feeds the controller eBrake input which both cuts the throttle and engages the regen/eBrake. It could also drive a brake light.

This was made with an ebike brake lever which had the switch built in, and it is set up for pulling a standard brake cable. These are commonly available.

So the way it is configured now it looks and works pretty much exactly like any other brake. It feels very light since you are only pulling against a small spring, and it never stiffens up, it moves till it contacts the grip. There is no longer a capability to pull a brake cable since I removed that equipment to install the magnet and sensor inside the brake hood.

I'll try and do some photos today.
 
There is no longer a capability to pull a brake cable since I removed that equipment to install the magnet and sensor inside the brake hood.
A first? Brake by wire? Now, convert the front to electric control brake system. Do you dare? lol
 
windtrader said:
There is no longer a capability to pull a brake cable since I removed that equipment to install the magnet and sensor inside the brake hood.
A first? Brake by wire? Now, convert the front to electric control brake system. Do you dare? lol

Yes. Brake by wire. That's what eBrakes on the Sabvoton are set up to do. I've never had a rear brake on the Borg because the space is very tight and the hardware that came with the frame doesn't fit in the space available with my wide motor and short axles. From day one I've used dual disc hydraulic front brakes and regen. Actually I didn't have regen at first, but that was remedied rather quickly.

The variable eBrake on the Sabvoton is not just variable regen. As you put the ebrake on further it applies power to the hubmotor in reverse to maintain effective braking at low speeds.

Will I convert the front dual hydraulic discs to electric? Heck, NO.

Here is the DIY magnetic eBrake lever. It looks like any other brake lever until you pull it. Electric power brakes!

20150329_184837.jpg


20150404_105616.jpg


20150404_105531.jpg


The upper cable is the switch, the lower is the magnetic sensor. The magnet is on the end of the lever, normally inside the hood. The magnetic sensor (shown loose in the top photo) and the little PC board are inside the hood, the sensor positioned to touch the magnet when it is fully released into the hood.
 
Perfect! A lot cleaner than what I was thinking. I just stumbled upon the dual cable brake levers. Will keep that tucked away if I need to double up on the front wheel in my build.
 
windtrader said:
Perfect! A lot cleaner than what I was thinking. I just stumbled upon the dual cable brake levers. Will keep that tucked away if I need to double up on the front wheel in my build.

Yes, I haven't found a use for dual-cable brake levers, though the dual front discs could work with that (but mine are hydraulic). The one I used is an eBrake lever, so it came with the switch and electrical cable, and was set up to pull a single brake cable. I just converted the brake cable part to a magnetic displacement sensor. It did come out fairly clean. I'd like a stronger spring but haven't figured out an easy way to do that. The magnet, sensor and switch are in the way for easy spring locations.
 
20150404_130626.jpg


Here are the basic parts for the Digital eBrake Signal Conditioner. At the bottom center is an Adafruit Trinket which is a very small and low cost Arduino type USB programmed microprocessor. Above and to the left is a 12 bit Analog to Digital converter with a programmable gain amplifier to read in the signal from the eBrake lever. To the upper right is a Digital to Analog converter. These are all small boards available from Adafruit.

This can do a lot more than just amplify the eBrake signal, if needed. There are a lot of ways to do this, and the hardware I've selected is not the minimum, but it can do more than just the eBrake so the same hardware configuration may be re-used in some future projects.

There are a few wires missing from this, so back to the project...
 
The ADC is wired up and working. The memory in the DAC for the initial value is set to zero, the DAC uses this value while the Trinket is booting up, then the values from the CPU override that. So for a few seconds after power up the Trinket is looking for a software download, then it starts running the program. During this time the default DAC value is used. I might set this to a moderate level of braking, but in a few seconds it is running anyway.

The program is presently reading the ADC, doing some simple calculations, and then outputting to the DAC. It is using 1550 of 5300 bytes, so lots of room for more manipulation.

Not bad for the brief time invested.
 
Added ADC filtering and scaling to 1mV per bit, input offset, 3x gain, overflow and underflow clamping. Using 1650 bytes of 5300 available.

This is a reasonable first cut at the eBrake Digital Amplifier. Cabling is next. Unfortunately the weather is not good today for working on the bike or testing and I have some other chores to attend to.

Made a measurement of the cycle rate. It is reading the ADC 8 times for filtering to reduce noise, doing the math and writing the DAC about 60 times per second. This is using the slow I2C default rate and the slow 8 MHz default Trinket clock rate, and it includes the extra digital writes to make a time measurement from. So it could be speeded up some, but I suspect 60 hz is just fine for this.

Measurement courtesy of the Rigol scope. I set up the digital output on #1 which also drives the LED, so when the loop is running the red LED just barely lights. If the red LED goes out or gets stuck on the software loop is not running. The green LED indicates power to the Trinket.

The red LED "breathes" during the first few seconds after power-on or reset indicating the bootrom is looking to the USB for a software load, then it begins the stored program. The program is in flash memory and can be rewritten many thousands of times, but it stays stored without power for many years.
 
Back
Top