This is not any kind of notebook. This is something special. I did not know about it till the weekend until I read about. We Indians are always poor at recording and documenting things. I always wondered what is it that should actually be documented and what are the things that has to be left out. Should merely the working ways be documented or failures also? When should the documentation be actually done? If I document the experiment after I have done it I would always end up writing only the things that worked as there would be so much to write and I would have forgotten most of it. Even trying to document all of it was boring to death. I would wonder how great scientists who were always creative could spend time doing the monotonic documentation. It seems the Engineer’s notebook is the way to go. It surely does not cut down on the effort but it makes it more fun and more accurate.
So here is how it goes in summary. It is a log of everything that an engineer does everyday. Every calculation, every step and every observation gets logged in it. When the day begins the enginner writes the date and time on top. He also gives the work a heading. After that follows triads of Going to Do, Doing and RANT. These are the subheading in the left side of the margin. Going to do is where he plans what he is intending to do next, Doing is where he details everything that he is doing. This includes observations, pictures and lots of calculations. If the calculations go wrong, then not to worry, he simply cuts it with a single line and starts over again. But it is made sure that even the wrong calculation is readable. This helps in not repeating the mistake. This is followed by RANT. RANT stand for Reflect, Analise and NexT step. This is where he pauses to collect his actions. He makes observations of what he can conclude or what he thinks should be next steps or what he thinks he can improve upon. Most of the time one of these will become his next Going to Do.
This is concluded by a signature at the bottom of the page and if possible a supervisors signature next to his with the data and time of signing of. Though I have just summarized the notebook very trivially, details may be obtained from this wiki link. Enjoy Logging!!! and never lose a thought!!!
I surveyed a lot of online shops today in my country. I was looking for shops that sells Electronic Components at cheap rates. I got the following list of sites. This is surely not exhaustive but are the ones that I thought were good:
S.No
Website
Pricing
Availability
Remark
1
http://www.electroncomponents.com/
High
Low
2
http://www.evelta.com/
Very Low
Med
Good Site
3
http://hobby2go.com/
Very High
4
http://in.element14.com/
High
Very High
Bad website for small Purchase.
5
http://www.onlinetps.com/
Very Low
High
Good Site
6
http://www.digikey.in/
Low
Very High
Wholesale
7
www.vishaworld.com/
Med
Med
Slow Website
8
http://tronixkart.co/
High
Low
9
http://www.anandtronics.com/
Med
Very Low
10
http://in.mouser.com/
High
High
Branded only
11
http://www.componentsindia.com/
Very Low
Poor site
12
www.dnatechindia.com/
High
Very Low
13
http://nex-robotics.com/
Med
High
Good Site
14
http://www.frugal-labs.com/
Low
Not a component site
15
http://hacktronics.co.in/
Low
Med
Modules only
16
http://sonlineshop.com/
Very Low
High
Good Site
17
http://www.technofreek.com/
Med
Very Low
18
http://www.roboshop.in/
Med
Med
Kits only
19
www.digxtech.com
Low
Med
20
http://www.mgsuperlabs.co.in
Med
Med
Kits only
21
http://www.probots.co.in/
Very Low
Med
Good Site
22
www.kitsnspares.com
Med
Very Low
23
http://www.nskelectronics.in/
Very High
Low
24
http://www.rhydolabz.com/
High
Low
25
http://ventor.co.in/
Very Low
Very High
Good Site
The availability that I am talking about was checked for the component that I needed. I finally arrived at the 6 of the best sites from the above.
http://ventor.co.in/
http://www.evelta.com/
http://www.onlinetps.com/
http://nex-robotics.com/
http://sonlineshop.com/
http://www.probots.co.in/
The above seem to be the cheapest of the 25. Each of the top 6 has its own merits and demerits.
http://ventor.co.in/: This site has got a very high availability but it is costlier than the rest. It charges a Minimum Handling Charge of Rs.150.
http://www.evelta.com/:This site is moderate in all respects. I did not pay much attention to this site but the rates are almost like ventor and sometimes lesser.
http://www.onlinetps.com/:This is the site that I like the best. It is costlier than evelta slightly and atleast twice as costly as sonlineshop. But it charges only Rs. 50 for shipping and the Minimum order limit is less. It has the highest availability after ventor. It is a very good source for connectors. But it charged me Rs.70 extra as surcharge for online payment which was disappointing. I don’t know if others will do it too but I continued with the payment because the USB cable and HDMI cable was cheap and worth paying the extra 70.
http://nex-robotics.com/: It too has a good availability and the prices are similar or slightly lesser than onlinetps. I don’t have any idea about its shipping charges.
http://sonlineshop.com/: Extremely cheap. In fact the cheapest of all but its main problems is with buying resistors. Some of the resistors have a minimum order quantity of 100 which is not know until you checkout!!! I feel it might be a software bug as the minimum quantity sometimes specified in the site don’t match with what the checkout expects. But the prices are amazingly low. It wouldn’t hurt buying it all if you can find all you need in the same shop itself. Shipping charges is Rs.100 min which is more than onlinetps.
http://www.probots.co.in/:Not exceptional when it comes to availability but the things which are available are as cheap as sonlineshop mostly and the minimum purchase quantity is just 1 for most items.
I finally got the things that I ordered for from the online shop last week. They took nearly 10 days to deliver the product. I have received all the items except there was one drill bit less. Guess they missed out on that. Rest of the things were in proper quantity. I would not mind it so much for in an order of Rs.1300, 10 bugs don’t matter much. But I would surely mind if the components fail.
Last week as I was waiting for the hardware I read through the Zigbee protocol. I have read the PHY and the MAC layer. Some more is left to understand so I will blog about it next time. For now lemme blog about todays activity.
The day started off with a decision to finish and test the hardware. So before getting on to the actual work I decided to check the board ones properly for any disconnected routes and missing drills. I found a few missing drills and completed it. Then I spend the next 5 hrs soldering it. I was doing it very slow because I kept checking the components often for correctness. I did not want to do a mistake and remove a soldered component. Doing so inevitably spoils the board. After meticulously checking for errors I finished soldering. Though one difference I find is in the capacitors. I have put ceramic instead of a type of capacitor that the board design has. I don’t know what type it is. The BOM generated by KiCad calls it Cuni Package but I did not get much information on the Internet. This capacitor has 3 legs. I hope it makes no difference with the replacement.
Now I wanted to test the board and here came the road block. As the usbpicprog runs on a pic I had to program it first inorder to check the board. So I planned to find a computer with a serial port and use the programmer that I had built earlier for serial ports. And this was more difficult than I thought. I could not find a PC with Serial port. This showed me what obsolescence means in electronics. What was such a common thing earlier isn’t available anymore. Anyways I have some workstations in my lab which have serial port so I will use it tomorrow and check it. I just hope that it doesn’t give me any adventures and it works in one go.
In the previous blog I had mentioned that I had completed the hardware but I was not able to test the hardware. I had to load the bootloader into the controller. I tried doing it with my serial programmer but for some reason it did not work. Luckily I had given another Ic to my friend who got it programmed for me. I plugged that IC in the hardware and the board worked like a charm.
Upon connecting the jumpers as specified by the USBPICPROG website and connecting the USB to the USBPICPROG hardware with the software opened resulting in some LEDs flashing. At the bottom of the software Bootloader v.1.0. connected appears. I then loaded the Firmware-0.5.0.hex into the software and clicked on programming. In about 7 secs the PIC got programmed with the bootloader.
I removed the USB and connected the other jumper also. I reinserted the USB and started the software again and I was greeted with Your firmware is too old. Latest is 1.0.0. Consider upgrading? This being the first time that I was using this hardware I was too scared to try anything new. I was excited to use the hardware atleast once before trying anything new. So I ignored the update.
I connected another controller on a bread board and connected the necessary pins required for ICSP. I connected it to the hardware and tried autodetect hardware and to my surprise without any more problems it detected the PIC. I could then go ahead and program the PIC. I tried programming few other PICs also and it worked just fine.
After several use of the software the update request had started annoying me and I decided to update the firmware to the latest. I selected ok and it took me to /usr/share/usbpicprog. There was a firmware hex file which had already been downloaded without my knowledge. I selected it. Both the jumpers where still connected as against the advice from the website. The websites requires that one of the jumpers be removed to enter the bootloader mode before upgrading the firmware. On selecting the hex file it automatically started programming. On restarting the software I got a nice shock. The software said Bootloader or firmware not detected!!!
That message scared me and I thought I was done with the firmware I need to reload the bootloader. Just as a desperate measure I removed one of the jumper and reconnected the hardware. And the hardware booted in the Bootloader mode!!! PHEW!!! I felt relieved and I loaded the older firmware. I was pretty confident now that the bootloader remains safe and can be used for rescue always. On restarting it detected the old firmware and again gave an option to upgrade. This time I noticed that the I had forgotten to remove the ICSP connected to the other PIC. I removed the ICSP pins but still kept both the jumpers connected. On selecting the new firmware like the last time it got programmed correctly this time. And reinserting the usb showed the latest firmware version at the bottom of the software.
So I am finally set with the latest firmware and a working usbpicprog hardware.
Code::Blocks is a very nice cross platform IDE. I had been experimenting with it and have interfaced with SDCC compiler. CODE::BLOCKS automatically integrates with SDCC and it automatically fills in the necessary toolchain executables. So I will leave this part and jump directly to the steps for building the first project.
Steps for configuring the first project (I am writing my first project on PIC18f2550):
Go to File -> New -> Project and select an empty project.
In the wizard which opens up click Next.
The next screen prompts for the Project Title. Filling in a name will automatically fill in the rest of the fields. Click Next.
In the compiler option in the next screen choose Small Device C compiler and click Finish.
The left pane must show now a new project without any files.
Right click over the project and select Build Options from the pop up menu.
In the Compiler Settings Tab,
In the Compiler Flags Tab, select CPU architectures in the Categories Drop Down.
Check [CPU] PIC 16-bit
Click on Other options. Add the following text into it: -p18f2550 -Wl -m —use-non-free —verbose -V
The -p switch tells the compiler the exact pic name
-Wl -m is used to pass a switch to the Linker to generate the .map file in the output. This is a useful file normally suppressed by SDCC.
–use-non-free is required to use the PIC header files as it is not covered under GNU license
–verbose -V asks SDCC to be verbose and this helps in debugging the build
Now create the first program or use any available program from the Internet and add the file to the project by right clicking the project.
Clicking on build should build it and the bin folder inside the project directory should contain a hex file under the current build configuration (Debug/Release).
If the hex file is not produced read the verbose output for any syntax error or missing libraries.
SDCC looks for the default libraries libsdcc.lib, crt0i.o and libdevpic<picid>.lib at its default locations. If the libraries are not present in its default location you can manually specify the path in the Build Options (obtained by right clicking the project) and setting the linker search directories.
Quaternions have ushered in a significant paradigm shift in the representation and computation of rotations. This post is part of a series dedicated to exploring Quaternions and their practical applications in the context of rotation. In this particular post, we will delve into the Quaternion basics, including essential quaternion operations for working with them. Subsequent posts will explore more advanced applications of quaternions in expressing various types of rotations.
We commence by discussing the motivation behind the study of quaternions. It is crucial to establish why one should delve into this topic, and a glimpse into its historical context can greatly enhance our understanding. In particular, exploring the history of an ingenious invention like quaternions is an essential section. Following this historical exploration, we will delve into the fundamental operations that can be applied to quaternions. These foundational concepts are vital for comprehending how quaternions are commonly employed to represent rotations
Quaternion Basics
The orientation of any object can be described using various methods:
Euler Angles: This method employs three angles around independent axes to express orientation.
Orientation Direction Cosine Matrices: It utilizes a 3×3 matrix to represent a rotation.
Quaternion: This method employs a 4D vector to represent orientation.
Each of these methods has its own advantages and disadvantages. In this discussion, our primary focus is on Quaternions. When using quaternions to describe rotations, it offers several advantages compared to the other methods:
Clear Axis Representation: Quaternions make it very straightforward to identify the axis around which the rotation occurs.
Smooth Interpolation: Interpolating between two orientations is easy with quaternions. They do not suffer from issues like Gimbal Lock, which can be problematic in some other representations.
However, the only drawback of the quaternion representation is that it may lack intuitiveness. In this system, a single entity expresses rotation. Compared to Euler Angles or Direction Cosine Matrices, this can be less immediately understandable.
History
William Rowan Hamilton developed quaternions in 1843. At that time, he was immersed in complex analysis as his primary area of interest. Complex analysis had not yet matured entirely, making his discovery a significant advancement. He found appeal in the notion that complex numbers could undergo rotations in a plane through multiplication with another complex number. Similarly, he harbored a keen interest in applying the same concept to vectors in three-dimensional space.
Purely speaking mathematically, his contribution was in “Field Extension of the complex field \(\mathbb{C}\) to 4 dimensional space of quaternions represented by \(\mathbb{H}\).” As this field is not Abelian, that is, it does not have the properties of being commutative, Hamilton received a lot of backlash. People considered studying such mathematical structures not very useful in those days. But in the current times it is no longer the case. A lot of non abelian groups like matrices are of very large importance.
His contributions had a large impact on the mathematical community. As the American mathematician Howard Eves described the significance of Hamilton’s new approach by saying that
it opened the floodgates of modern abstract algebra. By weakening or deleting various postulates of common algebra, or by replacing one of more of the postulates by others, which are consistent with the remaining postulates, an enormous variety of systems can be studied. As some of these systems we have groupoids, quasigroups, loops, semi-groups, monoids, groups, rings, integral domains, lattices, division rings, Boolean rings, Boolean algebras, fields, vector spaces, Jordan algebras, and Lie algebras, the last two being examples of non-associative algebras.
— Howard Eves
Quaternions also picked up interest in the computer science and graphics community due to its ease of representing rotations. In addition, Quaternions find applications in quantum physics, where they can represent spin states.
Quaternion Operations
Quaternions is an extension of the 2D complex numbers to 3d. Willain Rowan Hamilton invented it in1843. He was attempting to come up with a technique for multiplying triplets when he arrived at the quaternions. Just as two complex numbers in 2D easily represent rotations through multiplication, quaternions simplify the computation of rotations in 3D.
Quaternions represent themselves as a vector of 4 elements in \(R^4\)
$$ \begin{bmatrix} a \\ b \\ c \\ d \\ \end{bmatrix} \epsilon R^4 $$
This also breaks down into scalar and vector parts
a = scalar (b,c,d) = vector
This is also represented as $$q =j\alpha_1 + i\alpha_2 + j\alpha_3 + k\alpha_4$$ The Quaternions are governed by the following rules for multiplication
$$ i^2 = j^2 = k^2 = ijk = -1 $$
Addition
Addition in quaternion is same like addition in the case of complex numbers where the numbers are added element wise.
Two quaternions given by
$$ q_1 = a + b\hat{i} + c\hat{j} + d\hat{k}$$ and $$ q_2 = e + f\hat{i} + g\hat{j} + h\hat{k}$$
Magnitude of a quaternion is given as the square root of sum of square of each element
$$ |{q}| = \sqrt{a^2 + b ^ 2 + c^2 +d^2} $$
Inverse
Inverse is given as conujugate divided by the square of the magnitude
$$ q^{-1}=\frac{\overline{q}}{|q|^2} $$
Conclusion
This post covered the history of the quaternion, the motivations around it. The quaternion basics sections also covers the basic quaternion operations. These will gear us to understand the applications of quaternion in the following post.