You are here

3 speed switch

18 posts / 0 new
Last post
de-bodgery
de-bodgery's picture
Offline
Last seen: 6 months 1 week ago
VESC Free
Joined: 2018-11-09 01:44
Posts: 17
3 speed switch

I've googled for this and it seems like it only works with skateboard remotes.

I ride e-bikes and scooters. I've used a variety of EV grade motor controllers and never run across one that doesn't have at least high and low that are selectable with a rocker switch. Low, medium and high or modes 1, 2 and 3 are very common in controllers. Add the 3 way switch, program what you want the 3 modes to do and off you go.

How do I wire up a 3 position switch and then program a VESC so that it responds to the switch position with 3 different RPM/phase amp profiles or even reverse?

 

I want to set up the VESC so it responds like this:

1. Low is usually 25 - 30 mph and 2000 watts max. This makes riding easy for noobs and when the cops are snooping around.

2. Medium is usually best possible phase amps and 40 mph.

3. High is usually maximum possible capabilities of the motor, controller and battery.

 

My best guess: (Maybe this is completely wrong?)

1. I need throttle (ADC1) and regen (ADC2), but a VESC usually has a third analog input (ADC3).

2. Have the 3 position switch select between 3 voltages and feed it into ADC3.

3. How to program the VESC responds to that signal is a mystery to me???

 

Thanks for your help folks!

de-bodgery
de-bodgery's picture
Offline
Last seen: 6 months 1 week ago
VESC Free
Joined: 2018-11-09 01:44
Posts: 17

I'm a VESC noob, but I've used other FOC controllers such as ASI and Nucular

A few more questions:

1. I am using ADC2 for regen. The controller sees the second throttle on ADC2. I see the bar graph sweep in the android app as I turn the second throttle, but then there is no actual regen braking. The second throttle doesn't do anything that I can detect to slow me down. What am I missing?

2. The motor has halls in it. I can use a hall tester and the LEDs blink on and off while turning the motor by hand. I had the motor on a Nucular controller and that has a diagnostic section that shows the halls as they turn on and off. It has a hall table too. The halls clearly work. However, discovery on my VESC does not see the halls and says my motor is sensorless only. I can check the halls as I hand turn the motor with it connected to the VESC and they turn on and off. It's not like they aren't working. why is the VESC NOT using them?

3. I will be using 2 identical motors running in parallel. Each motor has its own halls and phases. I want to have both VESC controllers running from the same set of throttle, brake and 3 speed signals. Can I assume that CANBUS will transmit control signals from one controller to the other? How do I set that up?

4. I found this small LCD for VESC. It can't be used for much more than displaying stuff. Is there an option that is 2-3X larger that isn't my phone?

https://www.findermotor.com/skateboard-parts/2-4-ghz-remote-controller/t...

5. Is there somewhere that shows the hall table?

6. Is there somewhere that the PIDS after motor discovery are done are shown?

Johnvoss
Johnvoss's picture
Offline
Last seen: 1 year 5 months ago
Joined: 2021-08-16 04:30
Posts: 8

Not available yet, but I am thinking about using this Bluetooth LE ring to control the VESC.
https://www.indiegogo.com/projects/arcx-the-revolutionary-smart-ring

Left = Low power

Up = Medium power

Right = High power

Down = off

and maybe press the button for cruise control.

 

John

de-bodgery
de-bodgery's picture
Offline
Last seen: 6 months 1 week ago
VESC Free
Joined: 2018-11-09 01:44
Posts: 17

I'm a VESC noob. I've used several other FOC controllers and been building EV's since 2015. I just finished my 4th EV. For others, I have built another 6 or 7. I have yet to find an EV grade controller that lacks physical lines for at least low and high. All the programmable ones had 3 speed settings and I could set RPM and phase amps for each setting. To NOT see this in VESC is really surprising! I want a physical 3 position switch on my handlebars, not some blue tooth doohicky that can go dead and run out of charge. It's crazy that there is no way to connect a physical 3 position switch to a VESC!

district9prawn
Offline
Last seen: 2 years 2 weeks ago
Joined: 2018-04-26 12:18
Posts: 123
Yes throttle on ADC1, regen on ADC2 and your own switch or whatever on ADC3 (if present) is correct.
It sounds like you have ADC2 connected correctly. Which ADC control mode are you using? It sounds like you want "Current no reverse brake adc2".
 
The hall table is under foc->halls. You should also be able to see the stepped plot of the hall states beside the rotor position plot under realtime data. Do you get valid results when running a hall detection?
 
I've been using these controllers for a few years now and I don't think I've seen someone implement or request a three speed switch like on many ebikes. Since you are using adc throttles, I would recommend taking a look through the app_adc.c source file.
de-bodgery
de-bodgery's picture
Offline
Last seen: 6 months 1 week ago
VESC Free
Joined: 2018-11-09 01:44
Posts: 17

Lots of VESC implementations get used on skateboards. Your hand controller is probably programmable for speed and torque profiles. I think lots and lots more people will be using them on other things such as e-bikes or scooters now that they have become capable of higher voltages such as 60-100v. There's also projects in the works for 150v and higher. These voltages are not much use to most skateboard builders, but very useful to people like me. Rion has implemented their own VESC controller. They call it the Rion Tronic, but it's just a VESC controller. This is one of many efforts to bring VESC to the rest of the world. Demand for a 3 speeds implementation will only increase. What I don't know is HOW to implement in the controller recognizing 3 voltages on ADC3 as 3 speed and torque profile settings.

https://www.rionmotors.com/rion2re70

What would I be looking for in the  app_adc.c file? ARe you implying this file has some sort of potential implementation for ADC3 for 3 profiles?

LOL...no idea what mode is set for ADC2. For regen braking via ADC2, what is the correct setting? I assume that there is also a setting for what is the maximum phase amps that are recovered too?

 

district9prawn
Offline
Last seen: 2 years 2 weeks ago
Joined: 2018-04-26 12:18
Posts: 123

To configure your adc control mode go to app settings -> general and set app to ADC. An ADC section then becomes available under app settings where you can calibrate your adc throttles (it sounds like you have done this part). In this ADC section you calibrate your throttle voltages and curves. Under ADC -> General -> Control Type you probably want "Current no reverse brake adc2". 

To setup what motor currents the throttle maps go to motor settings and setup your motor and battery current limits. 

The 3 speed switches were almost mandatory with the cheap speed mode trap controllers at higher powers if you didn't want your ebike to wheelie. It seems with the torque mode controllers most people are happy to just let the throttle do all the limiting. 

The app_adc.c source file is where the adc throttle readings are processed for the various adc control modes. This is where I added custom code for throttle modes for my ebike.

de-bodgery
de-bodgery's picture
Offline
Last seen: 6 months 1 week ago
VESC Free
Joined: 2018-11-09 01:44
Posts: 17

This is true for VESC that there is no 3 speed option. I have been using Nucular 12 fet and 24 fet FOC controllers since 2018 and they have 3 speeds. I have an ASI BAC2000 and it doesn't have speeds either. I think this is hit and miss in FOC controllers. I like having the modes available so that if someone else rides my EV, I can set them to low power. Same for when a cop gets curious! And yes...torque throttle is better than speed throttle if there is not a speeds capability.

 

BTW...thank you for the help and information!

district9prawn
Offline
Last seen: 2 years 2 weeks ago
Joined: 2018-04-26 12:18
Posts: 123

I agree that even if the torque throttle control is good the 3 speed switch is a very good idea for the reasons you mentioned. 

When/if I get around to implementing it on my ebike I'll share it in this thread too. 

Bestboy4
Offline
Last seen: 3 years 3 months ago
Joined: 2021-09-14 16:38
Posts: 1

I'd be interested in a 3 speed switch input.  

de-bodgery
de-bodgery's picture
Offline
Last seen: 6 months 1 week ago
VESC Free
Joined: 2018-11-09 01:44
Posts: 17

Can someone help me with a problem please?

I have a Revolt outrunner (RV-160-SH). The motor runs! It was on a Nucular 24 fet previously and ran fine there. I was using the release version of VESC tool for android and it would run the motor. The Windows version would not detect the motor or run it. Id get the below error. Now Im trying the beta release found here to see if that's any better and neither bea for windows or android will do the RL test. What's going on here?

https://vesc-project.com/node/2859

I do the RL test and the motor makes some short noises several times and then I get an error "Could not measure resistance and inductance".

spacewalker
Offline
Last seen: 1 year 7 months ago
Joined: 2020-06-10 12:30
Posts: 29

you can use this  with proper resistors to make  what you need 

 

program vesc   with  no  resistor - so full speed , keep ADC2  for brake as maximum 

each resistor will reduce power to vesc, so vesc will see like you  not fully press  accelerate paddle 

very easy to make it 

Martin

Desper
Offline
Last seen: 3 months 4 days ago
Joined: 2022-02-17 12:12
Posts: 2

Hi! Who else has not been able to implement a 3-position switch with the possibility of software configuration? 
It would be useful to still have such an opportunity

bikerpete
Offline
Last seen: 2 years 3 months ago
Joined: 2022-09-07 23:20
Posts: 1

I've been looking into using VESC, but not having hardware controllable "modes" is a showstopper I think.

Even better, or perhaps just different, I'm not sure which, than preset modes would be the ability to use knobs to dial up Response, Max speed and Max torque.

Chris Barth
Offline
Last seen: 3 days 3 hours ago
VESC Free
Joined: 2021-11-03 00:10
Posts: 5

Under VESC tool there is a section called profiles.  Ive used this to create different modes that limit either power or speed.  Im not sure but it migh be possible to assign a switch to each mode so you can cycle through them.  

 
oangelo
Offline
Last seen: 1 year 3 months ago
Joined: 2022-12-08 22:47
Posts: 12

I just found out that Spintend has an "Ewheel ADC V2 adapter for diy ebike escooter with vesc" that does what you guys are looking for. It also controls light and other things. I bought one for my project, I hope I can use it with my FSEC75200.

Oscar Lozano Gimenez
Offline
Last seen: 11 months 2 weeks ago
VESC Free
Joined: 2018-04-17 17:57
Posts: 6

Que valores de resistencia son adecuados.

Para 5v o 3,3v

Tambien se puede utilizar un poteciometro para ajustar.

Oscar Lozano Gimenez
Offline
Last seen: 11 months 2 weeks ago
VESC Free
Joined: 2018-04-17 17:57
Posts: 6

Dandole vueltas a lo que tu dices no creo que funcione para nada. Cambiaras el valor de voltage minimo del acelerador tambien.