-
Calibration working
03/18/2015 at 18:42 • 0 commentsI decided that the flash size is not sufficient to allow internal calibration logic and now resorted to external calibration with a script and a sigrok-enabled multimeter. This allows for very accurace Least Squares Estimation and gets the accuracy to be pretty much spot on.
I'm happy with the project as is even though I can see many improvements that are possible to it but for now it is sufficient for my needs and I have other projects to attend to so I don't think I'll work on it so much from now on.
I'll still appreciate comments and especially patches or merge requests if someone fancies to work on this further.
-
PWM Accuracy Improved
03/02/2015 at 18:40 • 0 commentsI figured a way to get the full 13 bit resolution of the PWM and now I get the full value range. I figured that my timer counter being 8192 is just a shift of 13 so I can avoid overflow by not shifting up 13 and down 10 but rather just do the entire calculation with an additional shift of 3.
The ADC on the face of it is a lost cause, it is only 10bit accuracy so I only get a change every 8 values of the PWM. I need to look at ADC averaging, I started to think about it and wonder if it's worth spending time to do it. I currently take a snapshot of the ADC and need to average it out anyway but originally wasn't planning to use fractions in that average.
I did some code size reductions and the code is now at 7860 bytes. It was at 8100 beforehand and got down to 7600 and then the new PWM accuracy took more space. I kinda like the serial text interface but not sure how long I can hold on to it in its current verbose state.
-
Calibration of measurements
02/28/2015 at 20:32 • 0 commentsI've started to work on the calibration feature. It is shaping up nicely and improves somewhat the accuracy of the measurements but I'm still not getting to the level of accuracy that the original unit boasted (i.e. 0.01V and 0.001A).
The unit is however already usable as is, the alternative firmware can receive commands by serial and exhibit good control of the device that makes it possible to use it just fine.
The buttons still do not work and I don't do a great job with the display for now but these are features for interactive work and my main goal is the serial control anyway.
-
Small Improvements
02/25/2015 at 21:48 • 0 commentsToday I worked on improving the code and adding small but important (to me) features.
The first is automatic and manual commit of settings. It is now possible to tell the device not to auto-commit and then be able to change both voltage and current in a single motion by setting the voltage, then the current and then commiting both into action.
A configuration of the device options is now done automatically so it will be easier to deploy the firmware. This is an option that is required to be able to PWM control the voltage and current and it took me a while to figure out how to program the flash.
The last feature of today is saving the configuration to flash for persistency. This is a small feature by itself but important to make calibration of the device worthwhile since otherwise it would be needed to calibrate it every time it is started.
Along the way I improved the code to make it more manageable.
Next up, calibration of the device.
-
Basic functionality working
02/24/2015 at 05:29 • 0 commentsIt works!
I can now set the voltage and current through the serial and it actually sets the output to the right value (haven't validated current limit yet).
I needed to do proper calculation of the PWM values and for that there was a roadblock with integer overflows in the fixed point calculations. The initial setup for the current and voltage control was reversed.
I also had a roadblock where out of the two units I have both have some issue now with the top board, one doesn't display properly and the other can't control the output properly.
-
Current state of things
02/22/2015 at 21:56 • 0 comments- I do not control the Output Enable pin, but it doesn't seem to matter. No idea how it comes. It is always at 0V no matter what I do on the pin.
- I can control the 7-segment display and it shows data consistently and nicely
- I can control the CV/CC led, still didn't get to test CC condition to be sure of the full loop
- I can measure with pretty good accuracy the Vin, Vout and Iout based on the theoretical numbers. I didn't attempt to calibrate my own unit yet.
- I can control the PWM for the voltage and the current, this is not at all calibrate so the random I use and the output are off by a factor or so but it seem to work and only needs tuning
This is now pretty close to being a minimally functional serially controlled power supply. -
Fixed point parsing fixed
02/22/2015 at 18:11 • 0 commentsThe fixed point parsing was incorrect due to an overflow, I had to set the variable to uin32_t to get it to work properly. I also needed to fix a rounding error that made the numbers off by just a little bit. Now it works very well.
Now I need to work on the PWM calculation it is way off and makes no sense right now. Once I have the PWM working I will have essentially a working power supply that is serially controlled.
I still don't know how to read the buttons in their weird setup. But that will wait a bit more. Once I get the PWM working I'll work on getting the display properly sorted to display the different values.
-
7-Segment Display Works
02/21/2015 at 22:08 • 0 commentsI got the 7-segment display to work today, it lights up nicely and I have the bit patterns for all 10 digits done. It took some play to figure out how exactly to drive it even with the schematics that were reverse engineered by flex.
To fit the code I needed to also get rid of the floating point so I worked to convert all such operations to fixed point arithmetic and it saved me some 3KB of space.
Still need to work on the output power parts, I have an problem driving the output enable pin properly. Still not sure what I'm doing wrong.
-
Board Schematics
02/20/2015 at 12:49 • 0 commentsBoard schematics for the B3606 top and bottom boards were done by user flex on the EEVblog forum. This should help immensely with figuring how to drive all the components.
I've already managed to drive the CV/CC leds, partially successful with the 7-segment display. Still unsuccessful with the output enable part and the buttons.
I did manage to get the PWM sorted but without the output enable it doesn't help.
-
PWM working, Unit does not
02/18/2015 at 18:52 • 0 commentsI got the PWM code to start working, at least when viewed in a logic analyzer. When I tried to put the top board on the bottom board and see if it works nothing comes out. The output pin is toggled, the PWMs are running but no output comes from the device.
This may be also due to me wiring it once in reverse (the top board was upside down) so I may have destroyed it somehow. I'll try to debug this tomorrow with another unit that I have and see if and which part is damaged.