Hello from the Bay Area!
Bar and I made the long journey down from Portland yesterday and are currently sitting in the beautiful, sunny Mill Valley, California! It sure does feel nice to be in the sunshine :)
This week we’ve got info about Tested, Maker Faire, and our reopening of sales! Additionally, Bar’s got a not-so-mini update with lots of information on software updates.
Tomorrow we’ll be heading to Tested to film! We are going to be featured on an episode of Tested in association with our presence at Maker Faire with Kickstarter, which is awesome! We still haven’t been told exactly when the episode will release, but of course we’ll be sure to share it as soon as it is!
Tomorrow afternoon we’ll make the move down to San Mateo to begin setting up for the Bay Area Maker Faire! The next four days are going to be quite busy, but we’re super excited to hopefully meet some of our backers, future Maslow owners, and to show everyone else what Maslow can do! As mentioned previously, being that we’ll be occupied with Tested and Maker Faire for the next few days, don’t worry if it takes a bit longer than usual for us to get back to you.
Another exciting advancement that happened on Monday is that we opened sales of the Maslow once again! We sent out an unlisted link to our waitlist and are happy to say that sales are going well. Of course this only adds to the craziness of this week, but it feels awesome to be making big steps and putting ourselves out there.
Bars (not so) mini update:
There were a LOT of changes to both the firmware and software this week.
This week Ground Control Changes The way in which large files (20,000+ lines of gcode) are rendered in Ground Control has been significantly improved. All files will now load faster and Ground Control uses much less RAM, making it run faster.
The first pass at the new dual level PID system is in place! That means that there is now one PID controller which regulates the speed of each motor, and a second PID controller which controls the position of each axis. Consider rewatching this video here for a technical recap on why this is an important change. This change removes the need for the motor calibration step. Maslow now continuously adapts to the weight of your sled. The way lines of Gcode are buffered was also improved, and the baud rate was increased from 19200 to 57600. All of these factors combine to mean that this week's firmware makes the machine faster, smoother and more accurate. Making this many changes in one week is sure to cause bugs, so let us know as you come across them.
This next bit gets pretty technical, don’t feel obligated to read if the technical underpinnings of the machine aren’t of interest to you.
Now that we've got two levels of PID control, we need to tune the controllers to give us the best possible performance. PID tuning can be an interesting process so we wanted to give you the chance to try for yourself (if you'd like).
As a quick recap, “PID controller” stands for Proportional Integral Derivative controller. Each of those terms is a variable that we can control. In software they are usually called Kp, Ki, and Kd respectively. Each of these variables changes the way the firmware moves the motors in some way.
Let’s look at the new PID speed controller as an example. In this case controller is continuously reading the motor’s speed and adjusting the voltage applied to the motor until the speed of the motor matches the desired speed.
In this case:
The Proportional variable sets how much the voltage changes as a result of the motor speed being above or below the target speed. If the motor speed is below the target speed, the voltage is increased. If the motor speed is above the target speed, the motor voltage is decreased. The voltage is proportional to how far above or below the target speed the current speed is.
The Derivative variable sets how much the voltage changes as a result of the way in which the motor speed is moving towards or away from the target speed. If the speed is rapidly approaching the target speed, we want to lower the voltage to prevent the speed from overshooting. This term is VERY sensitive to noise on the signal.
The Integral variable sets how much the voltage changes as a result of a steady and slight offset between the target speed and the final measured speed. If the motor is consistently operating slightly above or below the target speed, the integral term will slowly increase or decrease the applied voltage.
PID tuning is a bit of an art, and a bit of a science. If you are interested in the topic, I recommend this article (https://innovativecontrols.com/blog/basics-tuning-pid-loops) if you prefer to read, or this YouTube video (https://www.youtube.com/watch?v=uXnDwojRb1g) if you prefer to watch a demonstration.
There are two branches that will let you experiment with tuning the machine’s PID loops yourself.
The first branch can be found here: https://github.com/MaslowCNC/Firmware/tree/tune-velocity-PID-branch
When you install this firmware the machine will command the motors to step through a series of speed changes, and will plot the result for you. It’s a good idea to remove your sled and chains before running this process because the machine is just setting the motor speeds, it is not thinking of the sled position.
To open the plot after installing the firmware click Tools -> Serial Plotter from within the Arduino IDE. Note that the drop down in the bottom right of the plot window has to be set to 57600 to properly display the data.
You will see a plot like this as the motor steps through speeds. The yellow line shows the motor’s target speed while the blue line shows the motors measured speed. Notice how the motor “learns” about its own response over time so later responses are better than earlier responses. Try applying some force to the motor and watch as it corrects. Or try changing the values of _Kp, _Ki, or _Kd in the file MotorGearboxEncoder.h line 44.
The second firmware version works the same way except for the positional PID controller. You can find this firmware here: https://github.com/MaslowCNC/Firmware/tree/tune-pos-PID-branch
This version will command the machine to step through a series of gcode commands and plot the machines real position vs target position. The machine’s target position is shown in blue, the real measured position is shown in yellow, and the commanded signal to the motors is shown in red.
Tuning these PID controllers is the next thing on my ToDo list, but I probably won’t be able to work on it while I’m manning the booth at Maker Faire, so if you find values that work better than the current ones let us know!
And most importantly, have a fantastic week everyone!
-Hannah and Bar