Jump to content

Firmware


jayjay23

Recommended Posts

On 14/09/2016 at 8:24 AM, changfrancis said:

Thank you for the shopping list, I've just order 2 of each but 1 programmer (I have another one).

I won't developp, but should be able to test and maybe debug

  • Upvote 1
Link to comment
Share on other sites

17 hours ago, changfrancis said:

I am setting up a small lab space for development, unfortunately i only have one set of motor and accessories.

I will need to use my daily driver EUC for development too. Currently, waiting for element14 to delivery some quick connector for me to quickly disconnect the testing board.

Btw, do you have the firmware from the original 30B4 ? Once i flash the development firmware, does it means that i will never be able to flash back the original firmware ?

I bought 3 x 30B4 boards for development. I also have 2 working EUCs with that boards (in total I bought 5 x 30B4 boards).
For motor, I am using one motor from an old generic. I have in total 4 motors with me but 3 of them on working EUCs.

There is no file for original firmware.

Link to comment
Share on other sites

@changfrancis I suggest you to try beep the buzzer first, then maybe doing some the printfs, after printfs of angle.
Trying to run the motor should be the last thing to try because of the risk.

I am using a potentiometer connected to J7 (please see the schematic electronics-gen2_boards) and powered from 0 to 3.3V from the LEDs connector header.

On main() loop I am doing:

    value = adc_get_potentiometer_value ();
    value = value - 2048;
    value = value * 1000;
    value = value / 2048;

    motor_set_duty_cycle (value);
    printf("pot: %d\n", value);

Where duty_cycle value is [-999 up to 999].

Edited by electric_vehicle_lover
Link to comment
Share on other sites

@electric_vehicle_lover

I am currently trying to wire up each of the wheels wires and leds (my wheel does not have similar connectors). By any chance you have the description/label for each wires on the board ?

i.e pin 1: LED1, pin 2 LED2, pin 3 LED3, pin4 LED4, pin 5 GND.

LOL, my old board have labels but i cant see the labels on 30B4

 

I guess i will continue the soldering tomorrow, it is 1030pm in singapore :(

TB2Pf9aXai5V1BjSspaXXbrApXa_%21%21357064409.jpg

I got this from the chinese website but it does not show the pin level config. I hope i can wire them up correctly.

Link to comment
Share on other sites

My 30B4 have labels for the headers but some labels are under the headers and so they need to be removed.

Please look at the schematic and follow the lines with a multimeter to verify which is what. You can always go and improve the schematic with more information and commit a new version of it.

Edited by electric_vehicle_lover
Link to comment
Share on other sites

@changfrancis please note:

when I do:
    value = value * 1000;
    value = value / 2048;

I could do simple value = value * 0,488 but on the STM32F103 the float operations are very slow when compared to integer operations (I did some tests and measure with oscilloscope). I want to force myself to do integer operations everytime possible. Just the control loop for balance control, that maybe can happen at each 1/100 second, may be ok for slow operations.
The code for future FOC/motor control/ current PIDs, etc, must be fast and so with integers if possible.

Link to comment
Share on other sites

@changfrancis, done!!

Here on the wiki page: https://github.com/EGG-electric-unicycle/documentation/wiki/MicroWorks-30B4-30kmh-controller-board-with-bluetooth

I also updated the schematic - please tell me if something is missing or wrong.

---

Schematic

Active component list:

  • 1x ASM1117 3.3v Linear Voltage regulator for 3.3v on Invensense 6050 and STM32
  • 2x ACS712ELCTR-05B-T (+-5 amps max) ma Hall Current Sensor on 2 separate Phases - To measure phase current
  • 3x IR2184s Gate Driver for Half Bridge. Built in fixed Deadband 1 for each N-Fet Pair
  • 2x XL7005A SMPS Max 80v input Output can be adjusted 1 is used to produce 15-20v for Gate driver IC's The other most likely produces 5-12v for Current sensors or maybe just the 1117 to produce 3.3v with minimal losses.
  • 1x Invensense MPU6050 (needs no introduction) 6Axis Accel/Gyro with nifity build in filtering
  • 1x STM32F103C8T6 ARM microcontroller

Header pins

The next pictures show the labels according to the previous schematic.

MicroWorks-30B4-headers_01-labels.png

MicroWorks-30B4-headers_02-labels.png

  • Upvote 2
Link to comment
Share on other sites

@electric_vehicle_lover Many thanks.

I just wired up my wheel to the board. upon power up I fried my switch LED as it did not check in voltage(60V vs 12V led :D, hahaha). After that I also saw magic smoke at the first capacitor 47uf near connector J1.

Everything else seem ok, will continue testing the board. hopefully by Monday i can start flashing the STM32.

 

Link to comment
Share on other sites

1 hour ago, lizardmech said:

I have 90% of the VESC working now, just have one PCB issue to solve that is screwing up mosfet switching. High speed high accuracy current sense appears to be the key to getting automated motor detection and FOC working in general.

Your current board is based on the Cortex4 and not on a R version? Is this plan withdrawn? We need this kind of solution for PLEV vehicle.

Link to comment
Share on other sites

M4 but it's just a small riser that fits on switching MCU is easy. I don't know if it would be worth while porting the entire VESC firmware for safety applications, it's probably better to have a smaller simple firmware without all the motor detection in it. I think instaspin and a few other commercial options are already safety certified so it's just a matter of making a small MCU board with a different MCU. You can always measure the motor specifications with an M4 board and write the specs into the firmware.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...