It's the ever-tantalising stuff of so much science fiction, nowadays - the machine that can, and often is, mistaken for a real-life person.

In 1870, that scary/alluring prospect was embodied in a ballet that still captivates audiences across the globe. Yes, we're talking about Coppelia, the "Girl With The Enamel Eyes" as it was originally and fully titled. The ETA Hoffmann tales that inspired the very first choreography had a distinctly sinister note, the sweet-faced mechanical doll created by Dr Coppelius being used to hoodwink a gullible suitor into surrendering more than his freedom... For sure, those adoring words - "my heart belongs to you" - weren't meant to be taken literally.

On-stage, however, Dr Coppelius's walk on the dark side has been diverted into more of a comedy caper, as audiences can see for themselves when Birmingham Royal Ballet (BRB) makes a long-awaited return to Edinburgh next week after an absence of over six years.

"Coppelia has become that relatively rare thing in classical ballet," says BRB's artistic director David Bintley. "It's a full-length, three-act romantic comedy. What's more, it's the ballerina dancing the lead, Swanilda, who is responsible for a lot of that comedy. And it's an interesting challenge: not everyone can do it, and still keep the character believable and likeable."

If that makes Coppelia a worthy addition to the BRB repertoire, there's another reason - besides its box-office popularity - why Bintley has a soft spot for the ballet, and for the strangely secretive old doll-maker in particular.

"I danced Dr Coppelius at my graduation," he laughs. "I was 19, and there I was, in character as someone more than three times my age! I can remember even now - and I danced the role again and again after that - having to decide how to play him. Whether to make him totally silly, or with a sinister side that takes the idea of creating a living doll seriously.

"In a way, he is a tragic character. This dream he has, of Coppelia coming to life, is utterly destroyed by Swanilda in Act II.

"Then she heads off to get married, everyone else in the village is joining in the celebrations, and he has to pretend his life's work didn't really matter. I'm not sure it's an entirely satisfactory outcome, and I can understand why Jack Carter [legendary choreographer with London Festival Ballet and others] cut out Act III altogether in his version of Coppelia."

Rory Mackay, who will dance Dr Coppelius at some of the BRB performances in Edinburgh, has a degree of sympathy with that tack. "There I am, in Act III. I've been given some gold as a compensation, and I reckon all I want to do is get back to my workshop and have another go. Maybe get it right this time..."

He's a bit of a joker is Rory Mackay. He'll readily say as much himself, but it's a trait he puts to good use on-stage.

"I see Coppelius more as a lovable old soul than as a malevolent, sinister one," he says. "He's totally caught up in his own world, and his dolls are everything to him. We know his dream is a foolish one, one that could even land him in trouble. But he's a character in a light-hearted, romantic ballet, and I feel 'my' Coppelius has to be a real part of the comedy. A little bit of a jokey figure."

You'll have to imagine for yourself all of the above being rolled out in a rich Glaswegian accent that hasn't kow-towed in vowel or cadence to any Brummy influences, even after some 13 years with BRB. It was a particular talking point - and a useful hook for journalists - when Mackay first arrived in the company, where his younger brother Iain was already making his mark.

"It wasn't a problem," says Mackay. "We weren't competing for the exact same roles. Now, on the golf course? A completely different matter. That's very competitive!" He's laughing again, but not actually joking this time.

Ask him why he headed south - joining English National Ballet after he finished his training - and Mackay's reply is like a thumbnail sketch of dance education in Scotland not all that long ago. "Once you'd left the Dance School of Scotland at 16, you had no other option if you wanted a professional career in classical ballet. I continued training at the Royal Ballet school, and when I graduated... well, England was where the opportunities were at the time.

"For me now - and I've just turned 37 - a company like BRB has the kind of repertoire that includes a lot of character roles, not just Dr Coppelius, so I feel there's still a lot I can give within that area. Though after I've been sitting through Act III, hunched over like an old guy in the whiskers and wig, just standing up is tough. I'm stiff all over! But while you're on-stage, you're in character."

It turns out that was a lesson learned in Scotland when he - and indeed his brother Iain - were on-stage with Scottish Ballet in the late Peter Darrell's Nutcracker.

"That must have been in the late 1980s," he says, laughing as memories of those experiences come to mind. He recalls how, during one Royal Ballet summer school, "they were asking everyone about their favourite male ballet dancer. And it was all 'Nureyev' or 'Baryshnikov' or names that I'd never heard of. And I said 'Vincent Hantam' because I'd seen him dancing with Scottish Ballet and he was just amazing. I still remember wondering, 'Could I do that?'"

Ayrshire-born Laura-Jane Gibson, like the Mackay brothers, also came south in order to continue her training. "I went to Elmhurst [a frequent feeder of talent to the BRB ranks] and from there I was lucky enough to be offered a contract here. I already knew some of the people from summer schools, so it felt really welcoming. Now, it feels like home - I even met my fiance here."

The 26 year old is currently dancing various roles in Coppelia, with membership of Swanilda's close-knit posse being one of them. "We all have our own 'character' as one of her friends," she says. "There's a timid one, a really encouraging one. Once you've got to know the steps really well, you can start to find your own personality in them."

She feels, too, that dancing in a ballet like Coppelia connects everyone to a heritage that stretches back to the days when BRB was known as Sadler's Wells Theatre Ballet, based in London.

"Sir Peter Wright [the company's former artistic director] still comes in regularly to rehearse us in his ballets," she says. "There's definitely a bit of a buzz in the building when he's here. We all cherish those moments, and the advice he gives. You only have to look at old videos, or even at the name-tapes inside some of the old costumes, to realise that he did exactly the same with the dancers who came before us - and that is something very, very special. To be a part of that... you do feel incredibly lucky."

Back in 1992, Scottish Ballet briefly became a part of that Coppelia tradition when, unable to fund a new full-length commission, the company bought in the Peter Wright production that BRB was replacing with his updated version. When Wright, now almost 90, was just starting out, there was another young choreographer who loved story ballets. His name was Peter Darrell, the man who gave Scotland the national ballet company that flourishes today.

In 1993, Scottish Ballet toured its Coppelia to Japan where - until last year - David Bintley combined his role as BRB's artistic director with that of the National Ballet of Japan. His successor? Noriko Ohara, a former - and truly well-loved - principal ballerina with... Scottish Ballet.

Ah, yes! It's the ever-tantalising stuff of coincidences and connections where facts, not fiction, give memorable life to a doll with enamel eyes.

Birmingham Royal Ballet perform Coppelia at Edinburgh's Festival Theatre from February 4-7, www.edtheatres.com/coppelia