Hello Guest it is March 28, 2024, 11:05:51 AM

Author Topic: Digital scales as input?  (Read 4806 times)

0 Members and 1 Guest are viewing this topic.

Digital scales as input?
« on: October 18, 2006, 08:31:19 AM »
Hi!

I am new to this forum and -I have to admit- a complete Mach-dummy!

My main reason registering here is, that I have built an interface that connects to 4 "cheap chinese scales" and on the other end communicates with an PC over RS232.
What I'd like to know is, whether there is a way to integrate that interface into Mach. I tried to find that out but was more confused after than clueless before.

I know the scales are slow (30 values/second), but if you think they are of any use, I'd like to write some software plug-in or change the firmware if necessary. If only someone could push me in the right direction.

Thanks,
Nick

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: Digital scales as input?
« Reply #1 on: October 18, 2006, 08:47:19 AM »
I have no idea if this will work. I wonder if you could set those up as encoders in ports and pins? What kind of signal do those give?
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!
Re: Digital scales as input?
« Reply #2 on: October 18, 2006, 09:08:51 AM »
Quote
I wonder if you could set those up as encoders in ports and pins?

Would be quite a pain. The signal is serial, that's why I feel that some kind of software-plug-in would be best (if that is doable).

Quote
What kind of signal do those give?
Each channel (4 channels, one scale per channel) gives a response when asked (when a command to read is sent to the interface). The response is raw data (in hex) that needs some decoding (to interpret the flags coming from the scales etc.).
The response looks like this:
DRO#1L:<someHexData>

That data has to be converted into an integer and then scaled (20480 steps per inch or 100 steps per mm for an other type).
That decoding is currently done on an PC that works as a DRO.

Nick

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: Digital scales as input?
« Reply #3 on: October 18, 2006, 09:16:28 AM »
OOOHHHHH. That makes no sense to me. ??? I'm afraid one of the smart guys will have to help you with this one. I'm here for moral support though. ;D You came to the right place. A lot of smart people here.
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!

Offline chad

*
  • *
  •  361 361
  • When the going gets weird, the weird turn pro.
    • View Profile
Re: Digital scales as input?
« Reply #4 on: October 18, 2006, 12:38:56 PM »
Are you doing this in an attempt to get mach to close the pid loop for positioning? If so then sorry will not work, mach spends most of it's time worrying about a steady pulse train out to the motors. It doesn't have enough time to do high speed pid loops.
The other problem with using encoders on the axis and not the motor/servo is if there is ANY backlash in the mechanical then a pid driver will cause the motor to constantly hunt and eventually burn it out.

  If you just want to use these as a dro for manual machining then a plug in probably could be written just to display position but it probably would be easier just to write your own little dro app. 

Chad

Re: Digital scales as input?
« Reply #5 on: October 18, 2006, 02:38:20 PM »
Quote
Are you doing this in an attempt to get mach to close the pid loop for positioning? If so then sorry will not work, mach spends most of it's time worrying about a steady pulse train out to the motors. It doesn't have enough time to do high speed pid loops.
Yes, this was my intention.

Quote
The other problem with using encoders on the axis and not the motor/servo is if there is ANY backlash in the mechanical then a pid driver will cause the motor to constantly hunt and eventually burn it out.
Some algorythms can handle this, if they don't insists on getting exactly that position.

Quote
If you just want to use these as a dro for manual machining then a plug in probably could be written just to display position but it probably would be easier just to write your own little dro app.
OK. That app already exists. I just thought the interface could be used for loopback too.

Thanks,
Nick
Re: Digital scales as input?
« Reply #6 on: October 21, 2006, 04:52:15 PM »
You would need to code it up in a Plug In in VC 2003 :( Look at the SDK's on the forum for more info.

Thanks
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com