Use PWM to control your Jebao DCT pump using brushless motor controller from ebay

ok - I know I'm sometimes the one with the crazy ideas, so....

anyone considered hacking into the Jebao MCU and reprogramming it?
 
unless we know what the mcu is and the source code, it will be impossible to do.

I am busy working on my diy controller project, so I have not even wired up the basic circuit for the motor controller. I might do it sometime this week.
 
Most of these controllers have no protection or security...

hacking assumes trying some basic protocols until something comes up. clearly not a skill most of us possess...

but someone might
 
even if one is able to get the binary code out,you still need to decompile it and you are still limited by the hardware design. with the amount of work needed, you might be better off building your own design where you have 100% control of what you want to do. so even if it is theoretically not impossible to do, it will be infeasible to do.
 
Also, most 8bit MCUs are pretty good on code readback protection. If we figured out what it is (guessing PIC or a mainland 8051 variant), dumping the code is usually fused away at programming. I don't think they'd forget that step if they went through the trouble of running the MCUs through the belt sander ;)

Any comments on my Arduino signal hookups? I'm basically ready to pull the trigger on those boards.


Sent from my iPhone using Tapatalk
 
Please give me a +1 on my pull request ;)

I think this looks fine, got caught up with unrelated house plumbing projects in the interim. I'll give it another go around and click some buttons.
 
got some time to draw initial schematic.
the driver circuit is same as in stock jebao controller.
I will try connecting the bemf signal directly back to the Arduino and see if that works. I'll add the LM339 if it does not work.

schematic0808.png~original


I am using an ebay buck converter for now to convert 24v to 5v.
I have not powered up the circuit yet. I will write a simple Arduino program to go through the commutation steps on fixed time. Once I see the signal is ok, then I'll use it to drive the FETs.

IMG_2067.jpg~original
 
Last edited:
I've decided to use the LM339. I figure it could off load ADC work from the Arduino. I used the same circuit as jebao controller, except I adjusted the resistor divider values so it will work with LM339 powered at 9V. I want the controller to work at 12v as well for battery backup purposes.

I am deciding whether to use LEDs to display status, or use an OLED display. There is a bit more flexibility obviously using OLED display, but those darn things are still so expensive at $8-$10 apiece.
 
I wrote a test program in Arduino to generate / simulate the motor drive signal.
The low side driver is running 70% pwm at 15.625khz on Arduino signal. On stock controller, it is about 15.28khz.

I just found out the commutation sequence for forward direction is counter clockwise.

I am generating a tach signal on one of the Arduino pins. For every commutation cycle, I will toggle that pin. I think it takes 2 commutation cycles to make one revolution, so that makes it one pulse per revolution. From the timing measurements, it looks like the pump is spinning at about 2350 RPM at 70% duty cycle (lowest setting on controller).

this is the Arduino signal I captured on logic analyzer
AVRsim.png~original


compare to stock controller signal
stockforcompare.png~original


I need to go back to the parts store to get some more resistors, then I can test running the Arduino signals connected to the FETs. Once I see the FETs signal looks right, then I will hook up the pump. I need to create a startup sequence routine first.

Currently, the drive signal is advanced on fixed time. The tricky part is to switch that over to use the BEMF signal to advance the commutation sequence.
 
Last edited:
When driving the actual pump you'll likely want to speed ramp it as well to get it moving. Looking good so far.
 
that is certainly an option. just a black box that receives pwm signal from a controller. It also has a direction input so it can be used with crossflow or gyre, but that is not as useful since the reverse on these pumps does not do much for the cost of using one additional variable speed port on the apex. Adding push button and led lights does not add too much more work or parts cost. The led can display the pwm% value.

I also will add a way to calibrate the pwm input, so even if your pwm at 100% is only coming in at say 4.5v, once calibrated, the controller will map that to 100% pwm so the pump is not underperforming due to bad pwm input.
 
Can the calibration work for 0-5VDC? In case it's 4.5V, can that be calibrated to 100%?

if you calibrate with a signal that goes to 4.5 only then later that becomes 5, it will still work. anything above 4.5 will just register as 100%

note than the pump is not guaranteed to spin at pwm less than 50%, jebao used a safe value of 70% as lowest setting.

I suppose I can add another calibration to determine the lowest setting your pump can turn, then add a few more percent for safety margin. This way, your lowest setting can be say, 60% instead of fixed at 70%.

Once lowest setting is calibrated, then the range is split into 10 equal parts so you can increment from setting 1 to 10.

There is no need to split hairs and use 10bit pwm, the pump really does not respond that well to high resolution. just 10 equal intervals works fine.
 
so I found a bunch of 595 shift register chips in my components pile and decided to add it to the controller circuit. it ended up damaging the Arduino nano because the darn 595 does not have the same pinout as 74hc595. the chips I got were tpic6c595. I think my wiring shorted the supply to gnd. anyway, I got a second Arduino and wired the 595 correctly and everything now works.

I think I can still repair the Arduino by replacing the 5v voltage regulator. I just ordered a few more Arduino nanos for spare.

I am using one of those 5 way tactile switch since space is going to be limited. I can use only 1 analog pin to read the 5 different switch settings.
s-l500.jpg


I should be able to completely wire up the controller by this weekend.
 
Back
Top