Touch Dro Fix For Igaging Absolute Dro Scales (i Hope)

I see... I haven't had a chance to look at his sketch yet (have been busy banging by head agains the wall working on the firmware update for the new Shahe scales).
This is more complicated than it needs to be. I would do the following:
1. Disable pull up resistors in the chip. I.e. leave the pins floating; if needed you can hard-wire unused pins to the round to avoid noise.
2. Add a +3V power supply (you will need this to power the scales). My choice would be the LM1117-3.3, but since the scales draw very little current, a voltage divider with 2K/3K resistors should work.
3. Pull up the lines to the scales Vcc using 20K (or even better, 47K) resistors

This will give you cleaner (more square) pulses. I don't have this scale, but the newer Absolute DRO+ you have to read on the raising edge and the data line goes up right before the clock line and raises very sharply. Comparator with built-in pull-up resistor slows down the raise time, possibly to the point where the data line might not go over the threshold fast enough.
If you *really* want to have an IC between the scales and the inputs, use a non-inverting buffer of some sorts. Those are purpose-built for this sort of thing and 3.3V to 5V ICs are very common.

If you go the comparator route you still have to power the scale and provide "virtual grounds" to the comparators, so you won't be saving any parts. Basically you will be building the circuit I linked in my previous post, except in your case you don't really need it.

As far as MSP430 vs. Arduino, I prefer MSP430 over Arduino because of the tooling. I use Code Composer studio with a proper FET, so I can do debug the code, halt the chip and inspect the registers, look at the memory, etc. MSP430 has more modern perhiperals as well, but the tradeoff is a HUGE learning curve. Unless you really want to invest a LOT of time into learning embedded programming in pretty low-level C, Arduino isn't such a bad option.

Hope this helps
Yuriy

Hey Brian,
Good to see you here.
this makes sense. The "doorbell" line seems similar to the "Req" line use by Mitutoyo SPC scales, which is used by the host to request reading from the scale. On the newer absolute scales this line can be just pulled to the ground and the scale will send the position at about 50Hz.
Regards
Yuriy

Hi Yuriy, good to see you're active here!
That line really is a Request line, only in reverse. I guess a more apt name would be Request-To-Read. On these particular scales, the read head is not exactly slaved to the display unit, more of a peer-to-peer type of arrangement. The read head has it's own on-board oscillator, so I have to assume the read head processor is not assumed to be synchronized with the display unit processor.

Anyway, I think Jimmy is building a proto-shield using the voltage dividers, so we should be able to find out in fairly short order if there are any issues with 3 scales connected at the same time.
 
Oh, for those of you that use the MSP430 platform (my personal preference).
No external voltage dividers will be required.
The code is easily converted over to the MSP platform, just takes a few tweaks. Once we get any issues ironed out, I'll port it over to that platform, but I can't say when. Best guess would be April or May (soonest).

As for these scales in general, I am not a fan. They only update about every .1 secs. You can travel a long way, even manually, in .1 secs.

I hope that everyone that has these scales and wants an actual DRO finds this useful!
 
Quick test update.
First attempt at the 3 scale test was a bust. I couldn't keep the Bluetooth module connected.
A little Googling later and it seems that this is a prevalent issue with the newer BT modules, not sure why.
Let me know if anyone has any insight to this issue.
Anyway, I'm starting a new design to try to alleviate this problem. I'm also planning for a USB corded option between the controller and tablet if problem persists.
 
We're not getting carried away just yet.
The algorithm to decode the absolute position has been solved, so this is now in Alpha testing phase.

We are working on the external circuitry required to make this all work, and we'll keep you updated as things progress.
 
Last edited:
Quick test update.
First attempt at the 3 scale test was a bust. I couldn't keep the Bluetooth module connected.
A little Googling later and it seems that this is a prevalent issue with the newer BT modules, not sure why.
Let me know if anyone has any insight to this issue.
Anyway, I'm starting a new design to try to alleviate this problem. I'm also planning for a USB corded option between the controller and tablet if problem persists.

Jimmy,
Are you sure this is a problem with a BT module? TouchDRO has a "feature" that will drop the connection if the parser doesn't get a valid data stream for more than 5 seconds. This is not a bug or a problem with the BT module. In my experience the HC-0x BT modules are pretty close to pullet proof. I've sold hundreds of boards and literally one person had a dud module, and I had probably 6 or 7 fail the initial test. The protocol itself is very resilient to noise, collisions, etc.
I will remove USB option from the app in a couple of releases. USB us actually exactly opposite - nothing but trouble. Android USB drivers for Arduino are implemented at a lower level than BT, so when USB craps out cant freeze the whole OS, requiring a restart.
I can't find a set of these scales, so can't test Brian's sketch directly, but my guess would be that with three scales something goes cross-wired and the chip isn't sending proper position data. Try using a basic BT terminal to see the data stream. You might be able to see something to point you in the right direction.

Also, to give Brian the credit he deserves: firmware development is insanely difficult precisely because you have to deal with all sorts of non-obvious issues. Arduino makes writing code easy by providing some abstraction, but reading three asyncronous scales, processing their data, sending it over UARD and doing that with bytes of ram and 16MHz ALU is still very non-trivial. For instance, I spent 4 weeks worth of nights and weekends on the update to my existing firmware to add support for the new Shahe scales. Two weeks of that went into finding a glitch caused by the MCU running out of memory and corrupting the configuration flags, and the tooling I have is miles ahead of what Arduino offers.

Hope this makes sense.
Yuriy
 
Thanks Yuriy!

Makes it even harder when I only have one scale to work with :D
 
Yuriy, I can't rule it out. It paired just fine with my tablet, but wouldn't stay connected to the App. A few times it would connect to the App for a few seconds and then disconnect. Most of the time it would connect and then immediately disconnect (<1 second).
I realized all too late that I'd used way to small of resistors in the voltage dividers. I also did a poor job of power management. I should have used the 3.3v Arduino pin to supply the scale Vcc lines instead of an additional 3 voltage dividers putting even more load on it. I plan to do that with Rev 1 of my Proto-shield.
The reason I'm thinking it may be the BT module power issue was during my initial troubleshooting of the problem, I ran into a bunch of posted issues with the newer HC-05's having disconnect issues that were mostly blamed on power supply problems. I can't confirm that it was indeed a power issue or not.
My USB statement wasn't intended as a solution. As I was going through all the settings during troubleshooting on my tablet and the App, it was then I first noticed the selectable USB option that had been added. I wasn't aware of all the potential problems with using it at the time and figured I try it as a last resort if I couldn't get the BT to stay connected. I reasoned if it worked with the USB corded option, it had to be something to do with the BT module.
I'm not sure if Brian mentioned it here or not, be he did have a successful run of his sketch using a single scale I loaned him and got good data to the serial monitor. My part now is to test it with 3 scales and see if it will mesh with the Touch DRO App.
 
Thanks Yuriy!

Makes it even harder when I only have one scale to work with :D
I'm surprised how rare these are. I even asked iGaiging directly if they had any for sale...
Yuriy, I can't rule it out. It paired just fine with my tablet, but wouldn't stay connected to the App. A few times it would connect to the App for a few seconds and then disconnect. Most of the time it would connect and then immediately disconnect (<1 second).
I realized all too late that I'd used way to small of resistors in the voltage dividers. I also did a poor job of power management. I should have used the 3.3v Arduino pin to supply the scale Vcc lines instead of an additional 3 voltage dividers putting even more load on it. I plan to do that with Rev 1 of my Proto-shield.
The reason I'm thinking it may be the BT module power issue was during my initial troubleshooting of the problem, I ran into a bunch of posted issues with the newer HC-05's having disconnect issues that were mostly blamed on power supply problems. I can't confirm that it was indeed a power issue or not.
My USB statement wasn't intended as a solution. As I was going through all the settings during troubleshooting on my tablet and the App, it was then I first noticed the selectable USB option that had been added. I wasn't aware of all the potential problems with using it at the time and figured I try it as a last resort if I couldn't get the BT to stay connected. I reasoned if it worked with the USB corded option, it had to be something to do with the BT module.
I'm not sure if Brian mentioned it here or not, be he did have a successful run of his sketch using a single scale I loaned him and got good data to the serial monitor. My part now is to test it with 3 scales and see if it will mesh with the Touch DRO App.

You might be running into a BlueTooth stack bug on the tablet side. There is a slight difference in BT implementation in different Android versions. What happens is that when the app detaches from the RFCOMM socket, the underlying driver should drop the connection. On some tablets this doesn't happen, and I didn't handle it in TouchDRO correctly. This happens only if TouchDRO drops the connection due to "no data" condition; when you click Disconnect button the app does the right thing. The symptom is that after "no data" disconnect happens, the app will connect briefly and disconnect right away. In this case you might need to do two things: force-stop TouchDRO app (from the Apps settings page). This works in 99% of the cases. On Android 4.2.x you might need to disable/enable BlueTooth. I fixed this in the new version, but it's still too buggy, so I can't give it to you yet.
Please let me know if this helps. If not, this page might be helpful: Troubleshooting Common DRO Connection Problems.
Regards
Yuriy
 
These are the Plus version. I contacted Anytime Tools several times and they confirmed that the photo is old, but the scales are new.
 
Back
Top