2019-10-15

Dissolvable PVA support

The TAZ Pro has two extruders which allows me to try and use dissolvable PVA support. Support is simple enough but hard to remove from the print cleanly, so using PVA allows extra options - just dissolve it!

I have had to play with the Simpify3D settings a bit as the settings for the TAZ 6 did not quite work. I am not sure if the bed is different, the nozzle, or what but my prints were almost welded to the bed. I have tweak the settings for nice clean prints with nGen now. The next challenge was settings for PVA supports.

I ordered some from RS (yes, the price was not silly, strangely), part 174-0082. Well, actually I ordered from someone else, and realised wrong diameter, after opening it, D'Oh, but now I have the right stuff I googled a bit to find temperature.

It is funny stuff, and I ended up printing at 205C which is apparently on the high side. I could also see from simply feeding the filament that it came out thick and slow (around 1mm).

The key setting needed to stop it just curling up was speed - it needs to be very slow. In the end I ran with 2x multiplier, 1mm wide, 20% print speed, and that actually worked. Well, mostly (the eyes went a tad wonky, but worked).


For a start, the PVA comes away from the model really easily, so that is a good start.


Then, put in warm water for a while to remove the last bits, and yay, it worked.


Now to try something more complex with enclosed parts that simply could not have been printed before.

2019-10-10

LulzBot TAZ Pro (dual extruder)

I have been 3D printing for a long time - and even coded a slicer once.

I have tried many printers. My current favourite for cost and performance is the LulzBot TAZ. We have a TAZ 6 at the office and (even though not on the A&A web site) we do 3D printing if you want.

It is a nice heated bed, which works well, especially with my filament of choice ColorFabb nGen.

I have been using to make cases for various electronics / R&D.

Sadly I slightly fried my TAZ 6 units. I have a new controller board on the way, but decided to check what they have now, and saw the TAZ Pro. So I ordered one and to my surprise it arrived in a couple of days (in spite of warnings of back orders and long lead times). Nice.

It is nice...


But is it worth the price (around £5k)?

Well, possible. It has some nice features and works very well. I have only been playing with it for a day now, but I can make some comments. The bed levelling is faster and seems more consistent. The Z axis is belt driven meaning it can easily use Z moves when moving from one part to another (far too slow when Z axis is screw). The big thing is the dual extruder.

Cura?

LulzBot recommend Cura, a good, free, 3D slicer. It works well, and makes some impressive prints, but...

  • It seems way slower than I am used to (I used Simplify 3D before)
  • The prints, whilst nice, and precise, seems brittle. I expect minor tweaks to settings would help.
  • It expects nGen to be glue sticked to the bed - and I know it can be printed without, but needs hotter bed for first layer. I tried that and it worked.
  • Somehow the prints were distorted. I am not sure if cooling is right. I am sure it could be tweaked.
However, it did work, as I say. And the reason I tried it is that Simplify3D, which I was using, had no profile for the new printer.

But, Simplify3D support emailed me one, within a few hours of asking. It works!

Simplify3D

Whilst I do not usually end up recommending paid-for software, this is good. It works well. It is way faster. It is not perfect, but nothing it, but it is nice to use. So I recommend it.

Dual Extruder

This is the first time I have used a dual extruder. But the TAZ Pro does it really well. The heads are motorised to retract completely out of the way. The full bed size is still available to both extruders. It really works well.

There are several reasons to use a dual extruder.
  • Two colour prints - obviously. To be honest this is a pretty minor use case. But it works well.
  • Mixed materials - combine fixed brittle material and flexible rubber to make complex designs - not tried it yet, but fun possibility.
  • Using dissolvable supports - this is likely to be the main use.
The dissolvable supports will be subject of another blog when the PVA reel arrives. Basically, 3D printing like this cannot always print what you want as some things are "in mid air". Using support material works, but has to be cut/broken off, and is impossible to do "inside" some designs. Using dissolvable supports allows the impossible to be printed, and then put in warm water for a while. I look forward to it.

The dual head working is impressive...


In the mean time - two colour test print...



Any downsides

The only one so far is the heads are covered by a safety guard with warning about being hot - which means you cannot see what is printed as it prints.  Ironically it means you cannot see the print head, and can end up burning your finger when trying to adjust something because you cannot see where your finger is. Elf 'n' safety gone mad, IMHO. If it always "just works" then I guess it is not a problem. TBH they should have designed with angled plastic to make a guard that allowed viewing of the actual print head. This may seem trivial but I do feel is more important than they realise. Even ignoring the practical aspects of knowing a print is not working right ASAP, seeing what is being printed it important for selling the whole idea of 3D printing...

USB-C not so easy

Using a USB-C connector for power only is, sadly, not as simple as I thought.

Yes, the pins are tiny, butt the end pins are double pins on the connector and just about solderable (0.6mm wide for two pins together).


However, whilst this works when you use a legacy cable from a USB-A, giving 5V, this will not work to a true USB-C power supply or device.

Why?


Well, resistance is not futile, it seems. There are two connectors (CC1 and CC2) on the USB-C which need resistors to GND to tell the other end you want power.

Whilst the end power connections are two pins at a time (0.6mm), the CC1/2 pins are not, and are 0.3mm wide at 0.5mm spacing. That is pretty much impossible to mill, as the milled track is anything from 0.3mm to 0.6mm wide. The picture above shows around 0.5mm milled track, which is deliberately spaced to allow soldering to the pin 6th from the right. So double pin on right (GND), next double pin in (VBUS) and then another pin we don't care for and then the CC pin. Same on the other side of the connector, except the CC pin is next to the VBUS on that side.

Yes, it is possible to solder!


Then to add the 5.1kΩ resistors to GND.


The end result is power from USB-C...

P.S. Thanks to John for pointing this out to me.
P.P.S. John also pointed out that you do need the two resistors - and cannot simply common up CC1/CC2 with one resistor (as RasPi4 did, by mistake).

2019-10-08

Powering widgets

Making widgets for the alarm system means that power is quite simple - the alarm wiring has 12V DC, and a simple regulator means I can connect to that - typically with screw terminals.

However, making other widgets with an ESP32, like the environmental monitor, or the Brexit clock, means finding a way to power them. I am not yet playing with battery powered stuff (will do, eventually), so need a power lead.

So what to use?

Initially I tried a micro-USB. Leads for this are very common, and USB-A sockets providing 5V are so common they are fitted to standard power sockets even, so seems ideal.

The issue is the connectors. I have struggled to find what I need. I did see some from China (which have not yet arrived) which have only the power tabs on them making soldering easier, and have clips to hold to the PCB. Whilst waiting for those, I tried some simple surface mount connectors.

The problem is they are not very robust, even superglued to the board, they can become detached very quickly.

I have actually made a set of tools under OpenSCAD two make tight fitting 3D cases to help hold the connector in place, which has helped, but that is still a challenge, and I am not happy about it.


The other catch is the tiny tiny surface mount connectors... Thankfully I only need the ones at the ends. For reference, the three pins at the bottom are 0.1" spaced.

So, I wanted to find a solution, and turned to USB-C. These are a nightmare, not only tiny tiny tiny surface mount tabs, but tabs under the connector so you cannot get to them with a soldering iron. Finally I found a part that will do, and from a UK supplier.

It did mean some fine milling, and even finer soldering, but again, only needing the double connectors at the ends, so just about possible. Those pads are 0.5mm spaced!


The result is a nice solid, soldered to the board, connector.


2019-10-02

IoT

I have not done much on the IoT for over a week, but being rather ill for a few days has not helped 🤮🤮🤮🤮🤮.

The Brexit clock is getting scary!

My grandson wants to do something with LEDs some time!

The environmental sensors are working well, and I have nice graphs from it... This will probably lead to some fans in the office now.



I am thinking the next IoT thing to look at may be Bluetooth. Any suggestions for how that could be fun?

But yeh, the LEDs for my grandson are going to be a thing soon. Here he is abusing his first LEDs.



2019-09-24

Brexit

Back in 2016 I posted how there really was not enough information for anyone to vote on the referendum to leave the EU. How could members of the public make any sort of informed decision.

We are now way down the line, and things are sadly only slightly better.

I am amazed how this has polarised the country. Even people in "my bubble" can be massively Brexit still and there is no reasoning with them. And so much disinformation still exists, even now where Boris Johnson said we could ban Shark Fin Soup if we left the EU. WTF is that as an argument? Who cares about Shark Fin Soup?! From what I can tell it is either "not true, WTO rules means you can't ban it", or "true, WTO rules have an exception, but that means we can ban it now even in the EU". Still the mad sound bites of disinformation persist even three years later.

Is change good?

If you are a good businessman then change can always been good - you can always exploit it. Even when you look at war and the blitz spirit (as has been evoked regarding Brexit?!) there were "businessmen" that made money (and were illegal as black market traders). Imagine in the blitz, in an air-raid shelter and bombs dropping - we survived. But imagine if 52% of people in there voted for the bombs?

And if you know a change will happen you can be even better at exploiting it. It is coming out how some people in politics have direct personal gain linked to Brexit. Scary.

But "good" for some careful businessmen will always be "bad" for someone. That money they make comes from somewhere.

In my personal view I cannot see Brexit being good for the UK overall. It seems counter intuitive to be isolationist, and then still want to trade with the world.

Personally, I am hoping that I am finally doing well enough in business that I, and my family, can cope. But that is by no means certain, and I am scared! Even if it was the case, I would not wish the hardship that will ensue on everyone else, whether my friends, my staff (also friends), my customers (also many friends), or anyone else.

Limbo

One of the huge issues is uncertainty.

A50 can be revoked, or delayed, so nobody knows for sure what will happen right up to the wire!


We cannot have this again - we need the A50 process to be 100% certain, no delays and no extensions, and no way to revoke. A country leaving EU makes one decision to do so and then has time to make it happen, and that is it. That needs to be the case even if the UK decides, again, to leave.

What we have now is hugely damaging, maybe more so than having left already!

As EU members we should change the A50 process to fix this!

We import from China!

What interested me was comments from a close friend. Smart chap. We make products that use chips that come from outside the EU, like China. The comment is that Brexit is therefore not so much of an issue, surely.

But we (UK) don't import from China, we (EU) do. So when we Brexit, we (UK) have to have the trade agreement to import those parts to UK (not EU). Is that in place? - well I don't think so, even after many years.

It is so easy for anyone, even smart people, to miss some of these obvious details. Brexit is not simple.

[I am not sure China is necessarily the best example, but assuming just because we trade with a non EU country before Brexit does not mean we, as the UK, have a trade deal to allow trade after Brexit. It needs negotiating. The government claim to have managed to negotiate several "continuation" deals already, which is a good start, but they needed negotiating, and more are needed still, they are not just what automatically happens when we Brexit, which is what people were assuming.]

Will of the people!

This is perhaps the most annoying part! We accept people can change their minds as we have a general election every few years, but somehow Brexit is a "fixed point in time" (DrWho?).

In fact that the referendum was a "poll" (as stated in the legislation). It was not a mandate. And then it was (as decided by courts) conducted outside the legal constraints for such campaigns. Had it been a mandate it would have been struck down, and was not only because it was just a poll.

As I said in my 2016 blog post, I did not know what was the right way to vote. I voted to remain, but I did not do that as an informed decision by any means.

Now, we have some clues on the issues with disentangling the UK from the EU. At best we have some good deal with EU - but such a deal means we have to abide by a lot of EU law on the way we do things with no say in such law! The alternative is not having a good deal, which is worse.

We have the crazy situation now that calls for a "people's vote" are called out as undemocratic. The idea that asking the "people" to vote on this is not democratic is, well, mental!

We also have the issue that this is "one sided". We leave, and no way we ever re-join on anything like he deal we have now. We stay, and we can vote to leave again in a few years if the EU goes OTT and we don't like it. So leaving is a "really really sure you want to do this" type of thing.

Breaking the deadlock!

I see the only way to resolve this is something that everyone can see is the (current) "will of the people", such as another referendum or a general election fought on the Brexit issue. Only then can anyone say, again, "you lost, get over it".

That will still be bad. A lot of people convinced that Brexit is right will be cross. I don't know what to say. I have yet to find a single person who can explain the benefit of leaving!

I do feel that if Brexit is cancelled, whatever government we have will need to make a big issue of "why Brexit". They need to tackle each and every one of the reasons Brexiters wanted to leave, in detail, and with actual change. Some things are simple (blue passports), and some are not so simple, but they all need addressing. I feel we can sort the underlying issues and stay in the EU. Why not?

Bad EU laws?

But are there bad EU laws we don't want?

Yes, absolutely, there are laws that, in my view, go too far, or get it wrong. Not least of which was the damn cookie stuff creating those damn cookie consent warnings on every damn web site! That was technically stupid in so many ways, and I am sure many other such laws are "wrong". Sadly GDPR adds to that - mostly good - a tad bad.

The problem is that there are always wrong laws, and the UK has passed many (RIPA / IPA) that have bad things in them on both moral and technical grounds.

The EU is not immune too this, and neither is the UK. But leaving the EU means we have no say in such EU laws. We cannot fix them. It does not, however, mean we can ignore them as almost any trade deal will mean complying to standards set in such laws.

And to be fair, most of the laws are good! As a manufacturer, the hassle for CE marking is a nightmare now, but even though it is hard work and costs a lot of money it is all "good". It stops stuff catching fire, for example. The UK would mirror almost all EU safety laws as that is both sensible, and needed to sell to EU!

Conclusion

  • I'd like to stay in the EU, though a lot of that is because of the obvious chaos caused by leaving it at this point.
  • I'd like to see all of the underlying issues that Brexiters want addressed looked in to and sorted, as part of the EU. This is important - a lot of people are unhappy, and this needs addressing!
  • I'd like to see MEPs taken a lot more seriously by all - this is how we shape the EU to be what we want!
  • I'd always consider leaving EU in future as an option, but really only makes sense if EU starts to really fall apart.
  • I'd like to see A50 process fixed for any country planning to leave to remove any "left in limbo" effect - this is absolutely crazy!

2019-09-21

99% of insurance claims

I have seen/heard a couple of slightly odd averts lately. Yes, I try and avoid adverts, but these seemed a tad odd.

One was an advert for a life assurance company proudly claiming that they "pay 100% of claims". The implication (though, I think, not said) is that other companies do not.

This seems a very strange claim to me. That can't mean it, surely. After all, if true, I should put in a claim. I'm not a customer, but if they pay 100% of claims it would be a way to get free money.

So I assume they mean they pay 100% of valid claims. But then that is what I would expect, what is their contract, and indeed what I would expect of every such company. Surely no life assurance company refuses to pay a valid claim, else they just get sued.

The second advert was an insurance company proudly proclaiming that they pay "99% of claims".

Again, odd. If they mean 99% of all claims, then they seem to be proud that only 1% of claims are fraudulent. I have no idea if that is good or bad compared to the industry, but I cannot see how it is a marketing statistic in any way. How is only 1% of claims being fraudulent a "selling point". Or are they saying that actually there are more than 1% that are fraudulent but they pay them anyway, thus being proud that they are being ripped off (and hence the customers that pay premiums being ripped off, ultimately). Or are they saying they don't pay all valid claims? I.e. you have a 1 in 100 chance of your (valid) claim not being paid if you go with them.

I just cannot understand the marketing point being made by either of these adverts. Crazy!

2019-09-20

Countdown and clock changes

As I mentioned, for the Brexit clock, I had to allow for the clocks changing (something many such countdown clocks do not allow).

Basically, one of the days between now and (the current) Brexit is 25 hours long. This, in itself, is not complex.

I have tinkered with the way I do this a few times, and eventually came up with this, starting with how many whole days...

  • Work out a time for UTC midnight on target date
  • Work out a time for UTC midnight today
  • Divide time difference (as seconds) by 86400 (a day) for number of days
  • If the current local time (HH:MM:SS) is on or after the target local time (HH:MM:SS) take off one day from that total.

That is the easy bit, and means that the number of days changes at the local time (HH:MM:SS) of the target, so for Brexit, changes at 11pm local time exactly each day. What normally happens is the time part then counts down from 23:59:59 until 00:00:00 at 11pm local time the next day.

However, working out the time part is one area that took me a bit of thought. In the end I make use of the fact that linux mktime() function allows tm_mday to be any value and it adjusts.

So, what I do is :-
  • Create a date for the target date/time, local time.
  • Subtract the calculated number of days from the tm_mday part of that.
  • Work out time difference from that point to current time, and convert to hours, minutes and seconds.

The effect of that is that once the day changes, the time part goes down without a discontinuity. It means that on the day that has the clock change the clock will start counting down from 24:59:59 instead of 23:59:59.

For Brexit, that means that 11pm on Saturday 26th October 2019 it will go to from 5 days 00:00:00 to 4 days 24:59:59 and count down for 25 hours until 11pm on Sunday 27th October when it goes to 3 days 23:59:59.

Of all the ways to work this out, I think this is the best. It means days are counted to the local time on each day that matches the final target local time (so for Brexit, its counts a day at 11pm local time each day), and then that the time part counts without a discontinuity down to 00:00:00 at the same local time the next day.

Yes, I put far too much thought in to this.

2019-09-14

Brexit countdown clock

Having made the environmental sensor, I have now cut down the design to just the processor and OLED display so I can make other things.

One example is a Brexit clock. I have put the code and PCB and 3D case on GitHub (here). It may need regular code updates, obviously :-)

It did raise one issue though. Most of the Brexit clocks I see, like Sky News's (here) seem to be an hour out. Brexit is at 11pm but they show days plus time that would be midnight.

Now, I know why... Someone is being lazy and simply dividing time of Brexit minus time now by 86400 and ignoring the clock change. One of the days between now and Brexit is 25 hours long, but that does not stop it being "one day".

My clock gets it right, obviously.

There are other uses for the app - and as I am taking one of my grandsons on a his first cruise, I thought he may like this...


He heard the phones in the suite have a button labeled "pizza" :-)
He is already packing!

P.S. This is why I have a milling machine and a 3D printer! I came up with the idea over coffee this morning at around 9am. I had to design a new PCB and a new case, mill the PCB, 3D print the case, and assemble it all, as well as make the code. I had a working version by around noon. My grandson is going to love this, I am sure!

2019-09-12

Environmental sensor

For my latest little R&D project I have made a new environmental sensor. These should help us see how good the air quality is in the office, and as usual, I have published this as an open source project for anyone else to make the same.

This proved to be a bit of a challenge, as always. I have already managed to get my head around the ESP32 and the Espressif ESP-IDF now, and have a set of  MQTT based tools as a base (here).

Hardware

I used an ESP32-WROOM-32 again, as they are really nice. I also used an SCD30 CO₂ sensor, which is the most expensive bit at around £40 from RS. I got a nice 128x128 OLED display from Amazon, and a DS18B20 temperature sensor.

One challenge was space - I decided to make the the PCB the same size as the OLED PCB and sandwich the CO₂ sensor in between. This was definitely a challenge to get connectors to fit!

I also decided to try the Molex SPOX connectors as they seem relatively cheap and easy to use.

The other aspect which is especially challenging is power. Most of the bits I have done to date have been alarm and access control and so use 12V on screw terminals. As it happens the unit (pictured above) takes 12V which is in the wall for the door control. But for use in bedrooms I need power to these and so I went for a micro USB. This is simply because that is a really easy and readily available and cheap way to provide a device with power.

The challenge itself is that the connectors have tiny tiny 0.635mm spaced contacts, and are also mechanically crap and come off the board. I ended up getting some connectors that I could superglue to the PCB, and thankfully the power contract are the end, so even though milling and soldering at 0.635mm pitch is just about possible (surprisingly) I can avoid this by actually only soldering the end pins for power. I decided to make the 3D printed case design fit tightly around the connector as well for extra mechanical support, except that means removing from the case pulls the connector off the PCB!

In short, some interesting new hardware challenges.

Software

There are a lot of libraries around for ESP32 and ESP-IDF already, which is nice - but perhaps not as many as for the ESP8266/Arduino based environment.

That said, these are simple enough devices, so actually I ended up doing the I₂C interface for the CO₂ monitor myself using the ESP-IDF directly.

I used a library for the DS18B20 though, and it seems they have been quite clever using the IR remote control hardware to make the one wire bus work using DMA. Impressive. I decided to use a DS18B20 as (a) it allows the thermometer to be positioned where you want, (b) it is away from the components that could get slightly warm, and (c) it seems way more accurate than the one built in to the SCD30 CO₂ sensor. However, the code is happy to use the SCD30 if you don't want to use a DS18B20. Similarly, the code is happy to work without a display, but I am quite pleased with the display, to be honest.

For the display, there is a good Adafruit GFX library, but I ended up doing it myself. The commands for the SSD1327 OLED controller are simple enough, and only a few lines of code to send a whole frame buffer over I₂C. As such, I decided to make some 16 grey level renders of my existing font designs. There is also a logo (configurable).

I found the CO₂ reading was liable to change quite quickly. This is great, except just standing looking at it caused it to change a lot due to your breath. So I ended up damping the reading (biased average with last reading) to remove spikes.

I also decided to round the values for reporting on MQTT so that it is not flooding with updates every second. Configurable rounding, preset to CO₂ at multiples of 10ppm, RH at whole percent, and Temp at 0.1℃. I also added some hysteresis to the reporting.

Obviously I have my air-con control code working with it - just had to tell it a different topic to watch for on MQTT, but I added logging of CO₂ and R/H as well just for fun.

And finally I added settings so it can send MQTT to turn a fan on or off based on CO₂ levels.

It is interesting to see how CO₂ changes during the day.

Overall I am very pleased with it. It is all on GitHub (here) with PCB milling, 3D printed case design, and code. Have fun.

P.S. The OLED displays are made of glass, and very very very easy to accidentally break. Especially if the 3D case design is a fraction out!


P.P.S. I have one by my bed, and it is quite bright, so I now have an MQTT contrast command tied in to the sleep tracking stuff so when I get in to bed it goes dim :-)