Turtle/Rabbit mode with Nunchuk buttons

Are there any features that you would like to add to the VESC?
E-CON
Posts: 6
Joined: 23 Dec 2015, 19:42

Turtle/Rabbit mode with Nunchuk buttons

Postby E-CON » 23 Dec 2015, 20:09

I would love to see a possibility to reduce the speed of my board with a simple button code, for example to let children give a try on my electric longboard. Like already available it should be possible to change ERPM. But now, during the ride without computer only with nunchuk. The value for ERPM should be set up in the configuration tool before (F.e. rabbit=100% turtle=50%). As the buttons are already in use, it would be nice to combine the buttons (f.e. hold c button + 1. nunchuk left + 2. nunchuk right + 3. nunchuk left + 4. nunchuk right) to change from rabbit to turtle once. Button code one more time and it change back from turtle to rabbit. I would love to do this on my own, but i am not good in coding. Please help me!

benjamin
Site Admin
Posts: 280
Joined: 15 Dec 2015, 08:38
Location: Sweden
Contact:

Re: Turtle/Rabbit mode with Nunchuk buttons

Postby benjamin » 24 Dec 2015, 00:56

It shouldn't be too difficult to implement something this for the nunchuk app. I will have a look at it soon.

Exactly how would you like to toggle between the modes? An exact description of the procedure would help since I'm not very good at making intuitive user interfaces.

E-CON
Posts: 6
Joined: 23 Dec 2015, 19:42

Re: Turtle/Rabbit mode with Nunchuk buttons

Postby E-CON » 24 Dec 2015, 08:28

That sounds fantastic! I will try to describe it as detailed as possible, how I think it should work:
First of all there needs to be a new Category in the nunchuk view in the config app. It can look like the "RPM Limits" with the possibility to activate the mode and to set the ERPMs. I would name the mode "turtle mode". If we enable the "turtle mode" in the config and set the ERPMs in the config and everything is written to VESC, we are ready. The function code can be identical to the "RPM Limits". Difference is: RPM Limits is active, when Turtle mode is off. When turtle mode is on, it will overrule the RPM Limits. The temperatur and voltage limits do overrule both, RPM Limits and turtle mode. When the board gets power, it will set up the last used mode (if turtle was active last time, turtle mode is also active this time. if turtle mode was deactivated last time or never used before, it is deactivated.) Now we can ride our board. Then there comes a child and wants to try the board. Because we do not want to let it ride the board with 30 kmh, we want to activate the turtle mode. Here my proposals, all are perfect for me, choose the easisest way for programming or what you prefer:
1. The board has to be activated (power on) but without speed to change from turtle on to turtle off. You push and hold the c button and move the nunchuk left, then right, then left, then right within 5 seconds. The mode change and so the ERPMs. Child can test it. After that we use the brakes to stop the board and deactivate the turtle mode again with the button code.
2. The board has to be activated but speed doesn t matter. You move the nunchuk again left+right+left+right within 5 seconds (but without c button, othwise you are forced to drive instead of getting slower). The motor goes zero torque. To slow down the board you use your feet or the brake. Brake is still useable but not the throttle up. Until you reach the turtle ERPM which was set in the config. Then you are able to use throttle again but with turtle ERPM limit. To change back to normal mode we use again the button code and are able to throttle to ERPM set up in RPM limits.

I hope this is detailed enough. Otherwise you can write me any time. THANK YOU!!

david
Posts: 36
Joined: 15 Dec 2015, 13:19
Location: Hamburg, Germany
Contact:

Re: Turtle/Rabbit mode with Nunchuk buttons

Postby david » 24 Dec 2015, 12:10

That's a great idea, me and some others were thinking about that as well. It could be also very useful to limit speed in case one of those officials would stop you. :)

I was starting working on it but my programming skills are a little bit outdated and I got nowhere until now. So any help is really appreciated!
VESCs made in Germany http://www.esk8.de

barney
Posts: 22
Joined: 23 Dec 2015, 08:21

Re: Turtle/Rabbit mode with Nunchuk buttons

Postby barney » 25 Dec 2015, 11:35

Here some functions from BamBam Nunchuk Teensy Board control:

Sorry in German!
http://www.elektro-skateboard.de/wiki/bambam/bambam-boardcontroller

Folgende Funktionen wurde bisher gewünscht und umgesetzt:
    1. Z-Taste + Nunchuk Y vorn -> accelerate - beschleunigen (Integrationssteuerung/relativ oder DirectDrive/absolut)
    2. Z-Taste + Nunchuk Y hinten -> de accelerate - entschleunigen mittelbar (Integrationssteuerung/relativ oder DirectDrive/absolut)
    3. Z-Taste + Nunchuk Y mitte -> hold speed - Geschwindigkeitsvorgabe halten (Integrationssteuerung), Motorfreilauf (DirectDrive)
    4. Z-Taste losgelassen -> Engine free run - Motorfreilauf (Integrationssteuerung/relativ oder DirectDrive/absolut)
    5. Z-Taste losgelassen + Hebel hinten -> -break - bremsen (unmittelbar Integrationssteuerung und DirectDrive)
    6. C-Taste + Nunchuk X neutral -> horn - Hupe (getastet)
    7. C-Taste + Nunchuk X links -> light - Licht (geschaltet)
    8. 3 x Z-Taste + Nunchuk X links -> Rabbit/Turtle switching - Geschwindingkeitsumschaltung Hase / Igel
    9. 3 x Z-Taste + Nunchuk X rechts -> Umschaltung IntegralDrive -> DirectDrive (gestartet wird mit IntegralDrive)
    10. Funkabriss -> Engine free run after Remote lost, Motor Freilauf

Some Parameters for Nunchuk control,
* like none linear acceleration
* direct drive, integral drive Mode, for smooth Nunchuk control
* Rabbit/Turtle (for German Police :-)), after power off, Turtle is default, switch to Rabbit is not known for all.
* Break Servo control, for Trampa hydraulic brakes.

Code: Select all

// Exponentialfunktion
#define YAchseExpNeg (float)              1.0 // Beschleunigungsfunktion 1 linear, 2 quadratisch (0.1..3.0, 1.0..2.0)
#define YAchseExpPos (float)              1.0 // Bremsfunktion 1 linear, 2 quadratisch (0.1..3.0, 1.0..2.0)
                        
// PWM Motorsteuerung
#define PWM_ObererStellWertMotorIgel 1.65 // Wert berechnen fuer obere Pulsweite Igel (ms Pulsweite) (0.0..2.5, 1.6..1.8)
#define PWM_ObererStellWertMotorHase 2.0  // Wert berechnen fuer obere Pulsweite Hase (ms Pulsweite) (0.0..2.5, 1.9..2.1)
#define LeerlaufOffset (uint32_t)      0  // Offset zum schnelleren Ansprechen des ESC bei inkrementeller Steuerung (0..65535, 0..300)
#define PWM_LeerlaufStellWertMotor   1.5  // Wert berechnen fuer Leerlauf (ms Pulsweite)  (0.0..5.0, 1.4..1.6)
#define PWM_UntererStellWertMotor    1.0  // Wert berechnen fuer untersten Wert (ms Pulsweite)  (0.0..5.0, 0.9..1.1)

// PWM Brems-Servo
#define PWM_Bremse_Ungebremst   1.0 // Servostellung ungebremst (ms Pulsweite)  (0.0..2.5, 1.0..1.5)
#define PWM_Bremse_Vollbremse   2.0 // Servostellung Vollbremsung (ms Pulsweite)  (0.0..2.5, 1.8..2.5)
#define PWM_Bremse_Exp (float)  1.0 // Bremsweg-Servo 1 linear, 2 quadratisch  (0.1..3.0, 1.0..2.0)

// Incremental Drive Parameter
#define BeschleunigungsDaempfung (uint32_t)  112 // Je groesser die BeschleunigungsDaempfung, desto langsamer wird inkrementell beschleunigt (ggf. anpassen)   (0..32^2, 0..250)
#define BremsDaempfung           (uint32_t)  80  // Je groesser die BremsDaempfung, desto langsamer wird die Bremskraft inkrementell aufgebaut (ggf. anpassen)   (0..32^2, 0..250)



@benjamin,
i think you need only some minutes to implement this feature request :D

barney
Posts: 22
Joined: 23 Dec 2015, 08:21

Re: Turtle/Rabbit mode with Nunchuk buttons

Postby barney » 01 Jan 2016, 17:07

@Benjamin

None Linear Joystick:

For smooth acceleration, this formula has quite suitable. This allows for smooth acceleration in the initial region. Still usable, the full acceleration available. I have separated acceleration and break.

Code: Select all

// Exponentialfunktion
#define YAchseExpNeg (float)              1.0 // Beschleunigungsfunktion 1 linear, 2 quadratisch (0.1..3.0, 1.0..2.0)
#define YAchseExpPos (float)              1.0 // Bremsfunktion 1 linear, 2 quadratisch (0.1..3.0, 1.0..2.0)


weight = 1..3 ; 1 means linear ... 3 very smooth

XnoneLinear = (pow(Xmomentary, weight)/pow(MaxX,weight)) * MaxX
Attachments
None Linear Joystick.png
None Linear Joystick.png (22.83 KiB) Viewed 3079 times

trbt555
Posts: 3
Joined: 21 Dec 2015, 12:52

Re: Turtle/Rabbit mode with Nunchuk buttons

Postby trbt555 » 10 Jan 2016, 17:07

I already had a post in "custom applications" about the reduced/full speed feature request.
I would have liked a toggle switch but I came across this thread and I think a software implementation on the nunchuck makes more sense.

Perhaps you could add a "reduced speed" parameter tot the BLDC tool, which would indicate which % of max ERPM is desired as reduced speed.

Then you could have a configuration process like the one described above, or perhaps an unlikely combination of buttons.
For example: push Z & C button together with joystick pulled back for toggling reduced speed/full speed.

E-CON
Posts: 6
Joined: 23 Dec 2015, 19:42

Re: Turtle/Rabbit mode with Nunchuk buttons

Postby E-CON » 14 Jan 2016, 09:47

Hi Benjamin, any updates so far? Is there a schedule plan? Would love to use this as soon as possible :)

benjamin
Site Admin
Posts: 280
Joined: 15 Dec 2015, 08:38
Location: Sweden
Contact:

Re: Turtle/Rabbit mode with Nunchuk buttons

Postby benjamin » 15 Jan 2016, 14:07

Not yet, I have been working on the FOC implementation and making the nrf nunchuk work better. I will let you know when I have some updates.

E-CON
Posts: 6
Joined: 23 Dec 2015, 19:42

Re: Turtle/Rabbit mode with Nunchuk buttons

Postby E-CON » 26 Jun 2016, 21:09

Push :)
Summer is coming in Germany, please implement something like turtle rabbit, this would be awesome! Current law: if your board is faster than 6kmph then police takes your board and destroy it :/


Return to “Feature Requests”

Who is online

Users browsing this forum: No registered users and 1 guest