March 27, 2014 at 8:48 pm #21822
Wow! Your changes are so cool. Nice work. Yes the EBB firmware is open source, and I’m glad you found it. Prior to the most recent EBB firmware versions (2.2.3), there were bugs in the analog to digital code. It would sometimes work and sometimes not work quite right in prior versions. This would have affected the QC command. This has been re-written in version 2.2.3 and should work much better now.
As far as some of the other things you’ve seen – the QC command returns two values separated by a comma. The first is the analog voltage going into the REF_RA0 net. This value is directly controlled by the current adjustment pot. Looking at this first value allows the PC to read the maximum coil current that the user has set via the current adjustment pot. This is the voltage that you can measure with a DMM on TP3. With 0V on TP3, you should see 0 counts, and with 3.3V on TP3, you should see 1023 counts. Note that 0V on TP3 = about 46mA max coil current, and 2.58V on TP3 (about 800 counts) = about 1.35A of coil current.
The second value – after the comma – is a scaled version of the voltage on the M+ net (i.e. power input to the board via the barrel jack – after the diode D1 so there will be a diode drop in there.). This is so that the PC can see what voltage is being applied to the motor driver chips. The scaling factor is such that 0V on M+ should read 0 counts, and 31.4V on M+ should read about 870 counts. It should be linear.
I believe that both of these values are correctly measured in version 2.2.3 but I have not done very much testing since I didn’t think anyone was ever using this command! I’m so glad you are. Can you try out firmware 2.2.3 and let me know if the values seem to make more sense? If they don’t I need to do more work on the analog to digital converter code.
Note that EMSL correctly recommends NOT updating to any version beyond 2.0.1 (which is what EBBs are currently shipping with) because of issues with the pen arm not responding the same in newer versions as it does in the ‘official’ 2.0.1 version. I am working on figuring out why there is a difference right now, and will be releasing newer versions that attempt to perfectly mimic the 2.0.1 behavior. Once we test these fixes out and people agree that the newer version works just as well as the older, then we give folks the green light to use the newer versions if they have need for some of the newer commands or bug fixes.