thinking of digging into 3D printing, can i just add a head to my CNC router?

More
23 Nov 2021 23:17 #227452 by travis036

andypugh post=227349 userid=723For a heater you would be OK with a 100Hz software PWM anyway.

i think i would prefer a LinuxCNC based PID, rather than an Arduino <=> Python <=> LinuxCNC based PID system. even if i use an Arduino just to get the temperature from whatever source. it would minimize the debug issues in getting the arduino PID to tune out right. i would just have to change a setting or two in a LinuxCNC config, test it, and move on. if the arduino ONLY handels the reading of the temperature, and reporting the temp to LinuxCNC via python, once it works, it works. no tuning and recompiling needed.
As the temperature is reported by the arduino between 0 and 255, i could formulate a packet of bytes, and even include some arduino analog readings, if using digital temp sensors, or a thermocouple module. never know when analog readings may come in handy ;)
i could even use the arduino to step up to a 16-bit ADC, and send a floating point value in the packet for more precision (if i find the need).

for instance, i could use an MCP9600 board from Adafruit, and a Type-K thermocouple to get some good and fairly accurate readings of temp. then it is just a matter of the LinuxCNC PID, and Mesa 7i80 output pins to control everything. and i can control the various fans with a PWMgen output too. the ideas are endless.
but i have seen no reference to using a LinuxCNC PID for temp control... wait, google found something this time round: www.forum.linuxcnc.org/10-advanced-confi...-temperature-control
will have a read and see what i come up with. :) (i love when google works correctly ;) )

~Travis

Please Log in or Create an account to join the conversation.

More
24 Nov 2021 00:00 #227457 by andypugh
This is the chip I was suggesting:
uk.rs-online.com/web/p/instrumentation-amplifiers/1923153/

LinuxCNC has a driver.
linuxcnc.org/docs/2.8/html/man/man9/max31855.9.html

Though I also have a bunch of these PCBs going spare which an Arduino Nano can be soldered to along with 6 of the MAX31855 chips:

 

I don't seem to be able to find the schematics or Gerbers, though.

 
Attachments:

Please Log in or Create an account to join the conversation.

More
24 Nov 2021 11:26 #227494 by travis036
Hmmm, i think i will try that :)
found these modules on Digikey: www.digikey.com/en/products/detail/maxim...MAX31855PMB1/3758888
i am not particularly good at SMD soldering, but those digikey modules may be a real possibility. :)
i will plan for this option, and when i can afford some of the digikey modules, i will get some. need at least 2, plus a spare (i always order spares, because you never know)

i see all pins are shared, except the data input pins... can i use any of my mesa 7i80HD-16 pins that are available? or are there specific pins i need to use?

so to confirm, if i have two on my 7i80, the hal would look like:loadrt max31855 personality=2setp hm2_7i80.0.gpio.024.is_output true
setp
hm2_7i80.0.gpio.025.is_output truenet spi.clk.in hm2_7i80.0.gpio.024.out max31855.0.clk.out
net spi.cs.in
hm2_7i80.0.gpio.025.out max31855.0.cs.out
net spi.data0.in
hm2_7i80.0.gpio.026.in_not max31855.0.data.0.in
net spi.data1.in
hm2_7i80.0.gpio.027.in_not max31855.0.data.1.inaddf max31855.0.bitbang-spi servo-threadand read max31855.0.temp-celsius.0 and max31855.0.temp-celsius.1 to get my temperatures? i may also want to read the faults and use some pyvcp indicators to detect faults, just in case.

but it looks very interesting... very interesting indeed! without the Arduino, there is less to attach to my LinuxCNC computer too, so less chance of an issue. it all just stays attached to my mesa.

Just found this too: www.adafruit.com/product/269 as the digikey module is a 3.3v module, and the adafruit module is 3.3v or 5v, as it has onboard level-shifters.
question: how long a wire run can i use for the thermocouple wire? and should i use twisted-pair, or is plain straight-wire (already run on my machine wire bundle) suitable to use?
I do have available an old "soft" CAT5 wire (likely stranded twisted-pair, or foil-wrapped-cotton twisted-pair... haven't checked) that i could cut the bad ends off of and run through the machine wire bundle, if it fits. i wish i had used larger cable drag-chain during the build...

~Travis

Please Log in or Create an account to join the conversation.

More
24 Nov 2021 11:54 #227495 by andypugh
The thermocouple needs to be thermocouple (or specific thermocouple extension cable) all the way back to the cold-junction, ie the MAX board)

In practice deviating from this only introduces as much error as the temperature difference between where the wire changes and the amplifier module.

The "magic" of a thermocouple is in the wires themselves, the end is purely an electrical connection.
The following user(s) said Thank You: travis036

Please Log in or Create an account to join the conversation.

More
24 Nov 2021 12:12 #227496 by travis036
so can i install the MAX31855 module on the machine, and run the digital wires to it over the cable bundle? i know SPI has a limited range, but i am unsure what the range is.
if needed, i could in theory step-up the voltage at the Mesa card end (or rather the circuit in between the mesa and transmission wires), and step the voltage back down at the other end... or use fiber-optics, even if only for the extruder hot-end. just some cheap plastic optical fiber for the clock, CS and data return... would be just 3 fibers, though the optical-fiber TX and RX ends are a little costly...
but just the same, there are ways around it if SPI cannot transmit over that much wire.

~Travis

Please Log in or Create an account to join the conversation.

More
24 Nov 2021 17:53 #227514 by andypugh
The bitbanged SPI is going to be running so slowly that I would imagine you could filter the heck out of it.
The following user(s) said Thank You: travis036

Please Log in or Create an account to join the conversation.

More
24 Nov 2021 17:54 #227515 by andypugh
Of course, if you want a _real_ project then you could write a driver for the MAX38155 using the Mesa BSPI module.....

Please Log in or Create an account to join the conversation.

More
24 Nov 2021 21:42 #227533 by travis036

andypugh post=227515 userid=723Of course, if you want a _real_ project then you could write a driver for the MAX38155 using the Mesa BSPI module.....

i can do amazing things with C++, but certainly not that amazing ;) oh, i could probably get it done, in a few years of struggle, and have it work almost great... but, not at this time ;)
my Python is even worse... i had to do a lot of research to figure out enough to get the little Arduino comm script working together, and then i was caught completely off guard when it actually worked the 27th time through... ;)
My native language is Arduino C++, as i call it. i can do amazing things with a ton of spaghetti code ;)

now, if you will excuse me, i have a perfectly good Arduino, that interfaces great with LinuxCNC, via Python, that i now need to find a new use for... ;) perhaps an Arduino powered power controller, that reports data back to LinuxCNC, just for something to do...

~Travis

Please Log in or Create an account to join the conversation.

More
24 Nov 2021 21:55 #227534 by andypugh

My native language is Arduino C++, as i call it. i can do amazing things with a ton of spaghetti code

I was teasing, mainly, as I guess you just want to get on with this. But if you can do Arduino you can certainly do HAL drivers. 

Here is a starting point, it's a HAL driver for a gyro using the Mesa UART (a very close relative of the Mesa BSPI).

github.com/LinuxCNC/linuxcnc/blob/master...sa_pktgyro_test.comp

An example using the BSPI (very similar) is:
github.com/LinuxCNC/linuxcnc/blob/2.8/sr...ivers/mesa_7i65.comp

I am not really suggesting that this is the way to go at the moment, just planting seeds....
 

Please Log in or Create an account to join the conversation.

More
25 Nov 2021 17:40 #227575 by travis036
i have looked through both code references, and i will take some time to digest how they work. maybe i can help out, maybe i won't figure them out. ;) either way, the experience will be interesting.
i understand the teasing, but planting seeds with me can either grow something great... or a corpse flower (looks great, but smells like death)... ;)

either way, it spurs the mind. :)

~Travis
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

Time to create page: 0.183 seconds
Powered by Kunena Forum