vedderb / bldc

The VESC motor control firmware
2.08k stars 1.31k forks source link

Lisp app-adc-override wrong values #706

Closed Nikolai521 closed 4 months ago

Nikolai521 commented 4 months ago

Hi, today i tried the new Beta 6.05 (2024-02-01)

I use my 75100 via lisp with the 1zuna script for my scooter, after update everything seems fine, but i lost the ADC values, they are VERY low, just 0.1 to 0.8v max, after this i tried the previous beta and the values go back to normal without issues.

Looking from changes i noticed some changes in the adc-override from 2 weeks, I bet this commit caused the issue https://github.com/vedderb/bldc/commit/c5b8bb7febfc6e910c16a51ea279d19a425d5d37

This is the values from the newer beta: image

And this one is from 31/12/23 image

Gabrielerusso commented 4 months ago

I don't think there is any issue, the change was just to convert a value from 0 to 1 to simply cropping the value between 0 and 3.3, so you can't use the same code as before I think.

Nikolai521 commented 4 months ago

Probably, but now the resolution of these values are waaay to low

Gabrielerusso commented 4 months ago

now the resolution of these values are waaay to low

I don't understand how after that change the resolution get lower. Post a code example that gives you a "lower resolution". The picture you posted are exactly the value you used before, but scaled from 1 to 3.3, 0.5306V * 1/3.3 = 0.160788 that rounded is 0.1608, that means you are giving the wrong input to the override function. Before it was a value between 0 and 1, now is between 0 and 3.3 .

Nikolai521 commented 4 months ago

Actually is 1zuna code, you can find them on his repo https://github.com/m365fw/vesc_m365_dash/tree/6_05_adc

probably im going to record a video of the values, i cant explain well

Gabrielerusso commented 4 months ago

Actually is 1zuna code

Again it's not a vesc issue but the code you posted wasn't updated, don't record any video. If i can i will mache a branch and fix the @1zun4 repo.

Nikolai521 commented 4 months ago

Yea sure, also i tried to contact with him and i got no response, so some friends asked me to do it in the vesc repo

1zun4 commented 4 months ago

😩

Gabrielerusso commented 4 months ago

Yea sure, also i tried to contact with him and i got no response, so some friends asked me to do it in the vesc repo

https://github.com/Gabrielerusso/vesc_m365_dash/commit/589a7bfe49eec6579431dae9225cf1b6ba0f3938 you can find here the fix. When finished close the issue as it's not a VESC issue.

Nikolai521 commented 4 months ago

Now it makes sense! thanks c:

Gabrielerusso commented 4 months ago

Now it makes sense! thanks c:

Please report here, in my repo or in the Pull request if the fix actually works

Nikolai521 commented 4 months ago

Now it makes sense! thanks c:

Please report here, in my repo or in the Pull request if the fix actually works

image

Now i get more rasonable values, but the script crashes if release the controls, with the voltage stuck on the last value also i noticed it crashes just at 0.9974v (very near to 1) image image

edit: yep, it crashes just at 1, it works well under 0.9

Gabrielerusso commented 4 months ago

Now it makes sense! thanks c:

Please report here, in my repo or in the Pull request if the fix actually works

image

Now i get more rasonable values, but the script crashes if release the controls, with the voltage stuck on the last value also i noticed it crashes just at 0.9974v (very near to 1) image image

edit: yep, it crashes just at 1, it works well under 0.9

are you using the scripts from my repo? what are you using (m365 or g30)?

Nikolai521 commented 4 months ago

are you using the scripts from my repo? what are you using (m365 or g30)?

Im using the yours, specifically the m365

Nikolai521 commented 4 months ago

are you using the scripts from my repo? what are you using (m365 or g30)?

My error, now it works! image

i copied bad some lines :skull:

Gabrielerusso commented 4 months ago

i copied bad some lines 💀

When someone asks "Are you using the script from my repo" means the whole script, as for future reference don't do copy/paste mix-up or it becames impossible to track an issue.

Close the issue if it works.

Nikolai521 commented 4 months ago

Close the issue if it works.

Yup now works, actually it was my mouse, i moved it when i do the copy Closing c: