EFeru / hoverboard-firmware-hack-FOC

With Field Oriented Control (FOC)
GNU General Public License v3.0
1.14k stars 945 forks source link

Non linear throttle in Torque mode #167

Open the2jakes opened 3 years ago

the2jakes commented 3 years ago

Hi Emanuel, thanx for your great work ! 😉👍

I have an issue, and other people have also noticed the exact same symptoms.

I use the skateboard variant, in torque mode, with a RC remote control and PWM receiver.

I’ve calibrated the throttle range by pushing the motherboard power button for 5sec (several times, and it didn’t solve the issue).

Issue: the throttle isn’t linear at all. At 20% of the remote throttle range I get 100% power at the wheels. Then from 20% to 100% nothing changes (same max speed/torque).

I don’t use Field Weakening anymore since I crashed when releasing the trigger from max to 70% and it suddenly decreased in speed (there is another issue on this, for which you identified what the issue is). But when I used Field weakening, I noticed it triggered itself at arround 90% throttle, which is normal.

It’s difficult to have a smooth ride with only the first 20% of throttle useful, it accelerates to fast with just a few mm finger movement. And strange to have this « useless » 20% to 90% range on the remote.

I have this exact same behavior with another RC remote and receiver. (Which work smoothly with my RC cars).

Moreover, I need to trim down my throttle range on my remote, otherwise when reaching 95% throttle I get erratic motor rotation (it stops, restarts, bip, as if I was sending a PWM signal that is over the acceptable range for the motherboard.

Same behavior with wheels in the air, and on the ground with load. (I know that with wheels in the air we sometimes get weird behavior with torque mode, so I tested everything by riding my skateboard.

To illustrate what I’m talking about, here’s a video: (Conditions: Torque mode motor settings: N_MOT_MAX 1200 I_MOT_MAX 25 I_DC_MAX 27

Field weakening disabled. Remote freshly calibrated in motherboard, WITHOUT reducing the Trim, so you will also see the eratic behavior near 100% throttle).

Issue video

I hope you’ll be able to solve this 😉, I’d love to get a smooth ride on my Hummerboard (which allready is a beast).

HummerBoard Offroad ride

Regards, The2Jakes

Candas1 commented 3 years ago

2 ideas to investigate the issue:

EFeru commented 3 years ago

@the2jakes let's try 2 things:

I remember you have 4 wheel drive. Is the behavior of the other set of wheels the same?

The eratic behavior at 100% seems like interference on reading the pwm from the receiver. This can be checked by debugging the input values that the mainboard is reading.

zulkep commented 3 years ago

I have the same problem, FOC TORQUE, how do I make the throttle dial smoother? when the current increases, the start and driving become very sharp, about 40% of the throttle, this is a full set of speed, then 40% there is no speed change, and 20% of the scale at the end turns on the field weakening ... Is it possible to turn on the coast in FOC SPEED mode? if it's important, two wheels 350 watts, tried changing I_MOT_MAX 10 I_DC_MAX 13, the start is smoother, but there is also a dip in the middle, I will try different modes and write

zulkep commented 3 years ago

I just tried to increase the weight of the scooter (I got up on it with the child), the load increased, the adjustment became smoother by about 60-70%, the failure was only at the end of the scale I_MOT_MAX 13 I_DC_MAX 15

the2jakes commented 3 years ago

Hi Emmanuel, I've done some tests. I think you nailed it when you talked about current calculation. I was running with: I_MOT_MAX 30 I_DC_MAX 35 because with default setting ( 15 / 17A) I was hitting max current limit every time I climbed a small hill, or did a rapid acceleration from static position.

Today I flashed the board with the same program but with: I_MOT_MAX 15 I_DC_MAX 17 When using the Skateboard on the ground, I get a smooth range of acceleration with the remote control (the all remote range I believe). When wheels are in the air it's visualy the same thing as before (wheels spind at max speed since I hit the 10% gas, which is "normal" I think because it's a Torque mode.

BUT:

I did another test, if it's of any help: I only activated the front wheels of the skateboard. With I_MOT_MAX 30 / I_DC_MAX 35, I noticed that I could use near 40% of the remote control trigger to control my speed. These matches with Zylkep test (increased the load on his scooter).

This control range has for sure something to do with Current... ;). Question: What is the max current I should set on I_MOT_MAX & I_DC_MAX to use the power I have/need, and not kill my motherboards ? (I've done a few very demanding runs at 30 / 35A setting, I didn't have any issue, but maybe it's a bit too high ?

Just to answer your other questions:

EFeru commented 3 years ago

When you hear the winning noise is indeed the current chopping kicking in. It is nothing to worry about but i can imagine it's not a nice feeling. You can set the I_DC_MAX higher apart from I_MOT_MAX to try to avoid the current chopping.

I will check in the model what max current is allowed from firmware point of view, I remember is 30A, but I will check.

For the board or motor, i heard people running it at 30A per motor, but i am not sure what is the duration. Because some of the mosfets are rated to 75A or even 100A or 110A, but is all about the duration. That's what kills them, because the heat sink cannot cool that fast. So in short bursts (in the range of few seconds) high current is usually fine but in long continuous operation it will most probably kill the mosfets.

PS: nice video on the group! :wink:

mrlunk commented 3 years ago

To make use of full throttle range on RC transmitter try changing the range in these lines from -1000 and 1000 to -4000 and 4000 Like this:

#define PRI_INPUT1 3, -4000, 0, 4000, 100 // TYPE, MIN, MID, MAX, DEADBAND. See INPUT FORMAT section #define PRI_INPUT2 3, -4000, 0, 4000, 100 // TYPE, MIN, MID, MAX, DEADBAND. See INPUT FORMAT section

This gave me near ful range trhottle on my Transmitter.
Full range should be -4095 to +4095.

Greetz,
Peter Lunk 
the2jakes commented 3 years ago

Thanx mrlunk, I’ll give this a try.

the2jakes commented 3 years ago

Guys, thanx Mrlunk, your tip worked ! 👍

I’ve put this:

define PRI_INPUT2 2, -800, 0, 3000, 100 // TYPE, MIN, MID, MAX, DEADBAND. See INPUT FORMAT section

First test I had put -4000, 0, 4000 and brake was much too weak, (maybe because the brake force is set to 450 in my config.h...) I kept -800 for brake range, and put 3000 for acceleration range.

I made remote calibration, and the test was a success. Range on remote is much better (hard to say to what extend, because as we control torque and not speed, it’s still hard to keep a certain constant speed, but this extended range makes it much easier to control the skateboard.

Thanks again ! The2Jakes

To celebrate this I’ve designed and installed the tail light 😉

19A2BDF7-128A-4424-A943-7E95A12740DB

zulkep commented 3 years ago

tried the spd mode, the scale of the regulators is more linear, with the settings I_MOT_MAX 13 I_DC_MAX 15 tried TRQ mode with settings I_MOT_MAX 18 I_DC_MAX 25 the knob scale shrank to 20%, full speed set before switching on the weakening, then a dip of 60%, 20% turning on the weakening of the field

zulkep commented 3 years ago

I still have the same problem, how to stretch the scale of the gas handle, can the filter be what it is? or add a filter? if I limit the revs, then the throttle stick only works at 5%, the other 95% is a useless move граф

kris86k commented 3 years ago

I'ts any new idea to make start more smooter in TRQ mode?

zulkep commented 3 years ago

smoother?

kris86k commented 3 years ago

I mean very high acceleration in first second. Its like kick. I need it for for ride-on mower, 4 wheel in tank mode. Meaby its better mode for tank mode?

zulkep commented 3 years ago

reduce SPEED_COEFFICIENT

kris86k commented 3 years ago

Can I add this parameter to ADC or change it in DEFAULT_SPEED_COEFFICIENT ? [edit] It's work but if I decrease acceleration in SPEED_COEFFICIENT torque is very low. Acceleration is very depend to load. I mean if no load start very fast if load 50kgs medium, if load 100kgs not start on full throttle. Its not problem at torque but this function decrase torque. I'ts way to high torque and low acceleration?