I'm using qcc to build an xbar and Range control chart.

qcc(diameter, type="xbar", std.dev=0.011021, nsigmas=3). is the line of code I'm using.

The resulting graphic looks fine, the mean is correct and it shows the standard deviation (SD) as the same one I input (0.011021). However the control limits are off.

It's for a university assignment and I'm not sure if my confusion is on account of being taught a rudimentary way of determining the control limits. Which is the; mean + 3*(standarddeviation) = UCL and mean - 3*(SD) = LCL. Does qcc compute them in another way?

I'm just wondering if anyone can tell me why this is happening and whether there's a way around it?

The formula you describe refers to the standard deviation of the population not of the sample, to estimate the population standard deviation, assuming normality among the subgroups' mean, there are other formulas that make use of precalculated factors, very likely you would found tables for this factors at the end of your text book.

To illustrate what qcc does, I made one vector of 100 data points and assigned it into groups of either 5 or 10 measurements. The resulting xbar charts have very different control limits relative to the reported standard deviation.

library(qcc)
#> Warning: package 'qcc' was built under R version 3.5.3
#> Package 'qcc' version 2.7
#> Type 'citation("qcc")' for citing this R package in publications.
set.seed(899)
Dat <- rnorm(100, mean = 0, sd = 1)
Runs1 = rep(LETTERS[1:20], each = 5)
Runs2 = rep(letters[1:10], each = 10)
Mat1 <- qcc.groups(Dat, Runs1)
Mat2 <- qcc.groups(Dat, Runs2)
Out1 <- qcc(Mat1, type = "xbar")

Out2 <- qcc(Mat2, type = "xbar")

^{Created on 2019-09-22 by the reprex package (v0.2.1)}

Here is the code for the limits.xbar() function of the qcc package.