Spincoater - Sep 2023
Because reliably applying photoresist is a pain
DESCRIPTION
I made myself a spincoating machine. I used a my 3D printer and laser cutter to make this project.
Here are the main components :
- arduino nano
- VESC clone board
- 1500W 270kv brushless motor
- nokia 5110 display
- hall effect sensor
The case itself is pretty simple, it uses 3d printed parts to hold the wooden plates together with M3 screws. The bowl is quite fun, I used a PS petri dish D90 made a small hole tin the top as an injection port. I actually had to make a riser part with 3d printing because petri dishes are not tall enough for this. Why a petri dish then ? It was on the desk ¯_(シ)_/¯ ; Actually it was no longer sterile and destined for the bin. The bottom half of the petri dish was drilled to allow a 3d print to make the interface with the axle. The petri dish does not spin, the spinning part is a 3d printed part resting on a M8x60 bolt. The bolt was held by an abec -50 608zz bearing, this was causing A LOT of vibrations, I upgraded the holder to two ABEC 7 608zz bearings stacked on each others, this fixed most vibrations. The main source of vibrations right now is the bolt interface to the 3D print, this will have to be solved at some point. For now this will suffice as I do not plan to make anything requiring precision for the moment.
EDIT: This did not age well, the lack of precision and the vibration became a problem… I plan on fixing the issue by using a steel plate as this will provide some weight and stability, this will also help with speed variations.
As in most projects I used an arduino, the nano boards are even cheaper than the microcontroller itself, why bother :)
I mean, I’m jealous, the chinese have acces to cheaper clones of the cloned atmega chips that I used to use. How even do you ship a microcontroller devboard accross the globe for 1€10 if the chip itself is 2.4€ even on the cheapest supplier on LCSC wtf.
The motor is a brushless, this one is low KV meaning it runs “slow” for a brushless that is.
Here I chose to re-use the 270kv 1500w motor from the electric penny board I made a while back.
The rpm of the motor is dependent on the voltage, kv is really a way of saying rpm/V, so here 270kv is 2700rpm at 10V.
I am using a fake VESC called the FSESC but really any somewhat ESC would have done the trick as long as the amps rating is sufficient.
A nice touch is that the ESC I am using goes up to 13S LiPo, this means it can handle up to 54.6V (13×4.2V), heck they say it handles 60V in the datasheet !
I like the fact that it already has an XT60 connector as I will use this on battery power because I do not have a power supply powerful enough to run this.
The motor axle is connected to the output shaft via a belt with a 1:3 ratio.
Our maximum motor axle speed is 54.6x270=14742 rpm in theory, in practice batteries drain and we would not be able to maintain a constant speed due to the relation between motor rpm and battery voltage.
ENTER THE HALL EFFECT SENSOR
Right, so why a magnetic sensor ?
Well since we cannot use the ESC directly to get the motor RPM, here the VESC will only be slave, we need a way of knowing what the actual speed of the rotor is.
WHY ?
Because we need this info to form a feedback loop and tell the ESC what speed we need to go to. Yes this is confusing, when the arduino tells the ESC what speed it needs to go, it is like a percentage of the max speed allowable by the voltage available to the ESC. Meaning:
- The ESC has a full battery at disposal 54.6V, arduino asks for 100% speed, motor speed = 54.6270(100/100) = 14742rpm
- The ESC has an empty battery at disposal 42.9V, arduino asks for 100% speed, motor speed = 42.9270(100/100) = 11583rpm
OK but what if we measure the battery voltage with the arduino and apply software compensation ? That would only work to an extent, I mean if the motor has no load then theoretically you would not be far off.
BUT !
We have a load, there is friction and the world is a very cruel place.
Your max speed with a load is not the same as without, makes sense ?
So 100% with a small load is not the same rpm as 100% with a big load.
What do we do ? We measure weight and compensate in software again ??
Come on, jokes aside, we need feedback ont the actual speed.
Modern brushless in commercial applications such as ebikes have multiple hall effect sensors inside of the motor in order to measure speed and direction reliably.
Well I lied, this is mainly due to the democratization of FOC, an objectively better brushless motor control method than 6step but this is a topic for another day.
I do not use FOC because I will eventually return the vesc to another project and I will put a cheap esc in its place, thus no FOC for the motor nor UART control for the arduino.
Right, so hall effect sensor are magnetic sensors, here I use a smd hall effect sensor because I bought a metric ton of these while they were on sale.
I have placed a neodymium magnet on the drive shaft and each turn it makes I get a pulse on the microcontroller, this gives me feedback to the microcontroller.
I made a basic PID controller code, it tries to find the proper speed even between steps of the ESC.
Our user needs to enter the desired speed, here the rotary encoder and the 5110 LCD come into play.
I am using a rotary encoder, here again I will try to evangelize people about using full quadrature and not half quadrature decoding, it makes the UIs feel less sluggish and will skip steps less often !
The 5110 LCD was used because I have quite a few laying around, they are not even real 5110 LCD, these are HX1230 but are sold under the 5110 name for some reason.
I made absolutely zero effort for the UI, the unit starts up, initialize PWM for the ESC, then the LCD inits and displays “set speed:”. The user then uses the rotary encoder to set speed up or down, I have set min=800 max=16000, then the user must click the encoder button to start the motor. Once the motor starts spinning, the arduino tries to match the user set speed. When the motor is spinning, the user can see the set speed as well as the actual speed on the display. In order to stop the motor, the user can click the encoder button, this sends him back to the set speed screen.
The beast

The beast, Top view

The beast, Beautiful UI

//TODO: add files, assy guide, demo video, 3d render