Welcome! Log In Create A New Profile

Advanced

Generation 7 Electronics Development

Posted by Traumflug 
Re: Generation 7 Electronics Development
October 13, 2012 05:35PM
It's an Pololu programmer. Baud rate is set with -b, -B sets an SPI delay. I'll have to re-check wether all the connections on the PCB are right. Tomorrow smiling smiley


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Generation 7 Electronics Development
October 14, 2012 08:19AM
D'oh :} MOSI and MISO are swapped in the above layout, which is wrong for a bus-type connection, of course. Now reading fuses works fine, let's go on to the next step. smiling smiley


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Generation 7 Electronics Development
October 20, 2012 05:06PM
While I think I've got it now regarding V-USB I'm still looking for a solution for a related problem:

The ATtiny uses two pins for USB and 3 pins for SPI. Makes 5 pins. So far so good, characters can be received over USB and forwarded to the ATmega.

The gap I'm trying to close is talking to multiple SPI devices. Not only to the USB-adapter-ATtiny, but also to SD cards and/or displays. While I currently don't have an SD card adapter, this wish undoubtly arises one day and this ATtiny45-based setup should be able to deal with this.

The usual way to deal with multiple SPI devices is to use a chip select line (CS). But the remaining pins on the ATtiny are used for Reset, 5V and GND. The Reset pin can be programmed to act as an I/O pin, but then it's no longer possible to program this chip again (except with high voltage programming).

Any ideas for a good strategy?


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Generation 7 Electronics Development
October 22, 2012 11:15AM
Boah, this V-USB is a tricky and sensible business: [forums.obdev.at] and [vusb.wikidot.com]

Good news: the USB device is now recognized by Ubuntu Linux. Next step is going on to make it a proper serial (CDC) device.

If one wants to play, too, sources and layouts are on Github. I can also send you a PCB.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Generation 7 Electronics Development
October 23, 2012 03:43PM
The 2313 costs almost the same as the 45 but with extra pins and a serial port if direct connection to the serial port at 38400 was desirable. A little bigger, but with those extra pins you were looking for.
Re: Generation 7 Electronics Development
October 24, 2012 06:52AM
The 2313 also requires an additional crystal and RS-232-type serial communications are slow anyways. The required pin is on the ATtiny45, the only problem currently is, it allows uploading a firmware to the ATtiny only once. Once the reset pin is set to act as I/O, it can't any longer be used to initiate low voltage programming.

Ways out include:

- use a bootloader on the ATtiny: [www.mikrocontroller.net] (it's just 48 bytes)
- make a simple device to reset the ATtiny using high voltage programming: [mightyohm.com] or [sites.google.com] or [www.elektronik-labor.de]
- use the brown out detector instead of the reset pin for low voltage programming

Today I'll investigate the third of these options. Having the BOD at 4.3V and reducing supply voltage to 4V should cause a reset condition, allowing to change fuses.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Generation 7 Electronics Development
October 25, 2012 08:32AM
Quote

- use the brown out detector instead of the reset pin for low voltage programming

Doesn't work, unfortunately. Lowering supply voltage makes the Reset pin go to low, but apparently other parts of the chips are disabled by the BOD as well.

Next step is looking into a bootloader.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Generation 7 Electronics Development
October 31, 2012 06:32AM
After quite a number of commits to make code "working out of the box" meet my quality requirements ( = actually working), the USB part is in good shape now.

This tiny ATtiny will be programmed threefold. It'll act as

- a bootloader to reprogram it's self,
- a programmer for the AVR/LPC chip, allowing uploading controller firmware (without a bootloader on the main chip, so factory fresh chips can be used),
- a serial device.

Sounds much work, but I think these three are similar enough to allow much code re-use.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Generation 7 Electronics Development
November 02, 2012 11:50PM
Today two things happened:

1) Gen7 was split into an AVR and an ARM version: [github.com]

2) I've learned these LPC1114 (ARM) chips are not programmed via SPI, but via RS232-type serial. A bootloader is already built in and a secondary bootloader would cost at least 4kB flash ... and require serial for initial programming anyways.

After 2) I was suddenly sick about the ATtiny-based solution. For programming, 4800 baud would be acceptable, but for normal operations? Probably not. And the ATtiny can't do both, serial and SPI. So I traveled through the net again and found this picture:

[mcs.uwsuper.edu]

The middle one is this well known FTDI chip, to the right the slightly cheaper CP2102 and to the left ... look at this pin spacing!


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Generation 7 Electronics Development
November 04, 2012 05:32AM
Regarding "all through hole" vs. fine grained SMT technology:

I think the difference in opinions is mostly wether people accept the electronics to be part of the machine to be built or wether they consider electronics to be a vitamin. Many shy away as soon as they hear a soldering iron has to be heated up.

Nevertheless, making an electronics from parts is usually a rarther smooth experience. Learning soldering isn't that hard, even if I have seen some Gen7s with cold solder joints all over the place. Once these joints were re-soldered properly, everything was as simple (or as complex) as with a readily built electronics.

The funny thing about RepRap is, there are so many, mostly independent wings.

Looking at the wiki, there's apparently a spanish speaking gorup which makes some 70% of the edits there and comes up with a new machine design almost every day: [www.reprap.org] (scroll down the page, you'll be amazed!)

Then there is this wing on IRC, which has apparently some connections to bath university. They try to help people by telling the details to every single person coming along. Telling, like "click here" or "enter this value there", but rarely explaining what's actually happening so people can do their own decision. They have these "quick answers" and are pretty good at giving them.

On IRC are also some of the more quiet software makers, like the coders of slic3r or Marlin. When not on IRC, they mostly communicate by blogging.

In the public, Adrian Bowyer is the hero and RepRapPro is the single trustworthy shop to purchase RepRap stuff from. No further distinction, no mentioning Adrian "only" sells what others in the community developed.

Also this forum wing, of course. People here are sometimes pretty heated. Nevertheless, most of the carefully thought discussions appear here.

And then there is this invisible 90%. You'll see these 90% when you have something to sell. They read the wiki and direct questions directly to the seller. Rumors are, this broke the neck of some sellers, because suddenly they had to actually know what they're selling ;-)

Back to topic:

I think hackability is important for the future of RepRap. Also the ability to make things DIY. This is what distinguishes RepRap from the big commercial companies like Stratasys, 3D Systems, HP. For electronics, this usually means through hole parts. The exemption is possibly this rare SO package, a SMT package with 1.27 mm pin spacing.

Also I'm a bit concerned when seeing the recommended developer IDE for ARM chips is based on Eclipse. Waaay to overwhelming for beginners. I didn't look into what Arduino does for it's new ARM variant yet. Hopefully they get it down to something as simple as the Arduino IDE for AVR chips.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Generation 7 Electronics Development
November 05, 2012 07:04PM
When reviewing the Gen7 circuitry for the supply voltage change coming with the ARM variant, I came across an interesting bit:

[reprap.org]

To me, this looks like the temperature readouts can be made a lot more accurate by the simple change of an EUR 0.01 resistor.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Generation 7 Electronics Development
November 05, 2012 07:07PM
> Back to topic:
>
> I think hackability is important for the future of
> RepRap. Also the ability to make things DIY. This
> is what distinguishes RepRap from the big
> commercial companies like Stratasys, 3D Systems,
> HP. For electronics, this usually means through
> hole parts. The exemption is possibly this rare SO
> package, a SMT package with 1.27 mm pin spacing.
>
> Also I'm a bit concerned when seeing the
> recommended developer IDE for ARM chips is based
> on Eclipse. Waaay to overwhelming for beginners. I
> didn't look into what Arduino does for it's new
> ARM variant yet. Hopefully they get it down to
> something as simple as the Arduino IDE for AVR
> chips.

While I don't disagree with you, please allow me to play devil's advocate:

By limiting ourselves based on what is appealing to the beginner, are we doing the best job that we can in promoting Reprap?

Would the project and its community be better served by developing more complex control strategies? If so, then we likely need more complex controllers, which likely cannot be implemented in DIP.

Would the project and the community be better served by the approach that cost is king? If that were the case, then mass manufacture would be the only option.

What about expandability? How do we ensure that users can make their 3x Extruder repraps work, while not unduly increasing the cost of the 1x Extruder repraps?

Just some miscellaneous thoughts. Please don't take them too seriously.
Re: Generation 7 Electronics Development
November 05, 2012 07:11PM
Traumflug Wrote:
-------------------------------------------------------
> When reviewing the Gen7 circuitry for the supply
> voltage change coming with the ARM variant, I came
> across an interesting bit:
>
> [reprap.org]
> _Thermistor_Voltage_Divider
>
> To me, this looks like the temperature readouts
> can be made a lot more accurate by the simple
> change of an EUR 0.01 resistor.

For the cost of two resistors, an LED and a transistor, you can have 100% resolution across the measurable range. All you need is a current source to feed the thermistor.
Re: Generation 7 Electronics Development
November 06, 2012 06:26AM
Quote
Annirak
For the cost of two resistors, an LED and a transistor, you can have 100% resolution across the measurable range. All you need is a current source to feed the thermistor.

Could you elaborate what you mean here?

I'm aware a super cheap 1N4148 diode can be used for measuring temperature: [thomaspfeifer.net] (thanks for the link, VDX). It would even bring down the thermistor table of the firmware down to a "table" with just two entries. But how would we convice the hotend makers to put a diode into their work instead of a n thermistor? Unless prominent people like Prusa or Adrian are promoting this, I don't see a chance.

Quote

By limiting ourselves based on what is appealing to the beginner, are we doing the best job that we can in promoting Reprap?

The art is to not develop a limitation here. Even experienced users prefer appealing things and that doesn't inevitable lead to a limitation.

Quote

Would the project and its community be better served by developing more complex control strategies? If so, then we likely need more complex controllers, which likely cannot be implemented in DIP.

So far I see nothing what a RAMPS (the current most plentiful featured AVR controller) can do what a Gen7 can't. Same for the 4pi. Setting the ARM processor aside, it has just more multiples of the same technology. 5 MOSFETs instead of 2, 5 stepper drivers instead of 4, and so on.

Quote

Would the project and the community be better served by the approach that cost is king? If that were the case, then mass manufacture would be the only option.

The interesting thing is, mass manufactured controllers are _not_ cheaper than DIY'd ones. Gen6 is such a controller designed for mass manufacturing; Melzi, too. Neither of them is cheaper than a Gen7, much less so much cheaper giving up replicatability would be a benefit.

This might be surprising, as a much more complex Rasperry Pi can be bought for $25, while a less complex Gen6 costs five times that much. Mass production also requires huge numbers and RepRap dosn't allow this. Because every few months the designs are changed, new experiences are made.

Quote

What about expandability? How do we ensure that users can make their 3x Extruder repraps work, while not unduly increasing the cost of the 1x Extruder repraps?

That's why a Gen7 has an extension board connector. Have the basic features on board, plug in the additions.

Quote

Please don't take them too seriously.

These are valid thoughts. As you see, I can answer them, because I thought much of them, too.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
VDX
Re: Generation 7 Electronics Development
November 06, 2012 07:43AM
... in my previous employment we used NI200's and PT100's for measuring and setting/controlling the temperatures of high precise gas sensors with an accuracy of 0.001 centigrades and temperature ranges up to 600 centigraes (with the PT's) ... but here we had C51-micros and AD-converters with 16 or 24Bits resolution.

If someone wants/needs the specs and PID-codesamples - I should have most of the data in my old backups ...


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Re: Generation 7 Electronics Development
November 06, 2012 10:28AM
Quote
Traumflug
Quote
Annirak
For the cost of two resistors, an LED and a transistor, you can have 100% resolution across the measurable range. All you need is a current source to feed the thermistor.
Could you elaborate what you mean here?

Sure. You already know this part: half of the problem with using a thermistor is that a variable resistor and a fixed resistor produce a non-linear curve as the variable resistor is adjusted. The slope changes as the magnitude changes, which means that you have to solve this equation:

V2 = V1*R2/(R1+R2) for R2 in order to measure R2. That gives you R2 = R1*V2/(V1-V2), so that R2 is not linear with respect to V2. As a result, you end up tuning the circuit to give optimal results at a particular range of R2.

Now, for the part I was talking about. What if you didn't have to solve that equation? How do you make R2 linear with V2? With a current source.

The attached schematic shows the method. The setpoint current (Iset) for the thermistor (Rtherm) is (Vf_led - Vbe)/Rset. Rbias should be about (Vdd-Vf_led)*Hfe/(2*Iset).

This gives you a linear reading of the thermistor. Then all you need to calculate is the temperature from the thermistor resistance.

One of the problems with this circuit is that the drop across the current source is roughly Vf_led. Because of that, picking a LED with a small forward drop is important. You could use a silicon diode and a schottky diode in series, but that increases the cost. You could also replace the LED with a reverse-biased zener, or a pair of silicon diodes. I like the LED because it's a low voltage drop and it amuses me to use an LED for a non-light-emitting purpose.
Attachments:
open | download - thermistor.PNG (17 KB)
Re: Generation 7 Electronics Development
November 07, 2012 08:04AM
Thanks for the hints, Annirak. German Wikipedia shows an arrangement without this LED: [de.wikipedia.org]

Difficult decision wether adding a bit of hardware complexity and thus introducing additional chances for failures is worth the change. People are pretty used to use thermistor tables these days. I think I'll postpone it until the transition to ARM is done.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Generation 7 Electronics Development
November 07, 2012 12:04PM
Traumflug Wrote:
-------------------------------------------------------
> Thanks for the hints, Annirak. German Wikipedia
> shows an arrangement without this LED:
> [de.wikipedia.org]
> it_Bipolartransistor
>

The most important thing in a current source is increasing the output resistance--that is preventing the current output from varying with load voltage. With this current source design, the current is determined by the voltage at the base and the emitter resistor.

The resistor design has less power supply immunity and lower output resistance. That may or may not be relevant for this application.
Re: Generation 7 Electronics Development
November 10, 2012 10:57AM
This is the current state of development of the Gen7 ARM version. Almost a void, this board, he?



I'd expect it to work this way. As there are only two pins left for selecting SPI devices, and none of them is PWM or analog input, I think I'll add in a shift register for the stepper's DIR pins to free up pins for the extension board. At least I don't see how one can hook up an SD card reader as well as a display and a second extruder with only two pins smiling smiley


Generation 7 Electronics Teacup Firmware RepRap DIY
     

Attachments:
open | download - Gen7Board-ARM.png (11.6 KB)
Re: Generation 7 Electronics Development
November 10, 2012 09:46PM
Here we go:



Four of the pins of the register are connected to the stepper driver DIR pins, the other four remain available. This also frees up three pins on the microcontroller which can do PWM or ADC along with digital I/O and another digital I/O pin.

Now we have free:

- four shift register digital I/O pins
- three digital I/O pins
- three digital I/O / ADC / PWM pins
- and SPI, of course.

This should be sufficient to hook up fans, displays, SD cards and whatever is on the wishlist.

Still missing in this layout: endstops and, well, the extension board header to make all these free pins available.


Generation 7 Electronics Teacup Firmware RepRap DIY
     

Attachments:
open | download - Gen7Board-ARM.png (12.7 KB)
Re: Generation 7 Electronics Development
November 12, 2012 05:32PM
Looking good so far!

I have done a preliminary port of teacup to a couple of ARM targets, namely LPC1114 and STM32F051. I am using ChibiOS, mainly for its lightweight HAL. Any targets supported by ChibiOS should be an easy port, I think there is some linited support for AVR port as well, could be possible to have same codebase for all targets. I don't have any AVR boards apart from an Arduino mega328.

There are a handful of files which are just stubs at the moment, they have some AVR details which I need to split into generic and target specific code. I have only tested the builds as far as basic comms, I can get a response to M115.

The code is at [github.com].
Re: Generation 7 Electronics Development
November 20, 2012 09:57AM
That's excellent, bobc!

On my part I've reseached on how to connect the heater MOSFETs in a simple, reliable way. The result is a mix from the HydraRaptor blog (thanks, nophead!) and the german wikipedia. It looks like this, the connetion leaving the picture to the right is directly connected to the microcontroller:




Generation 7 Electronics Teacup Firmware RepRap DIY
     

Attachments:
open | download - Gen7Board-ARM.png (14.2 KB)
Re: Generation 7 Electronics Development
November 28, 2012 06:44AM
@Traumflug: Your german wikipedia is also a link to the same article in nopheads blog and NOT wikipedia.


Bob Morrison
Wörth am Rhein, Germany
"Luke, use the source!"
BLOG - PHOTOS - Thingiverse
Re: Generation 7 Electronics Development
November 29, 2012 06:00AM
D'oh. Thanks for the hint, here's the correct link: [de.wikipedia.org]


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Generation 7 Electronics Development
November 29, 2012 10:41AM
Hello,
I'm an electronics engineer for about 20 yrs, and I'd like to add my view on 2 issues.

1. Power output
Given that the new designs with a heated bed and (possibly) multiple extruders need a lot of current, please note that ATX power supplies usually cannot deliver the full wattage over a single connection (the 20pin ATX connector). This why there is also the extra 4-pin +12V connector on the bunch of cables coming out of the PSU. If you look closely on the label of the psu, usually it will state the current available on each output, like: "12V1 10A, 12V2 12A" or something similar. This means that they come from different outputs and can delilver different amounts of current. I've found that in most cases the "12V2" connector is the 4-pins connector that will connect to your motherboard for extra power -- this one: [0.tqn.com].

So, it would make a lot of sense to add another connector on the pcb, so that the heated bed which arguably has the most power dissipation, to be connected to this PSU output. At least that's how I've modified my setup to work. The benefits of this proposal are:
a. There is no need to carry a large current on the pcb traces if you place this connector close to the heatbed mosfet.
b. The psu will be able to deliver the full power rated
c. The on/off distrubances of the bed (the large load that can easily be 10A or more) will have a much lesser effect on the other parts powered by +12V.


2. Bed MOSFET heat.
I've read what has been written and discussed in this thread about the heating of the mosfets. In the current arrangement where the N-type is used, most of the heating comes from the internal resistance of the mosfet because it is not fully on when driven by the microprocessor. [I've confirmed this on my Gen7 1.4 setup on its original form with the IRFZ44.] Datasheets show that to get the Rds down to the value stated, you have to drive the gate with a higher voltage than the 5V the CPU can provide. Although the voltage of the CPU may drive the gate slightly over Vgs (the threshold voltage) this does not mean that the device is fully on -- resulting in the Vds being much greater than what would be expected. That's why only say, 80% of the voltage is delivered to the bed. The remaining 20% becomes heat on the mosfet.

What is expected?
The expected voltage drop on a IRFZ44 having an internal resistance of 0.023Ohms at 10A (a typical value for a bed) is just 0.23V, which would generate zero heating. However, if you measure a board, you will usually find this voltage (Vds) to be ~2V or more. This is because the device is not fully ON. That's what TC tried to explain a few posts back.

There are two ways to solve the problem, both of them require the CPU pin to work in the opposite sense (i.e. pull low to turn the bed ON, turn hi to switch the bed off). Also another small-signal mosfet is needed to convert from CPU voltage to MOSFET gate voltage. Traumflug ahs added such an arrangement in his post above (Traumflug please read the footnote)

How to fix?
Two ways to fix this:

a. Use a P-type mosfet -- this is the cleanest solution
b. Try to bring the Vgs to the correct level

If there is interest I could post some sketches of either solution.

[@Traumflug: I have seen your diagram above, if you use 2n7000 series mosfets, please switch to 2n7000K. The first does not have ESD protection and can be spoiled the minute you touch it. The "k" series is much safer for handling by everybody, not only rookies. The most common type used is the 2N7002K. Also I'm not convinced the schematic posted above on Nov20 would work ok for you. If it doesn't work for you, PM me]

Argiris
Re: Generation 7 Electronics Development
November 30, 2012 08:18AM
Thanks for the insights, ardia.

Quote

So, it would make a lot of sense to add another connector on the pcb

You mean a third one next to the two already existing ones?

The 2N7002K might be a good idea, even if apparently available in a SMT package, only. At least a package with > 1 mm pin spacing. smiling smiley

Quote

There are two ways to solve the problem, both of them require the CPU pin to work in the opposite sense

No problem with this at all, inverting the signal on the microcontroller pins is trivial.

Quote

I'm not convinced the schematic posted above on Nov20 would work ok

Me not, either. As I'm a mechanical engineer, I have to try and error. The point of Gen7 is not to make a better working electronics, but a more replicatable/DIY-able one and to improve the industry-less manufacturing process. If you have a better design (keeping this goal without exploding the price), I'm all ears!


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Generation 7 Electronics Development
November 30, 2012 11:28AM
In your circuit, I would connect the source of T2 to ground, and the gate to the micro via R12. This would make it like the "standard" way of doing it, as recommended to me anyhow.
Re: Generation 7 Electronics Development
December 02, 2012 01:40PM
There's a new Generation 7 Electronics extension board: the Gen7 ExtensionBoard USB-B.



It makes the USB-TTL adapter obsolete, so one industrial plug-in board less smiling smiley

Looking at the previous posts here, be assured it was designed with the ARM variant in mind.


Generation 7 Electronics Teacup Firmware RepRap DIY
     

Re: Generation 7 Electronics Development
December 12, 2012 06:16AM
A thought RE: heated beds and PWM controlled heaters in general. For the cost of a coil and a diode, you can smooth out the power drawn by the heater. Simply connect the coil in series with the load, and the diode across both the load and the coil. This turns a normal PWM configuration into a buck regulator.
Re: Generation 7 Electronics Development
December 26, 2012 06:35PM
There's a new child in the Gen7 family:



Back: Gen7 v1.4.1
Middle: Gen7-AVR v1.5
Front: Gen7-ARM v2.0
... and a few plug-in boards laying around.

Now I'm wondering how Arduino IDE responds to an ARM Cortex-M0 ...


Generation 7 Electronics Teacup Firmware RepRap DIY
     

Sorry, only registered users may post in this forum.

Click here to login