Jump to content

Firmware


jayjay23

Recommended Posts

I have access to a super large 3d printer, will try to print (almost) a whole case in one piece from ABS sometime early 2016. ... but this discussion doesn't really fit here, shall we start a new thread for open source cases? I'll be more than happy to share my 3d models. I use rhino 3d for this kind of stuff, anyone else using rhino?

Link to comment
Share on other sites

I pushed the code that runs the motor using PWM complementary unipolar mode. It seems to run the motor with the same noise, I can't say if is better or worse.
Maybe later I can try to switch to the BEMF signals after some speed like 6km/h and try see if the motor runs more smooth.
I also measured with duty_cycle = 50%, the motor runs at 13km/h.

I want also to make velocity ramp and brake/regen ramp.

Link to comment
Share on other sites

I am following the various documents ST and others provide for BLDC motor control. I think that such library will not work and probably damage the board because this one is very specific and I don't have the technical information (nor knowledge) to pass to such application. Also I want to learn. I must say that it is taking much more time that what I expected but at the same time I am learning a lot. Also I am not alone :-)

Link to comment
Share on other sites

Driving brushless motors efficiently is pretty hard, and different motor typologies need different signals.  I know that there are existing implementations, but none for the exact types of motors used in EUC. Methinks that it would help this project to have someone with a good multi-channel DSO capture the different signals a commercial EUC uses to drive each phase of the motors. Just looking at the signals shouldn't create any problem with the open source state (unlike copying someone else's firmware, say), and would give the team a starting point for the necessary signals (in all cases: acceleration, steady state, balancing, regen braking).

Looking at this project from the outside, if I were working on it, my main concern would be to efficiently drive the motor. Everything else is, relatively speaking, straightforward. Driving the motor with high currents without damaging anything, that's hard. Once you can duplicate the motor drive signals, future improvements are easier.

Just my 2 cents from an outside observer (really interesting project, btw)

  • Upvote 2
Link to comment
Share on other sites

1 hour ago, robca said:

Driving brushless motors efficiently is pretty hard, and different motor typologies need different signals.  I know that there are existing implementations, but none for the exact types of motors used in EUC. Methinks that it would help this project to have someone with a good multi-channel DSO capture the different signals a commercial EUC uses to drive each phase of the motors. Just looking at the signals shouldn't create any problem with the open source state (unlike copying someone else's firmware, say), and would give the team a starting point for the necessary signals (in all cases: acceleration, steady state, balancing, regen braking).

Looking at this project from the outside, if I were working on it, my main concern would be to efficiently drive the motor. Everything else is, relatively speaking, straightforward. Driving the motor with high currents without damaging anything, that's hard. Once you can duplicate the motor drive signals, future improvements are easier.

Just my 2 cents from an outside observer (really interesting project, btw)

There's a fully featured open source BLDC driver with detailed motor control configuration software available. The only issue is it's STM32F4 based and 2 or 3 components are limited to 60v and would need to be replaced. From what I understand you need the F4s FPU for advanced motor configuration. But I haven't been able to get any information on the balance mechanisms. Do they need to be tightly integrated with the motor control or could you just send commands to the motor driver and have a separate MCU + gyro board connected via canbus?

Separating the gyro + and balance side from the motor drive also opens up some interesting options like using TI instaspin hardware to drive motors.

Link to comment
Share on other sites

1 hour ago, robca said:

Driving brushless motors efficiently is pretty hard, and different motor typologies need different signals.  I know that there are existing implementations, but none for the exact types of motors used in EUC. Methinks that it would help this project to have someone with a good multi-channel DSO capture the different signals a commercial EUC uses to drive each phase of the motors. Just looking at the signals shouldn't create any problem with the open source state (unlike copying someone else's firmware, say), and would give the team a starting point for the necessary signals (in all cases: acceleration, steady state, balancing, regen braking).

Looking at this project from the outside, if I were working on it, my main concern would be to efficiently drive the motor. Everything else is, relatively speaking, straightforward. Driving the motor with high currents without damaging anything, that's hard. Once you can duplicate the motor drive signals, future improvements are easier.

Just my 2 cents from an outside observer (really interesting project, btw)

Thanks @robca!
Yes, I am find very difficult to "understand" the motor and be able to correctly drive it including the circuit or it will just burn.
I think I will focus more on having a robust motor code and good interface so others can program safely.
At least, right now we have pictures of the motor internals that may help to understand it: https://github.com/generic-electric-unicycle/documentation/wiki/Motor

Link to comment
Share on other sites

1 hour ago, electric_vehicle_lover said:

Thanks @robca!
Yes, I am find very difficult to "understand" the motor and be able to correctly drive it including the circuit or it will just burn.
I think I will focus more on having a robust motor code and good interface so others can program safely.
At least, right now we have pictures of the motor internals that may help to understand it: https://github.com/generic-electric-unicycle/documentation/wiki/Motor

The problem is many of the motors are slightly different. If we had self balancing code ready we could use more powerful dev boards to analyze each model of motor and generate motor control code. Then you could possibly port the code back to the stm32F1 by hand. Depending on how complicated the motor tuning process is doing it well by hand might be near impossible. If I had to guess the manufacturers probably hook up the motors to a pc or more powerful STM dev boards, run configuration programs then flash the code onto the STM32F1 chips.

Link to comment
Share on other sites

I corrected the ADC code using DMA. Now I have a potentiometer on PS_signal pin that controls the duty-cycle of the motor. Max potentiometer is about 40% duty-cycle. Please see how the motor works on this video I recorded:

 

Here is a picture of BEMF signal at STM32 pin (yellow) and the hall sensor signal, at a low speed:

NewFile13.jpg.c123380f3613e73d0dbf0e6659

1 hour ago, lizardmech said:

The problem is many of the motors are slightly different. If we had self balancing code ready we could use more powerful dev boards to analyze each model of motor and generate motor control code. Then you could possibly port the code back to the stm32F1 by hand. Depending on how complicated the motor tuning process is doing it well by hand might be near impossible. If I had to guess the manufacturers probably hook up the motors to a pc or more powerful STM dev boards, run configuration programs then flash the code onto the STM32F1 chips.

Ok but I am not going on that direction for now.

NewFile13.bmp

  • Upvote 1
Link to comment
Share on other sites

I were looking at the signals on original controller and seems that there is 2 ways to control the motor, at kind of low speed and higher speed. I put many screenshots of oscilloscope on the wiki here: https://github.com/generic-electric-unicycle/documentation/wiki/Controllers

I still can't understand how it works... the relation with the hall sensor signals. Also the 3 phases seem to have the signals in phase so I don't know how current can flow... also can't understand why 50% duty-cycle is stopped wheel and higher or lower to invert the rotation...

Please look at the information and help: https://github.com/generic-electric-unicycle/documentation/wiki/Controllers

Link to comment
Share on other sites

2 hours ago, electric_vehicle_lover said:

I were looking at the signals on original controller and seems that there is 2 ways to control the motor, at kind of low speed and higher speed. I put many screenshots of oscilloscope on the wiki here: https://github.com/generic-electric-unicycle/documentation/wiki/Controllers

I still can't understand how it works... the relation with the hall sensor signals. Also the 3 phases seem to have the signals in phase so I don't know how current can flow... also can't understand why 50% duty-cycle is stopped wheel and higher or lower to invert the rotation...

Please look at the information and help: https://github.com/generic-electric-unicycle/documentation/wiki/Controllers

Sensor and sensor less operation?

Link to comment
Share on other sites

@Алексей, I think you mean the start of the motor. And I don't think that is the case because motor runs up kind of medium speed and here is an example:

phase_and_hall-low_speed.bmp

On that picture, yellow is a phase and blue a hall sensor. And zooming the the phase signals, on this case 2 phases:

phase_1_and_phase_2-wheel_rotating_right

Yellow and blue are 2 phases. Here the motor were rotating at a medium speed and at this speed the hall sensors signals are good.

Please see more here: https://github.com/generic-electric-unicycle/documentation/wiki/Controllers

Link to comment
Share on other sites

The motor have 3 phases. You used only 2. You have to make picture of all phases and Hall sensors. 

Recently my motor to vibrate due to the problems of one of the phases. At high speed motherboard did not see the signal of one of the Hall sensors and vibrating like a hammer under his feet .

Phase  have Switching correctly.
Edited by vezu4iy
  • Upvote 1
Link to comment
Share on other sites

Make some pictures: phases A and B, A and C, B and C, B and A. Use all combinations between phases and all Hall sensors. It used all sensors.

And check the resistance between the input phases of the Hall on the motherboard and the ground. Perhaps there is a drawdown  
Perhaps it is faulty .
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...