You are here

PAS function

6 posts / 0 new
Last post
sam.vanratt
Offline
Last seen: 1 year 7 months ago
Joined: 2018-11-18 14:09
Posts: 83
PAS function

Hello all VESC users

as I seem to be the only one using the VESC on a bike I'd like to know what I/O pins are still available for such a use? None seems predefined afaik apart form the ADC ports.

I've done a analogue PAS to throttle function build with two OpAmps, I'd like to get it into the digital age and code.

I'll buy another VESC V4.x to do the tests, as well as an STM32 JTAG programmer for the worst case. I've three different PAS (6 pole, 12 pole and a double HALL 2*12 pole) version at my disposal, so I guess all cases could be tested with it.

 

Cheers

Sam

 

 

parasole
Offline
Last seen: 3 years 10 months ago
Joined: 2017-11-08 09:50
Posts: 11

I am using but together with "forum controller" by Jenkie from pedelecforum.de 

Here is one interesting implementation but I have not tested yet thus don't know how reliable it would be:

https://github.com/derlucas/bldc

 

sam.vanratt
Offline
Last seen: 1 year 7 months ago
Joined: 2018-11-18 14:09
Posts: 83

Hi parasole

a similar (analogue) PAS to throttle is already used in my setup (like your forums controller), but Benjamin asked in his 2do list for a native PAS function to integrate into his software. I'm not a programmer so reading into code is nothing done on the fast lane for me. My (analogue) system works very simple (PAS via Trigger and decay+buffer and then multiplied with the Throttle signal) and must be easy to adapt as only three mathematical calculations are done. I'd like to help with this great project and my limited resources.

derlucas seems an easy and simple adaptable way; maybe Benjamin will look into it; the author is surely happy when it is used by another one and maybe it gets better this way.

Cheers

Sam

Pedelec usage in combination with a GoldenMotor MagicPie3 BLDC

parasole
Offline
Last seen: 3 years 10 months ago
Joined: 2017-11-08 09:50
Posts: 11

I did try derlucas firmware and found it useless, I could not make it working and beside that it looks like no any APP changes are saved in to the VESC.

It is very elegant solution considering LCD3 direct connection, however not yet finished and unfortunately no any updates from author nor he would answer the mails... 

 

 

Oli.Hall
Offline
Last seen: 2 years 1 month ago
Joined: 2020-06-16 16:08
Posts: 3

Hi Sam and Parasole,

Did you ever make any progress on a reliable PAS implementation to the VESC firmware?

Did anyone ever manage to contact Derlucas to find out what stage he got to with his fork?

Thanks,

Oli.

Oldbike2011
Offline
Last seen: 2 months 3 weeks ago
Joined: 2022-04-06 20:44
Posts: 1

I have a Mini Vesc 4.20 with broken mini usb connector.
I only have access via the SWD PIN and an STLink adapter. The firmware flashing works great.
After flashing I can operate the Vescsoftware via Bluetooth over UART port.

A friend programmed me the signal line for a quadrature PAS on ADC and ADC2. This has also worked already.
Problem: when I am connected to controller on a device via Bluetooth, and I select PAS as control sensor, there is no selection PAS+UART.
If I select only PAS, the communication is abruptly terminated. Logically, the BT adapter communicates via UART.

Actually it should run from the connections, if I select ADC and UART, only the software does not start the support for PAS although the connections fit.

When the Miniusbbuchse still went, I could make the engine run via laptop with the newly assigned PIN ADC/ADC2 and the selection PAS.

My research has resulted in the following solution :

Ok. I am not a professional. Please check my thinking .

In the first step my friend adjusted the hwconf/hw.h. The signal of the QuadraturPAS is now processed by the PIN ADC +ADC2.

Then I would have to select the App Application "PAS" in the Vesctool. So that the connection via BT (UART) still exists another adjustment is necessary.

To get around this you need to reassign the HW PAS pins (your friend has already done this)
And modify adc.c with the code to enable UART on the PAS app:

case APP_PAS:
app_pas_start(true);
hw_stop_i2c();
app_uartcomm_start(UART_PORT_COMM_HEADER);
break;

After that the PAS works on ADC + ADC2 and the controller is still reachable via BT.

Remind: I need the BT connection because my mini USB socket is broken.

Thanks for your help